@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
package/custom-elements.json
CHANGED
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"type": {
|
|
65
65
|
"text": "Meta"
|
|
66
66
|
},
|
|
67
|
-
"default": "{
|
|
67
|
+
"default": "{ title: 'Wrapper/App', component: 'gs-app', parameters: withComponentDocs({ fetchMock: {}, componentDocs: { opensShadowDom: false, expectsChildren: true, codeExample, }, }), decorators: [withActions], tags: ['autodocs'], }"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"kind": "variable",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"type": {
|
|
73
73
|
"text": "StoryObj<{ lapis: string }>"
|
|
74
74
|
},
|
|
75
|
-
"default": "{
|
|
75
|
+
"default": "{ ...Template, play: async ({ canvasElement }) => { const canvas = within(canvasElement); await waitFor(() => { expect(canvas.getByText(LAPIS_URL)).toBeVisible(); expect(canvas.getByText('\"name\": \"ORF1a\",', { exact: false })).toBeVisible(); }); }, }"
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"kind": "variable",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"type": {
|
|
81
81
|
"text": "StoryObj<{ lapis: string }>"
|
|
82
82
|
},
|
|
83
|
-
"default": "{
|
|
83
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: { name: 'referenceGenome', url: REFERENCE_GENOME_ENDPOINT, }, response: { status: 200, body: referenceGenome, }, options: { delay: 5000, }, }, ], }, }, }"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"kind": "variable",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"type": {
|
|
89
89
|
"text": "StoryObj<{ lapis: string }>"
|
|
90
90
|
},
|
|
91
|
-
"default": "{
|
|
91
|
+
"default": "{ ...Template, args: { lapis: 'definitely-not-a-valid-url', }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); await waitFor(() => { expect(canvas.getByText('Error', { exact: false })).toBeVisible(); }); }, }"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"kind": "class",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"type": {
|
|
110
110
|
"text": "ReferenceGenome"
|
|
111
111
|
},
|
|
112
|
-
"default": "{
|
|
112
|
+
"default": "{ nucleotideSequences: [], genes: [], }"
|
|
113
113
|
}
|
|
114
114
|
],
|
|
115
115
|
"superclass": {
|
|
@@ -223,23 +223,54 @@
|
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"kind": "javascript-module",
|
|
226
|
-
"path": "src/web-components/
|
|
226
|
+
"path": "src/web-components/index.ts",
|
|
227
|
+
"declarations": [],
|
|
228
|
+
"exports": [
|
|
229
|
+
{
|
|
230
|
+
"kind": "js",
|
|
231
|
+
"name": "App",
|
|
232
|
+
"declaration": {
|
|
233
|
+
"name": "App",
|
|
234
|
+
"module": "./app.js"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"kind": "js",
|
|
239
|
+
"name": "*",
|
|
240
|
+
"declaration": {
|
|
241
|
+
"name": "*",
|
|
242
|
+
"package": "./visualization"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"kind": "js",
|
|
247
|
+
"name": "*",
|
|
248
|
+
"declaration": {
|
|
249
|
+
"name": "*",
|
|
250
|
+
"package": "./input"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"kind": "javascript-module",
|
|
257
|
+
"path": "src/web-components/input/gs-date-range-selector.stories.ts",
|
|
227
258
|
"declarations": [
|
|
228
259
|
{
|
|
229
260
|
"kind": "variable",
|
|
230
261
|
"name": "meta",
|
|
231
262
|
"type": {
|
|
232
|
-
"text": "Meta<
|
|
263
|
+
"text": "Meta<DateRangeSelectorProps<'CustomDateRange'>>"
|
|
233
264
|
},
|
|
234
|
-
"default": "{
|
|
265
|
+
"default": "{ title: 'Input/DateRangeSelector', component: 'gs-date-range-selector', parameters: withComponentDocs({ actions: { handles: ['gs-date-range-changed'], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'select', }, options: [ PRESET_VALUE_CUSTOM, PRESET_VALUE_ALL_TIMES, PRESET_VALUE_LAST_2_WEEKS, PRESET_VALUE_LAST_MONTH, PRESET_VALUE_LAST_2_MONTHS, PRESET_VALUE_LAST_3_MONTHS, PRESET_VALUE_LAST_6_MONTHS, 'CustomDateRange', ], }, customSelectOptions: { control: { type: 'object', }, }, earliestDate: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, args: { customSelectOptions: [{ label: 'CustomDateRange', dateFrom: '2021-01-01', dateTo: '2021-12-31' }], earliestDate: '1970-01-01', initialValue: PRESET_VALUE_LAST_6_MONTHS, width: '100%', }, decorators: [withActions], tags: ['autodocs'], }"
|
|
235
266
|
},
|
|
236
267
|
{
|
|
237
268
|
"kind": "variable",
|
|
238
|
-
"name": "
|
|
269
|
+
"name": "DateRangeSelectorStory",
|
|
239
270
|
"type": {
|
|
240
|
-
"text": "StoryObj<
|
|
271
|
+
"text": "StoryObj<DateRangeSelectorProps<'CustomDateRange'>>"
|
|
241
272
|
},
|
|
242
|
-
"default": "{
|
|
273
|
+
"default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-screen-lg\"> <gs-date-range-selector .customSelectOptions=${args.customSelectOptions} .earliestDate=${args.earliestDate} .initialValue=${args.initialValue} .width=${args.width} ></gs-date-range-selector> </div> </gs-app>`, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-date-range-selector'); const dateTo = () => canvas.getByPlaceholderText('Date to'); await step('Expect last 6 months to be selected', async () => { await expect(canvas.getByRole('combobox')).toHaveValue('last6Months'); await waitFor(() => { expect(dateTo()).toHaveValue(toYYYYMMDD(new Date())); }); }); }, }"
|
|
243
274
|
}
|
|
244
275
|
],
|
|
245
276
|
"exports": [
|
|
@@ -248,208 +279,186 @@
|
|
|
248
279
|
"name": "default",
|
|
249
280
|
"declaration": {
|
|
250
281
|
"name": "meta",
|
|
251
|
-
"module": "src/web-components/
|
|
282
|
+
"module": "src/web-components/input/gs-date-range-selector.stories.ts"
|
|
252
283
|
}
|
|
253
284
|
},
|
|
254
285
|
{
|
|
255
286
|
"kind": "js",
|
|
256
|
-
"name": "
|
|
287
|
+
"name": "DateRangeSelectorStory",
|
|
257
288
|
"declaration": {
|
|
258
|
-
"name": "
|
|
259
|
-
"module": "src/web-components/
|
|
289
|
+
"name": "DateRangeSelectorStory",
|
|
290
|
+
"module": "src/web-components/input/gs-date-range-selector.stories.ts"
|
|
260
291
|
}
|
|
261
292
|
}
|
|
262
293
|
]
|
|
263
294
|
},
|
|
264
295
|
{
|
|
265
296
|
"kind": "javascript-module",
|
|
266
|
-
"path": "src/web-components/
|
|
297
|
+
"path": "src/web-components/input/gs-date-range-selector.tsx",
|
|
267
298
|
"declarations": [
|
|
268
299
|
{
|
|
269
300
|
"kind": "class",
|
|
270
|
-
"description": "## Context\
|
|
271
|
-
"name": "
|
|
301
|
+
"description": "## Context\nThis component is a group of input fields designed to specify a date range. It consists of 3 fields:\n\n- a select field to choose a predefined date range,\n- an input field with an attached date picker for the start date,\n- an input field with an attached date picker for the end date.\n\nSetting a value in the select field will overwrite the previous values of the start and end date.\nSetting a value in either of the date pickers will set the select field to \"custom\",\nwhich represents an arbitrary date range.",
|
|
302
|
+
"name": "DateRangeSelectorComponent",
|
|
272
303
|
"members": [
|
|
273
304
|
{
|
|
274
305
|
"kind": "field",
|
|
275
|
-
"name": "
|
|
306
|
+
"name": "customSelectOptions",
|
|
276
307
|
"type": {
|
|
277
|
-
"text": "string[]"
|
|
308
|
+
"text": "{ label: string; dateFrom: string; dateTo: string }[]"
|
|
278
309
|
},
|
|
279
310
|
"default": "[]",
|
|
280
|
-
"description": "
|
|
281
|
-
"attribute": "
|
|
311
|
+
"description": "An array of custom options that the select field should provide,\nin addition to the predefined options.\nThe `label` will be shown to the user, and it will be available as `initialValue`.\nThe dates must be in the format `YYYY-MM-DD`.",
|
|
312
|
+
"attribute": "customSelectOptions"
|
|
282
313
|
},
|
|
283
314
|
{
|
|
284
315
|
"kind": "field",
|
|
285
|
-
"name": "
|
|
316
|
+
"name": "earliestDate",
|
|
286
317
|
"type": {
|
|
287
|
-
"text": "
|
|
318
|
+
"text": "string | undefined"
|
|
288
319
|
},
|
|
289
|
-
"default": "
|
|
290
|
-
"description": "The
|
|
291
|
-
"attribute": "
|
|
320
|
+
"default": "'1900-01-01'",
|
|
321
|
+
"description": "The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.",
|
|
322
|
+
"attribute": "earliestDate"
|
|
292
323
|
},
|
|
293
324
|
{
|
|
294
325
|
"kind": "field",
|
|
295
|
-
"name": "
|
|
326
|
+
"name": "initialValue",
|
|
296
327
|
"type": {
|
|
297
|
-
"text": "
|
|
328
|
+
"text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string\n | undefined"
|
|
298
329
|
},
|
|
299
|
-
"default": "
|
|
300
|
-
"description": "The
|
|
301
|
-
"attribute": "
|
|
330
|
+
"default": "'last6Months'",
|
|
331
|
+
"description": "The initial value to use for this date range selector.\nMust be a valid label from the preset labels or a `label` given in the `customSelectOptions`.\n\nIf the value is invalid, the component will default to `'last6Months'`.",
|
|
332
|
+
"attribute": "initialValue"
|
|
302
333
|
},
|
|
303
334
|
{
|
|
304
335
|
"kind": "field",
|
|
305
|
-
"name": "
|
|
336
|
+
"name": "width",
|
|
306
337
|
"type": {
|
|
307
|
-
"text": "
|
|
338
|
+
"text": "string | undefined"
|
|
308
339
|
},
|
|
309
340
|
"default": "undefined",
|
|
310
|
-
"description": "The
|
|
311
|
-
"attribute": "
|
|
341
|
+
"description": "The width of the component.\n\nIf not set, the component will take the full width of its container.\n\nThe width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
342
|
+
"attribute": "width"
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"events": [
|
|
346
|
+
{
|
|
347
|
+
"type": {
|
|
348
|
+
"text": "CustomEvent<{ dateFrom: string; dateTo: string; }>"
|
|
349
|
+
},
|
|
350
|
+
"description": "Fired when: - The select field is changed, - A date is selected in either of the date pickers, - A date was typed into either of the date input fields, and the input field loses focus (\"on blur\"). Contains the dates in the format `YYYY-MM-DD`.",
|
|
351
|
+
"name": "gs-date-range-changed"
|
|
312
352
|
}
|
|
313
353
|
],
|
|
314
354
|
"attributes": [
|
|
315
355
|
{
|
|
316
|
-
"name": "
|
|
356
|
+
"name": "customSelectOptions",
|
|
317
357
|
"type": {
|
|
318
|
-
"text": "string[]"
|
|
358
|
+
"text": "{ label: string; dateFrom: string; dateTo: string }[]"
|
|
319
359
|
},
|
|
320
360
|
"default": "[]",
|
|
321
|
-
"description": "
|
|
322
|
-
"fieldName": "
|
|
361
|
+
"description": "An array of custom options that the select field should provide,\nin addition to the predefined options.\nThe `label` will be shown to the user, and it will be available as `initialValue`.\nThe dates must be in the format `YYYY-MM-DD`.",
|
|
362
|
+
"fieldName": "customSelectOptions"
|
|
323
363
|
},
|
|
324
364
|
{
|
|
325
|
-
"name": "
|
|
365
|
+
"name": "earliestDate",
|
|
326
366
|
"type": {
|
|
327
|
-
"text": "
|
|
367
|
+
"text": "string | undefined"
|
|
328
368
|
},
|
|
329
|
-
"default": "
|
|
330
|
-
"description": "The
|
|
331
|
-
"fieldName": "
|
|
369
|
+
"default": "'1900-01-01'",
|
|
370
|
+
"description": "The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.",
|
|
371
|
+
"fieldName": "earliestDate"
|
|
332
372
|
},
|
|
333
373
|
{
|
|
334
|
-
"name": "
|
|
374
|
+
"name": "initialValue",
|
|
335
375
|
"type": {
|
|
336
|
-
"text": "
|
|
376
|
+
"text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string\n | undefined"
|
|
337
377
|
},
|
|
338
|
-
"default": "
|
|
339
|
-
"description": "The
|
|
340
|
-
"fieldName": "
|
|
378
|
+
"default": "'last6Months'",
|
|
379
|
+
"description": "The initial value to use for this date range selector.\nMust be a valid label from the preset labels or a `label` given in the `customSelectOptions`.\n\nIf the value is invalid, the component will default to `'last6Months'`.",
|
|
380
|
+
"fieldName": "initialValue"
|
|
341
381
|
},
|
|
342
382
|
{
|
|
343
|
-
"name": "
|
|
383
|
+
"name": "width",
|
|
344
384
|
"type": {
|
|
345
|
-
"text": "
|
|
385
|
+
"text": "string | undefined"
|
|
346
386
|
},
|
|
347
387
|
"default": "undefined",
|
|
348
|
-
"description": "The
|
|
349
|
-
"fieldName": "
|
|
388
|
+
"description": "The width of the component.\n\nIf not set, the component will take the full width of its container.\n\nThe width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
389
|
+
"fieldName": "width"
|
|
350
390
|
}
|
|
351
391
|
],
|
|
352
392
|
"superclass": {
|
|
353
|
-
"name": "
|
|
354
|
-
"module": "/src/web-components/
|
|
393
|
+
"name": "PreactLitAdapter",
|
|
394
|
+
"module": "/src/web-components/PreactLitAdapter"
|
|
355
395
|
},
|
|
356
|
-
"tagName": "gs-
|
|
396
|
+
"tagName": "gs-date-range-selector",
|
|
357
397
|
"customElement": true
|
|
358
398
|
}
|
|
359
399
|
],
|
|
360
400
|
"exports": [
|
|
361
401
|
{
|
|
362
402
|
"kind": "js",
|
|
363
|
-
"name": "
|
|
403
|
+
"name": "DateRangeSelectorComponent",
|
|
364
404
|
"declaration": {
|
|
365
|
-
"name": "
|
|
366
|
-
"module": "src/web-components/
|
|
405
|
+
"name": "DateRangeSelectorComponent",
|
|
406
|
+
"module": "src/web-components/input/gs-date-range-selector.tsx"
|
|
367
407
|
}
|
|
368
408
|
},
|
|
369
409
|
{
|
|
370
410
|
"kind": "custom-element-definition",
|
|
371
|
-
"name": "gs-
|
|
411
|
+
"name": "gs-date-range-selector",
|
|
372
412
|
"declaration": {
|
|
373
|
-
"name": "
|
|
374
|
-
"module": "src/web-components/
|
|
413
|
+
"name": "DateRangeSelectorComponent",
|
|
414
|
+
"module": "src/web-components/input/gs-date-range-selector.tsx"
|
|
375
415
|
}
|
|
376
416
|
}
|
|
377
417
|
]
|
|
378
418
|
},
|
|
379
419
|
{
|
|
380
420
|
"kind": "javascript-module",
|
|
381
|
-
"path": "src/web-components/
|
|
382
|
-
"declarations": [
|
|
383
|
-
"exports": [
|
|
384
|
-
{
|
|
385
|
-
"kind": "js",
|
|
386
|
-
"name": "MutationComparisonComponent",
|
|
387
|
-
"declaration": {
|
|
388
|
-
"name": "MutationComparisonComponent",
|
|
389
|
-
"module": "./mutation-comparison-component"
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"kind": "js",
|
|
394
|
-
"name": "MutationsComponent",
|
|
395
|
-
"declaration": {
|
|
396
|
-
"name": "MutationsComponent",
|
|
397
|
-
"module": "./mutations-component"
|
|
398
|
-
}
|
|
399
|
-
},
|
|
421
|
+
"path": "src/web-components/input/gs-location-filter.stories.ts",
|
|
422
|
+
"declarations": [
|
|
400
423
|
{
|
|
401
|
-
"kind": "
|
|
402
|
-
"name": "
|
|
403
|
-
"
|
|
404
|
-
"
|
|
405
|
-
|
|
406
|
-
}
|
|
424
|
+
"kind": "variable",
|
|
425
|
+
"name": "meta",
|
|
426
|
+
"type": {
|
|
427
|
+
"text": "Meta"
|
|
428
|
+
},
|
|
429
|
+
"default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: ['gs-location-changed'], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { fields: { control: { type: 'object', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, decorators: [withActions], tags: ['autodocs'], }"
|
|
407
430
|
},
|
|
408
431
|
{
|
|
409
|
-
"kind": "
|
|
410
|
-
"name": "
|
|
411
|
-
"
|
|
412
|
-
"
|
|
413
|
-
|
|
414
|
-
}
|
|
432
|
+
"kind": "variable",
|
|
433
|
+
"name": "LocationFilter",
|
|
434
|
+
"type": {
|
|
435
|
+
"text": "StoryObj<LocationFilterProps>"
|
|
436
|
+
},
|
|
437
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 200, body: data, }, }, ], }, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter'); await waitFor(() => { return expect(canvas.getByRole('combobox')).toBeEnabled(); }); }, }"
|
|
415
438
|
},
|
|
416
|
-
{
|
|
417
|
-
"kind": "js",
|
|
418
|
-
"name": "AggregateComponent",
|
|
419
|
-
"declaration": {
|
|
420
|
-
"name": "AggregateComponent",
|
|
421
|
-
"module": "./aggregate-component"
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
]
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
"kind": "javascript-module",
|
|
428
|
-
"path": "src/web-components/display/mutation-comparison-component.stories.ts",
|
|
429
|
-
"declarations": [
|
|
430
439
|
{
|
|
431
440
|
"kind": "variable",
|
|
432
|
-
"name": "
|
|
441
|
+
"name": "DelayToShowLoadingState",
|
|
433
442
|
"type": {
|
|
434
|
-
"text": "
|
|
443
|
+
"text": "StoryObj<LocationFilterProps>"
|
|
435
444
|
},
|
|
436
|
-
"default": "{
|
|
445
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 200, body: data, }, options: { delay: 5000, }, }, ], }, }, }"
|
|
437
446
|
},
|
|
438
447
|
{
|
|
439
448
|
"kind": "variable",
|
|
440
|
-
"name": "
|
|
449
|
+
"name": "FetchingLocationsFails",
|
|
441
450
|
"type": {
|
|
442
|
-
"text": "StoryObj<
|
|
451
|
+
"text": "StoryObj<LocationFilterProps>"
|
|
443
452
|
},
|
|
444
|
-
"default": "{
|
|
453
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 400, body: { error: 'no data' }, }, }, ], }, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter'); await waitFor(() => expect(canvas.getByText('Oops! Something went wrong.', { exact: false })).toBeInTheDocument(), ); }, }"
|
|
445
454
|
},
|
|
446
455
|
{
|
|
447
456
|
"kind": "variable",
|
|
448
|
-
"name": "
|
|
457
|
+
"name": "FiresEvent",
|
|
449
458
|
"type": {
|
|
450
|
-
"text": "StoryObj<
|
|
459
|
+
"text": "StoryObj<LocationFilterProps>"
|
|
451
460
|
},
|
|
452
|
-
"default": "{
|
|
461
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 200, body: data, }, }, ], }, }, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter'); const submitButton = () => canvas.getByRole('button', { name: 'Submit' }); const inputField = () => canvas.getByRole('combobox'); const listenerMock = fn(); await step('Setup event listener mock', async () => { canvasElement.addEventListener('gs-location-changed', listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Input invalid location', async () => { await userEvent.type(inputField(), 'Not / A / Location'); await userEvent.click(submitButton()); await expect(listenerMock).not.toHaveBeenCalled(); await userEvent.type(inputField(), '{backspace>18/}'); }); await step('Select Asia', async () => { await userEvent.type(inputField(), 'Asia'); await userEvent.click(submitButton()); await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { region: 'Asia', }, }), ); }); await step('Select Asia / Bangladesh / Rajshahi / Chapainawabgonj', async () => { await userEvent.type(inputField(), ' / Bangladesh / Rajshahi / Chapainawabgonj'); await userEvent.click(submitButton()); await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { region: 'Asia', country: 'Bangladesh', division: 'Rajshahi', location: 'Chapainawabgonj', }, }), ); }); }, }"
|
|
453
462
|
}
|
|
454
463
|
],
|
|
455
464
|
"exports": [
|
|
@@ -458,177 +467,183 @@
|
|
|
458
467
|
"name": "default",
|
|
459
468
|
"declaration": {
|
|
460
469
|
"name": "meta",
|
|
461
|
-
"module": "src/web-components/
|
|
470
|
+
"module": "src/web-components/input/gs-location-filter.stories.ts"
|
|
462
471
|
}
|
|
463
472
|
},
|
|
464
473
|
{
|
|
465
474
|
"kind": "js",
|
|
466
|
-
"name": "
|
|
475
|
+
"name": "LocationFilter",
|
|
467
476
|
"declaration": {
|
|
468
|
-
"name": "
|
|
469
|
-
"module": "src/web-components/
|
|
477
|
+
"name": "LocationFilter",
|
|
478
|
+
"module": "src/web-components/input/gs-location-filter.stories.ts"
|
|
470
479
|
}
|
|
471
480
|
},
|
|
472
481
|
{
|
|
473
482
|
"kind": "js",
|
|
474
|
-
"name": "
|
|
483
|
+
"name": "DelayToShowLoadingState",
|
|
475
484
|
"declaration": {
|
|
476
|
-
"name": "
|
|
477
|
-
"module": "src/web-components/
|
|
485
|
+
"name": "DelayToShowLoadingState",
|
|
486
|
+
"module": "src/web-components/input/gs-location-filter.stories.ts"
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"kind": "js",
|
|
491
|
+
"name": "FetchingLocationsFails",
|
|
492
|
+
"declaration": {
|
|
493
|
+
"name": "FetchingLocationsFails",
|
|
494
|
+
"module": "src/web-components/input/gs-location-filter.stories.ts"
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"kind": "js",
|
|
499
|
+
"name": "FiresEvent",
|
|
500
|
+
"declaration": {
|
|
501
|
+
"name": "FiresEvent",
|
|
502
|
+
"module": "src/web-components/input/gs-location-filter.stories.ts"
|
|
478
503
|
}
|
|
479
504
|
}
|
|
480
505
|
]
|
|
481
506
|
},
|
|
482
507
|
{
|
|
483
508
|
"kind": "javascript-module",
|
|
484
|
-
"path": "src/web-components/
|
|
509
|
+
"path": "src/web-components/input/gs-location-filter.tsx",
|
|
485
510
|
"declarations": [
|
|
486
511
|
{
|
|
487
512
|
"kind": "class",
|
|
488
|
-
"description": "
|
|
489
|
-
"name": "
|
|
513
|
+
"description": "## Context\n\nThis component provides an input field to specify filters for locations.\n\nIt expects a list of fields that form a strict hierarchical order, such as continent, country, and city.\nThe component retrieves a list of all possible values for these fields from the Lapis instance.\nThis list is then utilized to display autocomplete suggestions and to validate the input.\n\nGiven `fields` are `['field1', 'field2', ..., 'fieldN']`,\nthen valid values for the location filter must be in the form `valueForField1 / valueForField2 / ... / valueForFieldK`,\nwhere `1 <= K <= N`.\nValues for the fields `i > K` are considered `undefined`.",
|
|
514
|
+
"name": "LocationFilterComponent",
|
|
490
515
|
"members": [
|
|
491
516
|
{
|
|
492
517
|
"kind": "field",
|
|
493
|
-
"name": "
|
|
518
|
+
"name": "initialValue",
|
|
494
519
|
"type": {
|
|
495
|
-
"text": "
|
|
520
|
+
"text": "string"
|
|
496
521
|
},
|
|
497
|
-
"default": "
|
|
498
|
-
"description": "
|
|
499
|
-
"attribute": "
|
|
522
|
+
"default": "''",
|
|
523
|
+
"description": "The initial value to use for this location filter.\nMust be of the form `valueForField1 / valueForField2 / ... / valueForFieldN`.",
|
|
524
|
+
"attribute": "initialValue"
|
|
500
525
|
},
|
|
501
526
|
{
|
|
502
527
|
"kind": "field",
|
|
503
|
-
"name": "
|
|
528
|
+
"name": "fields",
|
|
504
529
|
"type": {
|
|
505
|
-
"text": "
|
|
530
|
+
"text": "string[]"
|
|
506
531
|
},
|
|
507
|
-
"default": "
|
|
508
|
-
"description": "The
|
|
509
|
-
"attribute": "
|
|
532
|
+
"default": "[]",
|
|
533
|
+
"description": "The fields to display in the location filter, in hierarchical order.\nThe top-level field should be the first entry in the array.\nThis component assumes that the values for each field form a strict hierarchy\n(e.g., `fields = ['continent', 'country', 'city']`).",
|
|
534
|
+
"attribute": "fields"
|
|
510
535
|
},
|
|
511
536
|
{
|
|
512
537
|
"kind": "field",
|
|
513
|
-
"name": "
|
|
538
|
+
"name": "width",
|
|
514
539
|
"type": {
|
|
515
|
-
"text": "
|
|
540
|
+
"text": "string | undefined"
|
|
516
541
|
},
|
|
517
|
-
"default": "
|
|
518
|
-
"description": "
|
|
519
|
-
"attribute": "
|
|
520
|
-
}
|
|
542
|
+
"default": "undefined",
|
|
543
|
+
"description": "The width of the component.\n\nIf not set, the component will take the full width of its container.\n\nThe width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
544
|
+
"attribute": "width"
|
|
545
|
+
}
|
|
546
|
+
],
|
|
547
|
+
"events": [
|
|
521
548
|
{
|
|
522
|
-
"kind": "field",
|
|
523
|
-
"name": "size",
|
|
524
549
|
"type": {
|
|
525
|
-
"text": "
|
|
550
|
+
"text": "CustomEvent<Record<string, string>>"
|
|
526
551
|
},
|
|
527
|
-
"
|
|
528
|
-
"
|
|
529
|
-
"attribute": "size"
|
|
552
|
+
"description": "Fired when the field is submitted with a valid location value. The `details` of this event contain an object with all `fields` as keys and the corresponding values as values, if they are not `undefined`. Example: ``` { continent: \"Asia\", country: \"China\", city: \"Beijing\" } ```",
|
|
553
|
+
"name": "gs-location-changed"
|
|
530
554
|
}
|
|
531
555
|
],
|
|
532
556
|
"attributes": [
|
|
533
557
|
{
|
|
534
|
-
"name": "
|
|
558
|
+
"name": "initialValue",
|
|
535
559
|
"type": {
|
|
536
|
-
"text": "
|
|
560
|
+
"text": "string"
|
|
537
561
|
},
|
|
538
|
-
"default": "
|
|
539
|
-
"description": "
|
|
540
|
-
"fieldName": "
|
|
562
|
+
"default": "''",
|
|
563
|
+
"description": "The initial value to use for this location filter.\nMust be of the form `valueForField1 / valueForField2 / ... / valueForFieldN`.",
|
|
564
|
+
"fieldName": "initialValue"
|
|
541
565
|
},
|
|
542
566
|
{
|
|
543
|
-
"name": "
|
|
567
|
+
"name": "fields",
|
|
544
568
|
"type": {
|
|
545
|
-
"text": "
|
|
546
|
-
},
|
|
547
|
-
"default": "'nucleotide'",
|
|
548
|
-
"description": "The type of the sequence for which the mutations should be shown.",
|
|
549
|
-
"fieldName": "sequenceType"
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
"name": "views",
|
|
553
|
-
"type": {
|
|
554
|
-
"text": "('table' | 'venn')[]"
|
|
569
|
+
"text": "string[]"
|
|
555
570
|
},
|
|
556
|
-
"default": "[
|
|
557
|
-
"description": "
|
|
558
|
-
"fieldName": "
|
|
571
|
+
"default": "[]",
|
|
572
|
+
"description": "The fields to display in the location filter, in hierarchical order.\nThe top-level field should be the first entry in the array.\nThis component assumes that the values for each field form a strict hierarchy\n(e.g., `fields = ['continent', 'country', 'city']`).",
|
|
573
|
+
"fieldName": "fields"
|
|
559
574
|
},
|
|
560
575
|
{
|
|
561
|
-
"name": "
|
|
576
|
+
"name": "width",
|
|
562
577
|
"type": {
|
|
563
|
-
"text": "
|
|
578
|
+
"text": "string | undefined"
|
|
564
579
|
},
|
|
565
580
|
"default": "undefined",
|
|
566
|
-
"description": "The
|
|
567
|
-
"fieldName": "
|
|
581
|
+
"description": "The width of the component.\n\nIf not set, the component will take the full width of its container.\n\nThe width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
582
|
+
"fieldName": "width"
|
|
568
583
|
}
|
|
569
584
|
],
|
|
570
585
|
"superclass": {
|
|
571
|
-
"name": "
|
|
572
|
-
"module": "/src/web-components/
|
|
586
|
+
"name": "PreactLitAdapter",
|
|
587
|
+
"module": "/src/web-components/PreactLitAdapter"
|
|
573
588
|
},
|
|
574
|
-
"tagName": "gs-
|
|
589
|
+
"tagName": "gs-location-filter",
|
|
575
590
|
"customElement": true
|
|
576
591
|
}
|
|
577
592
|
],
|
|
578
593
|
"exports": [
|
|
579
594
|
{
|
|
580
595
|
"kind": "js",
|
|
581
|
-
"name": "
|
|
596
|
+
"name": "LocationFilterComponent",
|
|
582
597
|
"declaration": {
|
|
583
|
-
"name": "
|
|
584
|
-
"module": "src/web-components/
|
|
598
|
+
"name": "LocationFilterComponent",
|
|
599
|
+
"module": "src/web-components/input/gs-location-filter.tsx"
|
|
585
600
|
}
|
|
586
601
|
},
|
|
587
602
|
{
|
|
588
603
|
"kind": "custom-element-definition",
|
|
589
|
-
"name": "gs-
|
|
604
|
+
"name": "gs-location-filter",
|
|
590
605
|
"declaration": {
|
|
591
|
-
"name": "
|
|
592
|
-
"module": "src/web-components/
|
|
606
|
+
"name": "LocationFilterComponent",
|
|
607
|
+
"module": "src/web-components/input/gs-location-filter.tsx"
|
|
593
608
|
}
|
|
594
609
|
}
|
|
595
610
|
]
|
|
596
611
|
},
|
|
597
612
|
{
|
|
598
613
|
"kind": "javascript-module",
|
|
599
|
-
"path": "src/web-components/
|
|
614
|
+
"path": "src/web-components/input/gs-mutation-filter.stories.ts",
|
|
600
615
|
"declarations": [
|
|
601
616
|
{
|
|
602
617
|
"kind": "variable",
|
|
603
618
|
"name": "meta",
|
|
604
619
|
"type": {
|
|
605
|
-
"text": "Meta<
|
|
620
|
+
"text": "Meta<MutationFilterProps>"
|
|
606
621
|
},
|
|
607
|
-
"default": "{
|
|
622
|
+
"default": "{ title: 'Input/Mutation filter', component: 'gs-mutation-filter', parameters: withComponentDocs({ actions: { handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur'], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'object', }, }, size: { control: { type: 'object', }, }, }, decorators: [withActions], tags: ['autodocs'], }"
|
|
608
623
|
},
|
|
609
624
|
{
|
|
610
625
|
"kind": "variable",
|
|
611
626
|
"name": "Default",
|
|
612
627
|
"type": {
|
|
613
|
-
"text": "StoryObj<
|
|
628
|
+
"text": "StoryObj<MutationFilterProps>"
|
|
614
629
|
},
|
|
615
|
-
"default": "{
|
|
630
|
+
"default": "{ ...Template, args: { initialValue: ['A123T'], }, }"
|
|
616
631
|
},
|
|
617
632
|
{
|
|
618
633
|
"kind": "variable",
|
|
619
|
-
"name": "
|
|
634
|
+
"name": "FiresFilterChangedEvent",
|
|
620
635
|
"type": {
|
|
621
|
-
"text": "StoryObj<
|
|
636
|
+
"text": "StoryObj<MutationFilterProps>"
|
|
622
637
|
},
|
|
623
|
-
"default": "{
|
|
638
|
+
"default": "{ ...Template, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-filter'); const inputField = () => canvas.getByPlaceholderText('Enter a mutation', { exact: false }); const submitButton = () => canvas.getByRole('button', { name: '+' }); const listenerMock = fn(); await step('Setup event listener mock', async () => { canvasElement.addEventListener('gs-mutation-filter-changed', listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Enter a valid mutation', async () => { await userEvent.type(inputField(), 'A123T'); await waitFor(() => submitButton().click()); await waitFor(() => expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { nucleotideMutations: ['A123T'], aminoAcidMutations: [], nucleotideInsertions: [], aminoAcidInsertions: [], }, }), ), ); }); }, }"
|
|
624
639
|
},
|
|
625
640
|
{
|
|
626
641
|
"kind": "variable",
|
|
627
|
-
"name": "
|
|
642
|
+
"name": "FiresFilterOnBlurEvent",
|
|
628
643
|
"type": {
|
|
629
|
-
"text": "StoryObj<
|
|
644
|
+
"text": "StoryObj<MutationFilterProps>"
|
|
630
645
|
},
|
|
631
|
-
"default": "{
|
|
646
|
+
"default": "{ ...Template, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-filter'); const inputField = () => canvas.getByPlaceholderText('Enter a mutation', { exact: false }); const listenerMock = fn(); await step('Setup event listener mock', async () => { canvasElement.addEventListener('gs-mutation-filter-on-blur', listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Move outside of input', async () => { await userEvent.type(inputField(), 'A123T'); await userEvent.tab(); await expect(listenerMock).toHaveBeenCalled(); }); }, }"
|
|
632
647
|
}
|
|
633
648
|
],
|
|
634
649
|
"exports": [
|
|
@@ -637,7 +652,7 @@
|
|
|
637
652
|
"name": "default",
|
|
638
653
|
"declaration": {
|
|
639
654
|
"name": "meta",
|
|
640
|
-
"module": "src/web-components/
|
|
655
|
+
"module": "src/web-components/input/gs-mutation-filter.stories.ts"
|
|
641
656
|
}
|
|
642
657
|
},
|
|
643
658
|
{
|
|
@@ -645,62 +660,45 @@
|
|
|
645
660
|
"name": "Default",
|
|
646
661
|
"declaration": {
|
|
647
662
|
"name": "Default",
|
|
648
|
-
"module": "src/web-components/
|
|
663
|
+
"module": "src/web-components/input/gs-mutation-filter.stories.ts"
|
|
649
664
|
}
|
|
650
665
|
},
|
|
651
666
|
{
|
|
652
667
|
"kind": "js",
|
|
653
|
-
"name": "
|
|
668
|
+
"name": "FiresFilterChangedEvent",
|
|
654
669
|
"declaration": {
|
|
655
|
-
"name": "
|
|
656
|
-
"module": "src/web-components/
|
|
670
|
+
"name": "FiresFilterChangedEvent",
|
|
671
|
+
"module": "src/web-components/input/gs-mutation-filter.stories.ts"
|
|
657
672
|
}
|
|
658
673
|
},
|
|
659
674
|
{
|
|
660
675
|
"kind": "js",
|
|
661
|
-
"name": "
|
|
676
|
+
"name": "FiresFilterOnBlurEvent",
|
|
662
677
|
"declaration": {
|
|
663
|
-
"name": "
|
|
664
|
-
"module": "src/web-components/
|
|
678
|
+
"name": "FiresFilterOnBlurEvent",
|
|
679
|
+
"module": "src/web-components/input/gs-mutation-filter.stories.ts"
|
|
665
680
|
}
|
|
666
681
|
}
|
|
667
682
|
]
|
|
668
683
|
},
|
|
669
684
|
{
|
|
670
685
|
"kind": "javascript-module",
|
|
671
|
-
"path": "src/web-components/
|
|
686
|
+
"path": "src/web-components/input/gs-mutation-filter.tsx",
|
|
672
687
|
"declarations": [
|
|
673
688
|
{
|
|
674
689
|
"kind": "class",
|
|
675
|
-
"description": "",
|
|
676
|
-
"name": "
|
|
690
|
+
"description": "## Context\nThis component provides an input field to specify filters for nucleotide and amino acid mutations and insertions.\n\nInput values have to be provided one at a time and submitted by pressing the Enter key or by clicking the '+' button.\nAfter submission, the component validates the input and fires an event with the selected mutations.\nAll previously selected mutations are displayed at the input field and added to the event.\nUsers can remove a mutation by clicking the 'x' button next to the mutation.\n\nValidation of the input is performed according to the following rules:\n\nMutations have to conform to the following format: `<gene/segment>:<symbol at reference><position><Substituted symbol/Deletion>`\n - Gene/segment: The gene or segment where the mutation occurs. Must be contained in the reference genome\n (Optional for elements with only one gene/segment)\n - Symbol at reference: The symbol at the reference position. (Optional)\n - Position: The position of the mutation. (Required)\n - Substituted symbol/Deletion: The substituted symbol or '-' for a deletion. (Required)\n Example: S:614G, 614G, 614- or 614G\n\nInsertions have to conform to the following format: `ins_<gene/segment>:<position>:<Inserted symbols>`\n - Gene/segment: The gene or segment where the insertion occurs. Must be contained in the reference genome\n (Optional for elements with only one gene/segment)\n - Position: The position of the insertion. (Required)\n - Inserted symbols: The symbols that are inserted. (Required)\n Example: ins_S:614:G, ins_614:G",
|
|
691
|
+
"name": "MutationFilterComponent",
|
|
677
692
|
"members": [
|
|
678
693
|
{
|
|
679
694
|
"kind": "field",
|
|
680
|
-
"name": "
|
|
681
|
-
"type": {
|
|
682
|
-
"text": "LapisFilter"
|
|
683
|
-
},
|
|
684
|
-
"default": "{ displayName: '' }",
|
|
685
|
-
"attribute": "variant"
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
"kind": "field",
|
|
689
|
-
"name": "sequenceType",
|
|
690
|
-
"type": {
|
|
691
|
-
"text": "SequenceType"
|
|
692
|
-
},
|
|
693
|
-
"default": "'nucleotide'",
|
|
694
|
-
"attribute": "sequenceType"
|
|
695
|
-
},
|
|
696
|
-
{
|
|
697
|
-
"kind": "field",
|
|
698
|
-
"name": "views",
|
|
695
|
+
"name": "initialValue",
|
|
699
696
|
"type": {
|
|
700
|
-
"text": "
|
|
697
|
+
"text": "{\n nucleotideMutations: string[];\n aminoAcidMutations: string[];\n nucleotideInsertions: string[];\n aminoAcidInsertions: string[];\n }\n | string[]\n | undefined"
|
|
701
698
|
},
|
|
702
|
-
"default": "
|
|
703
|
-
"
|
|
699
|
+
"default": "undefined",
|
|
700
|
+
"description": "The initial value to use for this mutation filter.\nMust be either\n- an array of strings of valid mutations.\n- an object with the keys `nucleotideMutations`, `aminoAcidMutations`, `nucleotideInsertions` and `aminoAcidInsertions` and corresponding string arrays.",
|
|
701
|
+
"attribute": "initialValue"
|
|
704
702
|
},
|
|
705
703
|
{
|
|
706
704
|
"kind": "field",
|
|
@@ -713,30 +711,31 @@
|
|
|
713
711
|
"attribute": "size"
|
|
714
712
|
}
|
|
715
713
|
],
|
|
716
|
-
"
|
|
714
|
+
"events": [
|
|
717
715
|
{
|
|
718
|
-
"name": "variant",
|
|
719
716
|
"type": {
|
|
720
|
-
"text": "
|
|
717
|
+
"text": "CustomEvent<{nucleotideMutations: string[],aminoAcidMutations: string[],nucleotideInsertions: string[],aminoAcidInsertions: string[]}>"
|
|
721
718
|
},
|
|
722
|
-
"
|
|
723
|
-
"
|
|
719
|
+
"description": "Fired when: - The user has submitted a valid mutation or insertion - The user has removed a mutation or insertion",
|
|
720
|
+
"name": "gs-mutation-filter-changed"
|
|
724
721
|
},
|
|
725
722
|
{
|
|
726
|
-
"name": "sequenceType",
|
|
727
723
|
"type": {
|
|
728
|
-
"text": "
|
|
724
|
+
"text": "CustomEvent<{nucleotideMutations: string[],aminoAcidMutations: string[],nucleotideInsertions: string[],aminoAcidInsertions: string[]}>"
|
|
729
725
|
},
|
|
730
|
-
"
|
|
731
|
-
"
|
|
732
|
-
}
|
|
726
|
+
"description": "Fired when: - the mutation filter has lost focus Contains the selected mutations in the format",
|
|
727
|
+
"name": "gs-mutation-filter-on-blur"
|
|
728
|
+
}
|
|
729
|
+
],
|
|
730
|
+
"attributes": [
|
|
733
731
|
{
|
|
734
|
-
"name": "
|
|
732
|
+
"name": "initialValue",
|
|
735
733
|
"type": {
|
|
736
|
-
"text": "
|
|
734
|
+
"text": "{\n nucleotideMutations: string[];\n aminoAcidMutations: string[];\n nucleotideInsertions: string[];\n aminoAcidInsertions: string[];\n }\n | string[]\n | undefined"
|
|
737
735
|
},
|
|
738
|
-
"default": "
|
|
739
|
-
"
|
|
736
|
+
"default": "undefined",
|
|
737
|
+
"description": "The initial value to use for this mutation filter.\nMust be either\n- an array of strings of valid mutations.\n- an object with the keys `nucleotideMutations`, `aminoAcidMutations`, `nucleotideInsertions` and `aminoAcidInsertions` and corresponding string arrays.",
|
|
738
|
+
"fieldName": "initialValue"
|
|
740
739
|
},
|
|
741
740
|
{
|
|
742
741
|
"name": "size",
|
|
@@ -749,83 +748,59 @@
|
|
|
749
748
|
}
|
|
750
749
|
],
|
|
751
750
|
"superclass": {
|
|
752
|
-
"name": "
|
|
753
|
-
"module": "/src/web-components/
|
|
751
|
+
"name": "PreactLitAdapter",
|
|
752
|
+
"module": "/src/web-components/PreactLitAdapter"
|
|
754
753
|
},
|
|
755
|
-
"tagName": "gs-
|
|
754
|
+
"tagName": "gs-mutation-filter",
|
|
756
755
|
"customElement": true
|
|
757
756
|
}
|
|
758
757
|
],
|
|
759
758
|
"exports": [
|
|
760
759
|
{
|
|
761
760
|
"kind": "js",
|
|
762
|
-
"name": "
|
|
761
|
+
"name": "MutationFilterComponent",
|
|
763
762
|
"declaration": {
|
|
764
|
-
"name": "
|
|
765
|
-
"module": "src/web-components/
|
|
763
|
+
"name": "MutationFilterComponent",
|
|
764
|
+
"module": "src/web-components/input/gs-mutation-filter.tsx"
|
|
766
765
|
}
|
|
767
766
|
},
|
|
768
767
|
{
|
|
769
768
|
"kind": "custom-element-definition",
|
|
770
|
-
"name": "gs-
|
|
769
|
+
"name": "gs-mutation-filter",
|
|
771
770
|
"declaration": {
|
|
772
|
-
"name": "
|
|
773
|
-
"module": "src/web-components/
|
|
771
|
+
"name": "MutationFilterComponent",
|
|
772
|
+
"module": "src/web-components/input/gs-mutation-filter.tsx"
|
|
774
773
|
}
|
|
775
774
|
}
|
|
776
775
|
]
|
|
777
776
|
},
|
|
778
777
|
{
|
|
779
778
|
"kind": "javascript-module",
|
|
780
|
-
"path": "src/web-components/
|
|
779
|
+
"path": "src/web-components/input/gs-text-input.stories.ts",
|
|
781
780
|
"declarations": [
|
|
782
781
|
{
|
|
783
782
|
"kind": "variable",
|
|
784
783
|
"name": "meta",
|
|
785
784
|
"type": {
|
|
786
|
-
"text": "Meta<
|
|
787
|
-
},
|
|
788
|
-
"default": "{\n title: 'Visualization/Prevalence over time',\n component: 'gs-prevalence-over-time',\n argTypes: {\n numerator: { control: 'object' },\n denominator: { control: 'object' },\n granularity: {\n options: ['day', 'week', 'month', 'year'],\n control: { type: 'radio' },\n },\n smoothingWindow: { control: 'number' },\n views: {\n options: ['bar', 'line', 'bubble', 'table'],\n control: { type: 'check' },\n },\n confidenceIntervalMethods: {\n options: ['wilson'],\n control: { type: 'check' },\n },\n size: [{ control: 'object' }],\n },\n}"
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
"kind": "variable",
|
|
792
|
-
"name": "TwoVariants",
|
|
793
|
-
"type": {
|
|
794
|
-
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
795
|
-
},
|
|
796
|
-
"default": "{\n ...Template,\n args: {\n numerator: [\n { displayName: 'EG', country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' },\n { displayName: 'JN.1', country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' },\n ],\n denominator: { country: 'USA', dateFrom: '2023-01-01', displayName: 'All' },\n granularity: 'month',\n smoothingWindow: 0,\n views: ['bar', 'line', 'bubble', 'table'],\n confidenceIntervalMethods: ['wilson'],\n size: { width: '100%', height: '700px' },\n },\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'numeratorEG',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n pangoLineage: 'EG*',\n dateFrom: '2023-01-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: numeratorEG,\n },\n },\n {\n matcher: {\n name: 'numeratorJN1',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n pangoLineage: 'JN.1*',\n dateFrom: '2023-01-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: numeratorJN1,\n },\n },\n {\n matcher: {\n name: 'denominator',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n dateFrom: '2023-01-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: denominator,\n },\n },\n ],\n },\n },\n}"
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
"kind": "variable",
|
|
800
|
-
"name": "OneVariant",
|
|
801
|
-
"type": {
|
|
802
|
-
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
803
|
-
},
|
|
804
|
-
"default": "{\n ...Template,\n args: {\n numerator: { displayName: 'EG', country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' },\n denominator: { country: 'USA', dateFrom: '2023-10-01', displayName: 'All' },\n granularity: 'day',\n smoothingWindow: 7,\n views: ['bar', 'line', 'bubble', 'table'],\n confidenceIntervalMethods: ['wilson'],\n size: { width: '100%', height: '700px' },\n },\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'numeratorOneVariant',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n pangoLineage: 'BA.2.86*',\n dateFrom: '2023-10-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: numeratorOneVariant,\n },\n },\n {\n matcher: {\n name: 'denominatorOneVariant',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n dateFrom: '2023-10-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: denominatorOneVariant,\n },\n },\n ],\n },\n },\n}"
|
|
805
|
-
},
|
|
806
|
-
{
|
|
807
|
-
"kind": "variable",
|
|
808
|
-
"name": "OneVariantOnLineTab",
|
|
809
|
-
"type": {
|
|
810
|
-
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
785
|
+
"text": "Meta<TextInputProps>"
|
|
811
786
|
},
|
|
812
|
-
"default": "{
|
|
787
|
+
"default": "{ title: 'Input/Text input', component: 'gs-text-input', parameters: withComponentDocs({ actions: { handles: ['gs-text-input-changed'], }, fetchMock: { mocks: [ { matcher: { name: 'hosts', url: AGGREGATED_ENDPOINT, body: { fields: ['host'], }, }, response: { status: 200, body: data, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { lapisField: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, decorators: [withActions], tags: ['autodocs'], }"
|
|
813
788
|
},
|
|
814
789
|
{
|
|
815
790
|
"kind": "variable",
|
|
816
|
-
"name": "
|
|
791
|
+
"name": "Default",
|
|
817
792
|
"type": {
|
|
818
|
-
"text": "StoryObj<
|
|
793
|
+
"text": "StoryObj<TextInputProps>"
|
|
819
794
|
},
|
|
820
|
-
"default": "{
|
|
795
|
+
"default": "{ render: (args) => { return html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-screen-lg\"> <gs-text-input .lapisField=${args.lapisField} .placeholderText=${args.placeholderText} .initialValue=${args.initialValue} .width=${args.width} ></gs-text-input> </div> </gs-app>`; }, args: { lapisField: 'host', placeholderText: 'Enter host name', initialValue: 'Homo sapiens', width: '100%', }, }"
|
|
821
796
|
},
|
|
822
797
|
{
|
|
823
798
|
"kind": "variable",
|
|
824
|
-
"name": "
|
|
799
|
+
"name": "FiresEvent",
|
|
825
800
|
"type": {
|
|
826
|
-
"text": "StoryObj<
|
|
801
|
+
"text": "StoryObj<TextInputProps>"
|
|
827
802
|
},
|
|
828
|
-
"default": "{
|
|
803
|
+
"default": "{ ...Default, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-text-input'); const inputField = () => canvas.getByPlaceholderText('Enter host name'); const listenerMock = fn(); await step('Setup event listener mock', async () => { canvasElement.addEventListener('gs-text-input-changed', listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Enters an invalid host name', async () => { await userEvent.type(inputField(), 'notInList'); await expect(listenerMock).not.toHaveBeenCalled(); await userEvent.type(inputField(), '{backspace>9/}'); }); await step('Enter a valid host name', async () => { await userEvent.type(inputField(), 'Homo'); await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { host: 'Homo', }, }), ); }); }, args: { ...Default.args, initialValue: '', }, }"
|
|
829
804
|
}
|
|
830
805
|
],
|
|
831
806
|
"exports": [
|
|
@@ -834,230 +809,255 @@
|
|
|
834
809
|
"name": "default",
|
|
835
810
|
"declaration": {
|
|
836
811
|
"name": "meta",
|
|
837
|
-
"module": "src/web-components/
|
|
838
|
-
}
|
|
839
|
-
},
|
|
840
|
-
{
|
|
841
|
-
"kind": "js",
|
|
842
|
-
"name": "TwoVariants",
|
|
843
|
-
"declaration": {
|
|
844
|
-
"name": "TwoVariants",
|
|
845
|
-
"module": "src/web-components/display/prevalence-over-time-component.stories.ts"
|
|
846
|
-
}
|
|
847
|
-
},
|
|
848
|
-
{
|
|
849
|
-
"kind": "js",
|
|
850
|
-
"name": "OneVariant",
|
|
851
|
-
"declaration": {
|
|
852
|
-
"name": "OneVariant",
|
|
853
|
-
"module": "src/web-components/display/prevalence-over-time-component.stories.ts"
|
|
854
|
-
}
|
|
855
|
-
},
|
|
856
|
-
{
|
|
857
|
-
"kind": "js",
|
|
858
|
-
"name": "OneVariantOnLineTab",
|
|
859
|
-
"declaration": {
|
|
860
|
-
"name": "OneVariantOnLineTab",
|
|
861
|
-
"module": "src/web-components/display/prevalence-over-time-component.stories.ts"
|
|
812
|
+
"module": "src/web-components/input/gs-text-input.stories.ts"
|
|
862
813
|
}
|
|
863
814
|
},
|
|
864
815
|
{
|
|
865
816
|
"kind": "js",
|
|
866
|
-
"name": "
|
|
817
|
+
"name": "Default",
|
|
867
818
|
"declaration": {
|
|
868
|
-
"name": "
|
|
869
|
-
"module": "src/web-components/
|
|
819
|
+
"name": "Default",
|
|
820
|
+
"module": "src/web-components/input/gs-text-input.stories.ts"
|
|
870
821
|
}
|
|
871
822
|
},
|
|
872
823
|
{
|
|
873
824
|
"kind": "js",
|
|
874
|
-
"name": "
|
|
825
|
+
"name": "FiresEvent",
|
|
875
826
|
"declaration": {
|
|
876
|
-
"name": "
|
|
877
|
-
"module": "src/web-components/
|
|
827
|
+
"name": "FiresEvent",
|
|
828
|
+
"module": "src/web-components/input/gs-text-input.stories.ts"
|
|
878
829
|
}
|
|
879
830
|
}
|
|
880
831
|
]
|
|
881
832
|
},
|
|
882
833
|
{
|
|
883
834
|
"kind": "javascript-module",
|
|
884
|
-
"path": "src/web-components/
|
|
835
|
+
"path": "src/web-components/input/gs-text-input.tsx",
|
|
885
836
|
"declarations": [
|
|
886
837
|
{
|
|
887
838
|
"kind": "class",
|
|
888
|
-
"description": "",
|
|
889
|
-
"name": "
|
|
839
|
+
"description": "\n## Context\n\nThis component provides a text input field to specify filters for arbitrary fields of this Lapis instance.",
|
|
840
|
+
"name": "TextInputComponent",
|
|
890
841
|
"members": [
|
|
891
842
|
{
|
|
892
843
|
"kind": "field",
|
|
893
|
-
"name": "
|
|
894
|
-
"type": {
|
|
895
|
-
"text": "NamedLapisFilter | NamedLapisFilter[]"
|
|
896
|
-
},
|
|
897
|
-
"default": "{ displayName: '' }",
|
|
898
|
-
"attribute": "numerator"
|
|
899
|
-
},
|
|
900
|
-
{
|
|
901
|
-
"kind": "field",
|
|
902
|
-
"name": "denominator",
|
|
903
|
-
"type": {
|
|
904
|
-
"text": "NamedLapisFilter"
|
|
905
|
-
},
|
|
906
|
-
"default": "{ displayName: '' }",
|
|
907
|
-
"attribute": "denominator"
|
|
908
|
-
},
|
|
909
|
-
{
|
|
910
|
-
"kind": "field",
|
|
911
|
-
"name": "granularity",
|
|
844
|
+
"name": "initialValue",
|
|
912
845
|
"type": {
|
|
913
|
-
"text": "
|
|
846
|
+
"text": "string | undefined"
|
|
914
847
|
},
|
|
915
|
-
"default": "'
|
|
916
|
-
"
|
|
848
|
+
"default": "''",
|
|
849
|
+
"description": "The initial value to use for this text input.",
|
|
850
|
+
"attribute": "initialValue"
|
|
917
851
|
},
|
|
918
852
|
{
|
|
919
853
|
"kind": "field",
|
|
920
|
-
"name": "
|
|
854
|
+
"name": "lapisField",
|
|
921
855
|
"type": {
|
|
922
|
-
"text": "
|
|
856
|
+
"text": "string"
|
|
923
857
|
},
|
|
924
|
-
"default": "
|
|
925
|
-
"
|
|
858
|
+
"default": "''",
|
|
859
|
+
"description": "The Lapis field name to use for this text input.",
|
|
860
|
+
"attribute": "lapisField"
|
|
926
861
|
},
|
|
927
862
|
{
|
|
928
863
|
"kind": "field",
|
|
929
|
-
"name": "
|
|
864
|
+
"name": "placeholderText",
|
|
930
865
|
"type": {
|
|
931
|
-
"text": "
|
|
866
|
+
"text": "string | undefined"
|
|
932
867
|
},
|
|
933
|
-
"default": "
|
|
934
|
-
"
|
|
868
|
+
"default": "''",
|
|
869
|
+
"description": "The placeholder text to display in the input field.",
|
|
870
|
+
"attribute": "placeholderText"
|
|
935
871
|
},
|
|
936
872
|
{
|
|
937
873
|
"kind": "field",
|
|
938
|
-
"name": "
|
|
874
|
+
"name": "width",
|
|
939
875
|
"type": {
|
|
940
|
-
"text": "
|
|
876
|
+
"text": "string | undefined"
|
|
941
877
|
},
|
|
942
|
-
"default": "
|
|
943
|
-
"
|
|
944
|
-
|
|
878
|
+
"default": "undefined",
|
|
879
|
+
"description": "The width of the component.\n\nIf not set, the component will take the full width of its container.\n\nThe width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
880
|
+
"attribute": "width"
|
|
881
|
+
}
|
|
882
|
+
],
|
|
883
|
+
"events": [
|
|
945
884
|
{
|
|
946
|
-
"kind": "field",
|
|
947
|
-
"name": "size",
|
|
948
885
|
"type": {
|
|
949
|
-
"text": "
|
|
886
|
+
"text": "CustomEvent<Record<string, string>>"
|
|
950
887
|
},
|
|
951
|
-
"
|
|
952
|
-
"
|
|
953
|
-
"attribute": "size"
|
|
888
|
+
"description": "Fired when the input field is changed. The `details` of this event contain an object with the `lapisField` as key and the input value as value. Example: ``` { \"host\": \"Homo sapiens\" } ```",
|
|
889
|
+
"name": "gs-text-input-changed"
|
|
954
890
|
}
|
|
955
891
|
],
|
|
956
892
|
"attributes": [
|
|
957
893
|
{
|
|
958
|
-
"name": "
|
|
894
|
+
"name": "initialValue",
|
|
959
895
|
"type": {
|
|
960
|
-
"text": "
|
|
896
|
+
"text": "string | undefined"
|
|
961
897
|
},
|
|
962
|
-
"default": "
|
|
963
|
-
"
|
|
898
|
+
"default": "''",
|
|
899
|
+
"description": "The initial value to use for this text input.",
|
|
900
|
+
"fieldName": "initialValue"
|
|
964
901
|
},
|
|
965
902
|
{
|
|
966
|
-
"name": "
|
|
903
|
+
"name": "lapisField",
|
|
967
904
|
"type": {
|
|
968
|
-
"text": "
|
|
905
|
+
"text": "string"
|
|
969
906
|
},
|
|
970
|
-
"default": "
|
|
971
|
-
"
|
|
907
|
+
"default": "''",
|
|
908
|
+
"description": "The Lapis field name to use for this text input.",
|
|
909
|
+
"fieldName": "lapisField"
|
|
972
910
|
},
|
|
973
911
|
{
|
|
974
|
-
"name": "
|
|
912
|
+
"name": "placeholderText",
|
|
975
913
|
"type": {
|
|
976
|
-
"text": "
|
|
914
|
+
"text": "string | undefined"
|
|
977
915
|
},
|
|
978
|
-
"default": "'
|
|
979
|
-
"
|
|
916
|
+
"default": "''",
|
|
917
|
+
"description": "The placeholder text to display in the input field.",
|
|
918
|
+
"fieldName": "placeholderText"
|
|
980
919
|
},
|
|
981
920
|
{
|
|
982
|
-
"name": "
|
|
921
|
+
"name": "width",
|
|
983
922
|
"type": {
|
|
984
|
-
"text": "
|
|
985
|
-
},
|
|
986
|
-
"default": "0",
|
|
987
|
-
"fieldName": "smoothingWindow"
|
|
988
|
-
},
|
|
989
|
-
{
|
|
990
|
-
"name": "views",
|
|
991
|
-
"type": {
|
|
992
|
-
"text": "View[]"
|
|
993
|
-
},
|
|
994
|
-
"default": "['bar', 'line', 'bubble', 'table']",
|
|
995
|
-
"fieldName": "views"
|
|
996
|
-
},
|
|
997
|
-
{
|
|
998
|
-
"name": "confidenceIntervalMethods",
|
|
999
|
-
"type": {
|
|
1000
|
-
"text": "ConfidenceIntervalMethod[]"
|
|
1001
|
-
},
|
|
1002
|
-
"default": "['wilson']",
|
|
1003
|
-
"fieldName": "confidenceIntervalMethods"
|
|
1004
|
-
},
|
|
1005
|
-
{
|
|
1006
|
-
"name": "size",
|
|
1007
|
-
"type": {
|
|
1008
|
-
"text": "{ width?: string; height?: string } | undefined"
|
|
923
|
+
"text": "string | undefined"
|
|
1009
924
|
},
|
|
1010
925
|
"default": "undefined",
|
|
1011
|
-
"description": "The
|
|
1012
|
-
"fieldName": "
|
|
926
|
+
"description": "The width of the component.\n\nIf not set, the component will take the full width of its container.\n\nThe width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
927
|
+
"fieldName": "width"
|
|
1013
928
|
}
|
|
1014
929
|
],
|
|
1015
930
|
"superclass": {
|
|
1016
|
-
"name": "
|
|
1017
|
-
"module": "/src/web-components/
|
|
931
|
+
"name": "PreactLitAdapter",
|
|
932
|
+
"module": "/src/web-components/PreactLitAdapter"
|
|
1018
933
|
},
|
|
1019
|
-
"tagName": "gs-
|
|
934
|
+
"tagName": "gs-text-input",
|
|
1020
935
|
"customElement": true
|
|
1021
936
|
}
|
|
1022
937
|
],
|
|
1023
938
|
"exports": [
|
|
1024
939
|
{
|
|
1025
940
|
"kind": "js",
|
|
1026
|
-
"name": "
|
|
941
|
+
"name": "TextInputComponent",
|
|
1027
942
|
"declaration": {
|
|
1028
|
-
"name": "
|
|
1029
|
-
"module": "src/web-components/
|
|
943
|
+
"name": "TextInputComponent",
|
|
944
|
+
"module": "src/web-components/input/gs-text-input.tsx"
|
|
1030
945
|
}
|
|
1031
946
|
},
|
|
1032
947
|
{
|
|
1033
948
|
"kind": "custom-element-definition",
|
|
1034
|
-
"name": "gs-
|
|
949
|
+
"name": "gs-text-input",
|
|
1035
950
|
"declaration": {
|
|
1036
|
-
"name": "
|
|
1037
|
-
"module": "src/web-components/
|
|
951
|
+
"name": "TextInputComponent",
|
|
952
|
+
"module": "src/web-components/input/gs-text-input.tsx"
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
]
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
"kind": "javascript-module",
|
|
959
|
+
"path": "src/web-components/input/index.ts",
|
|
960
|
+
"declarations": [],
|
|
961
|
+
"exports": [
|
|
962
|
+
{
|
|
963
|
+
"kind": "js",
|
|
964
|
+
"name": "DateRangeSelectorComponent",
|
|
965
|
+
"declaration": {
|
|
966
|
+
"name": "DateRangeSelectorComponent",
|
|
967
|
+
"module": "./gs-date-range-selector"
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
"kind": "js",
|
|
972
|
+
"name": "LocationFilterComponent",
|
|
973
|
+
"declaration": {
|
|
974
|
+
"name": "LocationFilterComponent",
|
|
975
|
+
"module": "./gs-location-filter"
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
"kind": "js",
|
|
980
|
+
"name": "TextInputComponent",
|
|
981
|
+
"declaration": {
|
|
982
|
+
"name": "TextInputComponent",
|
|
983
|
+
"module": "./gs-text-input"
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
"kind": "js",
|
|
988
|
+
"name": "MutationFilterComponent",
|
|
989
|
+
"declaration": {
|
|
990
|
+
"name": "MutationFilterComponent",
|
|
991
|
+
"module": "./gs-mutation-filter"
|
|
1038
992
|
}
|
|
1039
993
|
}
|
|
1040
994
|
]
|
|
1041
995
|
},
|
|
1042
996
|
{
|
|
1043
997
|
"kind": "javascript-module",
|
|
1044
|
-
"path": "src/web-components/
|
|
998
|
+
"path": "src/web-components/lapis-context.ts",
|
|
999
|
+
"declarations": [
|
|
1000
|
+
{
|
|
1001
|
+
"kind": "variable",
|
|
1002
|
+
"name": "lapisContext"
|
|
1003
|
+
}
|
|
1004
|
+
],
|
|
1005
|
+
"exports": [
|
|
1006
|
+
{
|
|
1007
|
+
"kind": "js",
|
|
1008
|
+
"name": "lapisContext",
|
|
1009
|
+
"declaration": {
|
|
1010
|
+
"name": "lapisContext",
|
|
1011
|
+
"module": "src/web-components/lapis-context.ts"
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
]
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
"kind": "javascript-module",
|
|
1018
|
+
"path": "src/web-components/reference-genome-context.ts",
|
|
1019
|
+
"declarations": [
|
|
1020
|
+
{
|
|
1021
|
+
"kind": "variable",
|
|
1022
|
+
"name": "referenceGenomeContext"
|
|
1023
|
+
}
|
|
1024
|
+
],
|
|
1025
|
+
"exports": [
|
|
1026
|
+
{
|
|
1027
|
+
"kind": "js",
|
|
1028
|
+
"name": "referenceGenomeContext",
|
|
1029
|
+
"declaration": {
|
|
1030
|
+
"name": "referenceGenomeContext",
|
|
1031
|
+
"module": "src/web-components/reference-genome-context.ts"
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
]
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
"kind": "javascript-module",
|
|
1038
|
+
"path": "src/web-components/visualization/data_visualization_statistical_analysis.mdx",
|
|
1039
|
+
"declarations": [],
|
|
1040
|
+
"exports": []
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"kind": "javascript-module",
|
|
1044
|
+
"path": "src/web-components/visualization/gs-aggregate.stories.ts",
|
|
1045
1045
|
"declarations": [
|
|
1046
1046
|
{
|
|
1047
1047
|
"kind": "variable",
|
|
1048
1048
|
"name": "meta",
|
|
1049
1049
|
"type": {
|
|
1050
|
-
"text": "Meta<
|
|
1050
|
+
"text": "Meta<AggregateProps>"
|
|
1051
1051
|
},
|
|
1052
|
-
"default": "{
|
|
1052
|
+
"default": "{ title: 'Visualization/Aggregate', component: 'gs-aggregate', argTypes: { fields: [{ control: 'object' }], views: { options: ['table'], control: { type: 'check' }, }, size: [{ control: 'object' }], headline: { control: 'text' }, }, parameters: withComponentDocs({ fetchMock: { mocks: [ { matcher: { name: 'aggregatedData', url: AGGREGATED_ENDPOINT, body: { fields: ['division', 'host'], country: 'USA', }, }, response: { status: 200, body: aggregatedData, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample: `<gs-aggregate fields='[\"division\", \"host\"]' filter='{\"country\": \"USA\"}' views='[\"table\"]'></gs-aggregate>`, }, }), tags: ['autodocs'], }"
|
|
1053
1053
|
},
|
|
1054
1054
|
{
|
|
1055
1055
|
"kind": "variable",
|
|
1056
|
-
"name": "
|
|
1056
|
+
"name": "Table",
|
|
1057
1057
|
"type": {
|
|
1058
|
-
"text": "StoryObj<
|
|
1058
|
+
"text": "StoryObj<AggregateProps>"
|
|
1059
1059
|
},
|
|
1060
|
-
"default": "{
|
|
1060
|
+
"default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <gs-aggregate .fields=${args.fields} .filter=${args.filter} .views=${args.views} .size=${args.size} .headline=${args.headline} ></gs-aggregate> </gs-app> `, args: { fields: ['division', 'host'], views: ['table'], filter: { country: 'USA', }, size: { width: '100%', height: '700px' }, headline: 'Aggregate', }, }"
|
|
1061
1061
|
}
|
|
1062
1062
|
],
|
|
1063
1063
|
"exports": [
|
|
@@ -1066,63 +1066,57 @@
|
|
|
1066
1066
|
"name": "default",
|
|
1067
1067
|
"declaration": {
|
|
1068
1068
|
"name": "meta",
|
|
1069
|
-
"module": "src/web-components/
|
|
1069
|
+
"module": "src/web-components/visualization/gs-aggregate.stories.ts"
|
|
1070
1070
|
}
|
|
1071
1071
|
},
|
|
1072
1072
|
{
|
|
1073
1073
|
"kind": "js",
|
|
1074
|
-
"name": "
|
|
1074
|
+
"name": "Table",
|
|
1075
1075
|
"declaration": {
|
|
1076
|
-
"name": "
|
|
1077
|
-
"module": "src/web-components/
|
|
1076
|
+
"name": "Table",
|
|
1077
|
+
"module": "src/web-components/visualization/gs-aggregate.stories.ts"
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
]
|
|
1081
1081
|
},
|
|
1082
1082
|
{
|
|
1083
1083
|
"kind": "javascript-module",
|
|
1084
|
-
"path": "src/web-components/
|
|
1084
|
+
"path": "src/web-components/visualization/gs-aggregate.tsx",
|
|
1085
1085
|
"declarations": [
|
|
1086
1086
|
{
|
|
1087
1087
|
"kind": "class",
|
|
1088
|
-
"description": "",
|
|
1089
|
-
"name": "
|
|
1088
|
+
"description": "## Context\n\nThis component displays aggregated data, which can provide an overview of the underlying data.\n\nIt expects a list of fields to aggregate by and a filter to apply to the data.",
|
|
1089
|
+
"name": "AggregateComponent",
|
|
1090
1090
|
"members": [
|
|
1091
1091
|
{
|
|
1092
1092
|
"kind": "field",
|
|
1093
|
-
"name": "
|
|
1094
|
-
"type": {
|
|
1095
|
-
"text": "LapisFilter"
|
|
1096
|
-
},
|
|
1097
|
-
"default": "{}",
|
|
1098
|
-
"attribute": "numerator"
|
|
1099
|
-
},
|
|
1100
|
-
{
|
|
1101
|
-
"kind": "field",
|
|
1102
|
-
"name": "denominator",
|
|
1093
|
+
"name": "fields",
|
|
1103
1094
|
"type": {
|
|
1104
|
-
"text": "
|
|
1095
|
+
"text": "string[]"
|
|
1105
1096
|
},
|
|
1106
|
-
"default": "
|
|
1107
|
-
"
|
|
1097
|
+
"default": "[]",
|
|
1098
|
+
"description": "The fields to aggregate by.",
|
|
1099
|
+
"attribute": "fields"
|
|
1108
1100
|
},
|
|
1109
1101
|
{
|
|
1110
1102
|
"kind": "field",
|
|
1111
|
-
"name": "
|
|
1103
|
+
"name": "views",
|
|
1112
1104
|
"type": {
|
|
1113
|
-
"text": "
|
|
1105
|
+
"text": "View[]"
|
|
1114
1106
|
},
|
|
1115
|
-
"default": "
|
|
1116
|
-
"
|
|
1107
|
+
"default": "['table']",
|
|
1108
|
+
"description": "The views are used to display the aggregated data.\nIn the table view, the data is presented in a table format where each field is a column,\nalong with the aggregated value and its proportion.\nThe proportion represents the ratio of the aggregated value to the total count of the data\n(considering the applied filter).",
|
|
1109
|
+
"attribute": "views"
|
|
1117
1110
|
},
|
|
1118
1111
|
{
|
|
1119
1112
|
"kind": "field",
|
|
1120
|
-
"name": "
|
|
1113
|
+
"name": "filter",
|
|
1121
1114
|
"type": {
|
|
1122
|
-
"text": "
|
|
1115
|
+
"text": "LapisFilter"
|
|
1123
1116
|
},
|
|
1124
|
-
"default": "
|
|
1125
|
-
"
|
|
1117
|
+
"default": "{}",
|
|
1118
|
+
"description": "The filter to apply to the data.",
|
|
1119
|
+
"attribute": "filter"
|
|
1126
1120
|
},
|
|
1127
1121
|
{
|
|
1128
1122
|
"kind": "field",
|
|
@@ -1133,41 +1127,46 @@
|
|
|
1133
1127
|
"default": "undefined",
|
|
1134
1128
|
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1135
1129
|
"attribute": "size"
|
|
1136
|
-
}
|
|
1137
|
-
],
|
|
1138
|
-
"attributes": [
|
|
1139
|
-
{
|
|
1140
|
-
"name": "numerator",
|
|
1141
|
-
"type": {
|
|
1142
|
-
"text": "LapisFilter"
|
|
1143
|
-
},
|
|
1144
|
-
"default": "{}",
|
|
1145
|
-
"fieldName": "numerator"
|
|
1146
1130
|
},
|
|
1147
1131
|
{
|
|
1148
|
-
"
|
|
1132
|
+
"kind": "field",
|
|
1133
|
+
"name": "headline",
|
|
1149
1134
|
"type": {
|
|
1150
|
-
"text": "
|
|
1135
|
+
"text": "string | undefined"
|
|
1151
1136
|
},
|
|
1152
|
-
"default": "
|
|
1153
|
-
"
|
|
1154
|
-
|
|
1137
|
+
"default": "'Aggregate'",
|
|
1138
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1139
|
+
"attribute": "headline"
|
|
1140
|
+
}
|
|
1141
|
+
],
|
|
1142
|
+
"attributes": [
|
|
1155
1143
|
{
|
|
1156
|
-
"name": "
|
|
1144
|
+
"name": "fields",
|
|
1157
1145
|
"type": {
|
|
1158
|
-
"text": "
|
|
1146
|
+
"text": "string[]"
|
|
1159
1147
|
},
|
|
1160
|
-
"default": "
|
|
1161
|
-
"
|
|
1148
|
+
"default": "[]",
|
|
1149
|
+
"description": "The fields to aggregate by.",
|
|
1150
|
+
"fieldName": "fields"
|
|
1162
1151
|
},
|
|
1163
1152
|
{
|
|
1164
1153
|
"name": "views",
|
|
1165
1154
|
"type": {
|
|
1166
1155
|
"text": "View[]"
|
|
1167
1156
|
},
|
|
1168
|
-
"default": "['
|
|
1157
|
+
"default": "['table']",
|
|
1158
|
+
"description": "The views are used to display the aggregated data.\nIn the table view, the data is presented in a table format where each field is a column,\nalong with the aggregated value and its proportion.\nThe proportion represents the ratio of the aggregated value to the total count of the data\n(considering the applied filter).",
|
|
1169
1159
|
"fieldName": "views"
|
|
1170
1160
|
},
|
|
1161
|
+
{
|
|
1162
|
+
"name": "filter",
|
|
1163
|
+
"type": {
|
|
1164
|
+
"text": "LapisFilter"
|
|
1165
|
+
},
|
|
1166
|
+
"default": "{}",
|
|
1167
|
+
"description": "The filter to apply to the data.",
|
|
1168
|
+
"fieldName": "filter"
|
|
1169
|
+
},
|
|
1171
1170
|
{
|
|
1172
1171
|
"name": "size",
|
|
1173
1172
|
"type": {
|
|
@@ -1176,85 +1175,71 @@
|
|
|
1176
1175
|
"default": "undefined",
|
|
1177
1176
|
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1178
1177
|
"fieldName": "size"
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
"name": "headline",
|
|
1181
|
+
"type": {
|
|
1182
|
+
"text": "string | undefined"
|
|
1183
|
+
},
|
|
1184
|
+
"default": "'Aggregate'",
|
|
1185
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1186
|
+
"fieldName": "headline"
|
|
1179
1187
|
}
|
|
1180
1188
|
],
|
|
1181
1189
|
"superclass": {
|
|
1182
|
-
"name": "
|
|
1183
|
-
"module": "/src/web-components/
|
|
1190
|
+
"name": "PreactLitAdapterWithGridJsStyles",
|
|
1191
|
+
"module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
|
|
1184
1192
|
},
|
|
1185
|
-
"tagName": "gs-
|
|
1193
|
+
"tagName": "gs-aggregate",
|
|
1186
1194
|
"customElement": true
|
|
1187
1195
|
}
|
|
1188
1196
|
],
|
|
1189
1197
|
"exports": [
|
|
1190
1198
|
{
|
|
1191
1199
|
"kind": "js",
|
|
1192
|
-
"name": "
|
|
1200
|
+
"name": "AggregateComponent",
|
|
1193
1201
|
"declaration": {
|
|
1194
|
-
"name": "
|
|
1195
|
-
"module": "src/web-components/
|
|
1202
|
+
"name": "AggregateComponent",
|
|
1203
|
+
"module": "src/web-components/visualization/gs-aggregate.tsx"
|
|
1196
1204
|
}
|
|
1197
1205
|
},
|
|
1198
1206
|
{
|
|
1199
1207
|
"kind": "custom-element-definition",
|
|
1200
|
-
"name": "gs-
|
|
1208
|
+
"name": "gs-aggregate",
|
|
1201
1209
|
"declaration": {
|
|
1202
|
-
"name": "
|
|
1203
|
-
"module": "src/web-components/
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
]
|
|
1207
|
-
},
|
|
1208
|
-
{
|
|
1209
|
-
"kind": "javascript-module",
|
|
1210
|
-
"path": "src/web-components/index.ts",
|
|
1211
|
-
"declarations": [],
|
|
1212
|
-
"exports": [
|
|
1213
|
-
{
|
|
1214
|
-
"kind": "js",
|
|
1215
|
-
"name": "App",
|
|
1216
|
-
"declaration": {
|
|
1217
|
-
"name": "App",
|
|
1218
|
-
"module": "./app.js"
|
|
1219
|
-
}
|
|
1220
|
-
},
|
|
1221
|
-
{
|
|
1222
|
-
"kind": "js",
|
|
1223
|
-
"name": "*",
|
|
1224
|
-
"declaration": {
|
|
1225
|
-
"name": "*",
|
|
1226
|
-
"package": "./display"
|
|
1227
|
-
}
|
|
1228
|
-
},
|
|
1229
|
-
{
|
|
1230
|
-
"kind": "js",
|
|
1231
|
-
"name": "*",
|
|
1232
|
-
"declaration": {
|
|
1233
|
-
"name": "*",
|
|
1234
|
-
"package": "./input"
|
|
1210
|
+
"name": "AggregateComponent",
|
|
1211
|
+
"module": "src/web-components/visualization/gs-aggregate.tsx"
|
|
1235
1212
|
}
|
|
1236
1213
|
}
|
|
1237
1214
|
]
|
|
1238
1215
|
},
|
|
1239
1216
|
{
|
|
1240
1217
|
"kind": "javascript-module",
|
|
1241
|
-
"path": "src/web-components/
|
|
1218
|
+
"path": "src/web-components/visualization/gs-mutation-comparison.stories.ts",
|
|
1242
1219
|
"declarations": [
|
|
1243
1220
|
{
|
|
1244
1221
|
"kind": "variable",
|
|
1245
1222
|
"name": "meta",
|
|
1246
1223
|
"type": {
|
|
1247
|
-
"text": "Meta<
|
|
1224
|
+
"text": "Meta<MutationComparisonProps>"
|
|
1248
1225
|
},
|
|
1249
|
-
"default": "{
|
|
1226
|
+
"default": "{ title: 'Visualization/Mutation comparison', component: 'gs-mutation-comparison', argTypes: { variants: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'venn'], control: { type: 'check' }, }, size: { control: 'object' }, headline: { control: 'text' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1250
1227
|
},
|
|
1251
1228
|
{
|
|
1252
1229
|
"kind": "variable",
|
|
1253
|
-
"name": "
|
|
1230
|
+
"name": "Default",
|
|
1254
1231
|
"type": {
|
|
1255
|
-
"text": "StoryObj<
|
|
1232
|
+
"text": "StoryObj<MutationComparisonProps>"
|
|
1256
1233
|
},
|
|
1257
|
-
"default": "{
|
|
1234
|
+
"default": "{ ...Template, args: { variants: [ { displayName: 'Some variant', lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo }, }, { displayName: 'Other variant', lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom, dateTo, }, }, ], sequenceType: 'nucleotide', views: ['table', 'venn'], size: { width: '100%', height: '700px' }, headline: 'Mutation comparison', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'nucleotideMutationsSomeVariant', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo, minProportion: 0, }, }, response: { status: 200, body: nucleotideMutationsSomeVariant, }, }, { matcher: { name: 'nucleotideMutationsOtherVariant', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom, dateTo, minProportion: 0, }, }, response: { status: 200, body: nucleotideMutationsOtherVariant, }, }, ], }, }, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-comparison'); await step('Min and max proportions should be 50% and 100%', async () => { const minInput = () => canvas.getAllByLabelText('%')[0]; const maxInput = () => canvas.getAllByLabelText('%')[1]; await waitFor(() => expect(minInput()).toHaveValue(50)); await waitFor(() => expect(maxInput()).toHaveValue(100)); }); }, }"
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
"kind": "variable",
|
|
1238
|
+
"name": "VennDiagram",
|
|
1239
|
+
"type": {
|
|
1240
|
+
"text": "StoryObj<MutationComparisonProps>"
|
|
1241
|
+
},
|
|
1242
|
+
"default": "{ ...Default, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-comparison'); await step('Switch to Venn diagram view', async () => { await waitFor(() => expect(canvas.getByRole('button', { name: 'Venn' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Venn' })); await waitFor(() => expect( canvas.getByText('You have no elements selected. Click in the venn diagram to select.'), ).toBeVisible(), ); }); }, }"
|
|
1258
1243
|
}
|
|
1259
1244
|
],
|
|
1260
1245
|
"exports": [
|
|
@@ -1263,200 +1248,196 @@
|
|
|
1263
1248
|
"name": "default",
|
|
1264
1249
|
"declaration": {
|
|
1265
1250
|
"name": "meta",
|
|
1266
|
-
"module": "src/web-components/
|
|
1251
|
+
"module": "src/web-components/visualization/gs-mutation-comparison.stories.ts"
|
|
1267
1252
|
}
|
|
1268
1253
|
},
|
|
1269
1254
|
{
|
|
1270
1255
|
"kind": "js",
|
|
1271
|
-
"name": "
|
|
1256
|
+
"name": "Default",
|
|
1272
1257
|
"declaration": {
|
|
1273
|
-
"name": "
|
|
1274
|
-
"module": "src/web-components/
|
|
1258
|
+
"name": "Default",
|
|
1259
|
+
"module": "src/web-components/visualization/gs-mutation-comparison.stories.ts"
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
"kind": "js",
|
|
1264
|
+
"name": "VennDiagram",
|
|
1265
|
+
"declaration": {
|
|
1266
|
+
"name": "VennDiagram",
|
|
1267
|
+
"module": "src/web-components/visualization/gs-mutation-comparison.stories.ts"
|
|
1275
1268
|
}
|
|
1276
1269
|
}
|
|
1277
1270
|
]
|
|
1278
1271
|
},
|
|
1279
1272
|
{
|
|
1280
1273
|
"kind": "javascript-module",
|
|
1281
|
-
"path": "src/web-components/
|
|
1274
|
+
"path": "src/web-components/visualization/gs-mutation-comparison.tsx",
|
|
1282
1275
|
"declarations": [
|
|
1283
1276
|
{
|
|
1284
1277
|
"kind": "class",
|
|
1285
|
-
"description": "",
|
|
1286
|
-
"name": "
|
|
1278
|
+
"description": "This component allows to compare mutations between different variants.\nA variant is defined by its LAPIS filter.\n\nIt only shows substitutions and deletions, it does not show insertions.\n\n## Views\n\n### Table View\n\nThe table view shows mutations\nand the proportions with which the mutation occurs in the respective variant.\nIt only shows mutations that are present in at least one of the variants\nand where the proportion is within the selected proportion interval for at least one variant.\n\n### Venn View\n\nThe Venn view shows the overlap of mutations between the variants in a Venn diagram.\nA variant is considered to have a certain mutation,\nif the proportion of the mutation in the variant is within the selected proportion interval.\nThus, changing the proportion interval may change a mutations from being \"common\" between variant\nto being \"for one variant only\".",
|
|
1279
|
+
"name": "MutationComparisonComponent",
|
|
1287
1280
|
"members": [
|
|
1288
1281
|
{
|
|
1289
1282
|
"kind": "field",
|
|
1290
|
-
"name": "
|
|
1283
|
+
"name": "variants",
|
|
1291
1284
|
"type": {
|
|
1292
|
-
"text": "
|
|
1285
|
+
"text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
|
|
1293
1286
|
},
|
|
1294
1287
|
"default": "[]",
|
|
1295
|
-
"
|
|
1288
|
+
"description": "An array of variants to compare.\n\nThe `lapisFilter` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used as the label for the variant in the views.\nIt should be human-readable.",
|
|
1289
|
+
"attribute": "variants"
|
|
1296
1290
|
},
|
|
1297
1291
|
{
|
|
1298
1292
|
"kind": "field",
|
|
1299
|
-
"name": "
|
|
1293
|
+
"name": "sequenceType",
|
|
1300
1294
|
"type": {
|
|
1301
|
-
"text": "
|
|
1295
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
1302
1296
|
},
|
|
1303
|
-
"default": "'
|
|
1304
|
-
"
|
|
1297
|
+
"default": "'nucleotide'",
|
|
1298
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
1299
|
+
"attribute": "sequenceType"
|
|
1305
1300
|
},
|
|
1306
1301
|
{
|
|
1307
1302
|
"kind": "field",
|
|
1308
|
-
"name": "
|
|
1303
|
+
"name": "views",
|
|
1309
1304
|
"type": {
|
|
1310
|
-
"text": "
|
|
1305
|
+
"text": "('table' | 'venn')[]"
|
|
1311
1306
|
},
|
|
1312
|
-
"default": "''",
|
|
1313
|
-
"
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
"events": [
|
|
1307
|
+
"default": "['table']",
|
|
1308
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1309
|
+
"attribute": "views"
|
|
1310
|
+
},
|
|
1317
1311
|
{
|
|
1312
|
+
"kind": "field",
|
|
1313
|
+
"name": "size",
|
|
1318
1314
|
"type": {
|
|
1319
|
-
"text": "
|
|
1315
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1320
1316
|
},
|
|
1321
|
-
"
|
|
1322
|
-
"
|
|
1317
|
+
"default": "undefined",
|
|
1318
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1319
|
+
"attribute": "size"
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
"kind": "field",
|
|
1323
|
+
"name": "headline",
|
|
1324
|
+
"type": {
|
|
1325
|
+
"text": "string | undefined"
|
|
1326
|
+
},
|
|
1327
|
+
"default": "'Mutation comparison'",
|
|
1328
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1329
|
+
"attribute": "headline"
|
|
1323
1330
|
}
|
|
1324
1331
|
],
|
|
1325
1332
|
"attributes": [
|
|
1326
1333
|
{
|
|
1327
|
-
"name": "
|
|
1334
|
+
"name": "variants",
|
|
1328
1335
|
"type": {
|
|
1329
|
-
"text": "
|
|
1336
|
+
"text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
|
|
1330
1337
|
},
|
|
1331
1338
|
"default": "[]",
|
|
1332
|
-
"
|
|
1339
|
+
"description": "An array of variants to compare.\n\nThe `lapisFilter` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used as the label for the variant in the views.\nIt should be human-readable.",
|
|
1340
|
+
"fieldName": "variants"
|
|
1333
1341
|
},
|
|
1334
1342
|
{
|
|
1335
|
-
"name": "
|
|
1343
|
+
"name": "sequenceType",
|
|
1336
1344
|
"type": {
|
|
1337
|
-
"text": "
|
|
1345
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
1338
1346
|
},
|
|
1339
|
-
"default": "'
|
|
1340
|
-
"
|
|
1347
|
+
"default": "'nucleotide'",
|
|
1348
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
1349
|
+
"fieldName": "sequenceType"
|
|
1341
1350
|
},
|
|
1342
1351
|
{
|
|
1343
|
-
"name": "
|
|
1352
|
+
"name": "views",
|
|
1344
1353
|
"type": {
|
|
1345
|
-
"text": "
|
|
1354
|
+
"text": "('table' | 'venn')[]"
|
|
1346
1355
|
},
|
|
1347
|
-
"default": "''",
|
|
1348
|
-
"
|
|
1356
|
+
"default": "['table']",
|
|
1357
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1358
|
+
"fieldName": "views"
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
"name": "size",
|
|
1362
|
+
"type": {
|
|
1363
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1364
|
+
},
|
|
1365
|
+
"default": "undefined",
|
|
1366
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1367
|
+
"fieldName": "size"
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
"name": "headline",
|
|
1371
|
+
"type": {
|
|
1372
|
+
"text": "string | undefined"
|
|
1373
|
+
},
|
|
1374
|
+
"default": "'Mutation comparison'",
|
|
1375
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1376
|
+
"fieldName": "headline"
|
|
1349
1377
|
}
|
|
1350
1378
|
],
|
|
1351
1379
|
"superclass": {
|
|
1352
|
-
"name": "
|
|
1353
|
-
"module": "/src/web-components/
|
|
1380
|
+
"name": "PreactLitAdapterWithGridJsStyles",
|
|
1381
|
+
"module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
|
|
1354
1382
|
},
|
|
1355
|
-
"tagName": "gs-
|
|
1383
|
+
"tagName": "gs-mutation-comparison",
|
|
1356
1384
|
"customElement": true
|
|
1357
|
-
}
|
|
1358
|
-
],
|
|
1359
|
-
"exports": [
|
|
1360
|
-
{
|
|
1361
|
-
"kind": "js",
|
|
1362
|
-
"name": "DateRangeSelectorComponent",
|
|
1363
|
-
"declaration": {
|
|
1364
|
-
"name": "DateRangeSelectorComponent",
|
|
1365
|
-
"module": "src/web-components/input/date-range-selector-component.tsx"
|
|
1366
|
-
}
|
|
1367
|
-
},
|
|
1368
|
-
{
|
|
1369
|
-
"kind": "custom-element-definition",
|
|
1370
|
-
"name": "gs-date-range-selector",
|
|
1371
|
-
"declaration": {
|
|
1372
|
-
"name": "DateRangeSelectorComponent",
|
|
1373
|
-
"module": "src/web-components/input/date-range-selector-component.tsx"
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
]
|
|
1377
|
-
},
|
|
1378
|
-
{
|
|
1379
|
-
"kind": "javascript-module",
|
|
1380
|
-
"path": "src/web-components/input/index.ts",
|
|
1381
|
-
"declarations": [],
|
|
1382
|
-
"exports": [
|
|
1383
|
-
{
|
|
1384
|
-
"kind": "js",
|
|
1385
|
-
"name": "DateRangeSelectorComponent",
|
|
1386
|
-
"declaration": {
|
|
1387
|
-
"name": "DateRangeSelectorComponent",
|
|
1388
|
-
"module": "./date-range-selector-component"
|
|
1389
|
-
}
|
|
1390
|
-
},
|
|
1391
|
-
{
|
|
1392
|
-
"kind": "js",
|
|
1393
|
-
"name": "LocationFilterComponent",
|
|
1394
|
-
"declaration": {
|
|
1395
|
-
"name": "LocationFilterComponent",
|
|
1396
|
-
"module": "./location-filter-component"
|
|
1397
|
-
}
|
|
1398
|
-
},
|
|
1385
|
+
}
|
|
1386
|
+
],
|
|
1387
|
+
"exports": [
|
|
1399
1388
|
{
|
|
1400
1389
|
"kind": "js",
|
|
1401
|
-
"name": "
|
|
1390
|
+
"name": "MutationComparisonComponent",
|
|
1402
1391
|
"declaration": {
|
|
1403
|
-
"name": "
|
|
1404
|
-
"module": "
|
|
1392
|
+
"name": "MutationComparisonComponent",
|
|
1393
|
+
"module": "src/web-components/visualization/gs-mutation-comparison.tsx"
|
|
1405
1394
|
}
|
|
1406
1395
|
},
|
|
1407
1396
|
{
|
|
1408
|
-
"kind": "
|
|
1409
|
-
"name": "
|
|
1397
|
+
"kind": "custom-element-definition",
|
|
1398
|
+
"name": "gs-mutation-comparison",
|
|
1410
1399
|
"declaration": {
|
|
1411
|
-
"name": "
|
|
1412
|
-
"module": "
|
|
1400
|
+
"name": "MutationComparisonComponent",
|
|
1401
|
+
"module": "src/web-components/visualization/gs-mutation-comparison.tsx"
|
|
1413
1402
|
}
|
|
1414
1403
|
}
|
|
1415
1404
|
]
|
|
1416
1405
|
},
|
|
1417
1406
|
{
|
|
1418
1407
|
"kind": "javascript-module",
|
|
1419
|
-
"path": "src/web-components/
|
|
1408
|
+
"path": "src/web-components/visualization/gs-mutations.stories.ts",
|
|
1420
1409
|
"declarations": [
|
|
1421
1410
|
{
|
|
1422
1411
|
"kind": "variable",
|
|
1423
1412
|
"name": "meta",
|
|
1424
1413
|
"type": {
|
|
1425
|
-
"text": "Meta"
|
|
1426
|
-
},
|
|
1427
|
-
"default": "{\n title: 'Input/Location filter',\n component: 'gs-location-filter',\n parameters: withComponentDocs({\n actions: {\n handles: ['gs-location-changed'],\n },\n componentDocs: {\n tag: 'gs-location-filter',\n opensShadowDom: true,\n expectsChildren: false,\n codeExample: `<gs-location-filter fields=\"['continent', 'country']\" value='Europe / Switzerland'></gs-location-filter>`,\n },\n }),\n decorators: [withActions],\n tags: ['autodocs'],\n}"
|
|
1428
|
-
},
|
|
1429
|
-
{
|
|
1430
|
-
"kind": "variable",
|
|
1431
|
-
"name": "LocationFilter",
|
|
1432
|
-
"type": {
|
|
1433
|
-
"text": "StoryObj<LocationFilterProps>"
|
|
1414
|
+
"text": "Meta<MutationsProps>"
|
|
1434
1415
|
},
|
|
1435
|
-
"default": "{
|
|
1416
|
+
"default": "{ title: 'Visualization/Mutations', component: 'gs-mutations', argTypes: { variant: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'grid', 'insertions'], control: { type: 'check' }, }, size: { control: 'object' }, headline: { control: 'text' }, }, args: { variant: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' }, sequenceType: 'nucleotide', views: ['grid', 'table', 'insertions'], size: { width: '100%', height: '700px' }, headline: 'Mutations', }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1436
1417
|
},
|
|
1437
1418
|
{
|
|
1438
1419
|
"kind": "variable",
|
|
1439
|
-
"name": "
|
|
1420
|
+
"name": "Default",
|
|
1440
1421
|
"type": {
|
|
1441
|
-
"text": "StoryObj<
|
|
1422
|
+
"text": "StoryObj<MutationsProps>"
|
|
1442
1423
|
},
|
|
1443
|
-
"default": "{
|
|
1424
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: { name: 'nucleotideMutations', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01', minProportion: 0, }, }, response: { status: 200, body: nucleotideMutations, }, }, { matcher: { name: 'nucleotideInsertions', url: NUCLEOTIDE_INSERTIONS_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' }, }, response: { status: 200, body: nucleotideInsertions, }, }, ], }, }, }"
|
|
1444
1425
|
},
|
|
1445
1426
|
{
|
|
1446
1427
|
"kind": "variable",
|
|
1447
|
-
"name": "
|
|
1428
|
+
"name": "OnTableTab",
|
|
1448
1429
|
"type": {
|
|
1449
|
-
"text": "StoryObj<
|
|
1430
|
+
"text": "StoryObj<MutationsProps>"
|
|
1450
1431
|
},
|
|
1451
|
-
"default": "{
|
|
1432
|
+
"default": "{ ...Default, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutations'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Table' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Table' })); }, }"
|
|
1452
1433
|
},
|
|
1453
1434
|
{
|
|
1454
1435
|
"kind": "variable",
|
|
1455
|
-
"name": "
|
|
1436
|
+
"name": "OnInsertionsTab",
|
|
1456
1437
|
"type": {
|
|
1457
|
-
"text": "StoryObj<
|
|
1438
|
+
"text": "StoryObj<MutationsProps>"
|
|
1458
1439
|
},
|
|
1459
|
-
"default": "{
|
|
1440
|
+
"default": "{ ...Default, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutations'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Insertions' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Insertions' })); }, }"
|
|
1460
1441
|
}
|
|
1461
1442
|
],
|
|
1462
1443
|
"exports": [
|
|
@@ -1465,164 +1446,220 @@
|
|
|
1465
1446
|
"name": "default",
|
|
1466
1447
|
"declaration": {
|
|
1467
1448
|
"name": "meta",
|
|
1468
|
-
"module": "src/web-components/
|
|
1469
|
-
}
|
|
1470
|
-
},
|
|
1471
|
-
{
|
|
1472
|
-
"kind": "js",
|
|
1473
|
-
"name": "LocationFilter",
|
|
1474
|
-
"declaration": {
|
|
1475
|
-
"name": "LocationFilter",
|
|
1476
|
-
"module": "src/web-components/input/location-filter-component.stories.ts"
|
|
1449
|
+
"module": "src/web-components/visualization/gs-mutations.stories.ts"
|
|
1477
1450
|
}
|
|
1478
1451
|
},
|
|
1479
1452
|
{
|
|
1480
1453
|
"kind": "js",
|
|
1481
|
-
"name": "
|
|
1454
|
+
"name": "Default",
|
|
1482
1455
|
"declaration": {
|
|
1483
|
-
"name": "
|
|
1484
|
-
"module": "src/web-components/
|
|
1456
|
+
"name": "Default",
|
|
1457
|
+
"module": "src/web-components/visualization/gs-mutations.stories.ts"
|
|
1485
1458
|
}
|
|
1486
1459
|
},
|
|
1487
1460
|
{
|
|
1488
1461
|
"kind": "js",
|
|
1489
|
-
"name": "
|
|
1462
|
+
"name": "OnTableTab",
|
|
1490
1463
|
"declaration": {
|
|
1491
|
-
"name": "
|
|
1492
|
-
"module": "src/web-components/
|
|
1464
|
+
"name": "OnTableTab",
|
|
1465
|
+
"module": "src/web-components/visualization/gs-mutations.stories.ts"
|
|
1493
1466
|
}
|
|
1494
1467
|
},
|
|
1495
1468
|
{
|
|
1496
1469
|
"kind": "js",
|
|
1497
|
-
"name": "
|
|
1470
|
+
"name": "OnInsertionsTab",
|
|
1498
1471
|
"declaration": {
|
|
1499
|
-
"name": "
|
|
1500
|
-
"module": "src/web-components/
|
|
1472
|
+
"name": "OnInsertionsTab",
|
|
1473
|
+
"module": "src/web-components/visualization/gs-mutations.stories.ts"
|
|
1501
1474
|
}
|
|
1502
1475
|
}
|
|
1503
1476
|
]
|
|
1504
1477
|
},
|
|
1505
1478
|
{
|
|
1506
1479
|
"kind": "javascript-module",
|
|
1507
|
-
"path": "src/web-components/
|
|
1480
|
+
"path": "src/web-components/visualization/gs-mutations.tsx",
|
|
1508
1481
|
"declarations": [
|
|
1509
1482
|
{
|
|
1510
1483
|
"kind": "class",
|
|
1511
|
-
"description": "##
|
|
1512
|
-
"name": "
|
|
1484
|
+
"description": "This component displays mutations (substitutions, deletions and insertions) for a given variant.\n\n## Views\n\n### Table View\n\nThe table view shows all substitutions and deletions for the given variant.\nIt shows the type (substitution or deletion), the total count of the mutation\nand the proportion of the mutation in the variant.\nThe proportion is relative to the total number of sequences matching\nthe specified sequence filters with non-ambiguous reads at that position.\n\nThe proportion interval filter can be used to filter the displayed mutations on client side.\n\n### Grid View\n\nThe grid view shows the proportion of each sequence symbol (nucleotide or amino acid) for each position that has a mutation.\nOnly positions with at least one mutation in the selected proportion interval are shown.\n\n### Insertions View\n\nThe insertions view shows the count of all insertions for the given variant.",
|
|
1485
|
+
"name": "MutationsComponent",
|
|
1513
1486
|
"members": [
|
|
1514
1487
|
{
|
|
1515
1488
|
"kind": "field",
|
|
1516
|
-
"name": "
|
|
1489
|
+
"name": "variant",
|
|
1517
1490
|
"type": {
|
|
1518
|
-
"text": "string"
|
|
1491
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1519
1492
|
},
|
|
1520
|
-
"default": "
|
|
1521
|
-
"description": "The
|
|
1522
|
-
"attribute": "
|
|
1493
|
+
"default": "{}",
|
|
1494
|
+
"description": "The `variant` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.",
|
|
1495
|
+
"attribute": "variant"
|
|
1523
1496
|
},
|
|
1524
1497
|
{
|
|
1525
1498
|
"kind": "field",
|
|
1526
|
-
"name": "
|
|
1499
|
+
"name": "sequenceType",
|
|
1527
1500
|
"type": {
|
|
1528
|
-
"text": "
|
|
1501
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
1529
1502
|
},
|
|
1530
|
-
"default": "
|
|
1531
|
-
"description": "The
|
|
1532
|
-
"attribute": "
|
|
1533
|
-
}
|
|
1534
|
-
],
|
|
1535
|
-
"events": [
|
|
1503
|
+
"default": "'nucleotide'",
|
|
1504
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
1505
|
+
"attribute": "sequenceType"
|
|
1506
|
+
},
|
|
1536
1507
|
{
|
|
1508
|
+
"kind": "field",
|
|
1509
|
+
"name": "views",
|
|
1537
1510
|
"type": {
|
|
1538
|
-
"text": "
|
|
1511
|
+
"text": "('table' | 'grid' | 'insertions')[]"
|
|
1539
1512
|
},
|
|
1540
|
-
"
|
|
1541
|
-
"
|
|
1513
|
+
"default": "['table', 'grid']",
|
|
1514
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1515
|
+
"attribute": "views"
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
"kind": "field",
|
|
1519
|
+
"name": "size",
|
|
1520
|
+
"type": {
|
|
1521
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1522
|
+
},
|
|
1523
|
+
"default": "undefined",
|
|
1524
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1525
|
+
"attribute": "size"
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
"kind": "field",
|
|
1529
|
+
"name": "headline",
|
|
1530
|
+
"type": {
|
|
1531
|
+
"text": "string | undefined"
|
|
1532
|
+
},
|
|
1533
|
+
"default": "'Mutations'",
|
|
1534
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1535
|
+
"attribute": "headline"
|
|
1542
1536
|
}
|
|
1543
1537
|
],
|
|
1544
1538
|
"attributes": [
|
|
1545
1539
|
{
|
|
1546
|
-
"name": "
|
|
1540
|
+
"name": "variant",
|
|
1547
1541
|
"type": {
|
|
1548
|
-
"text": "string"
|
|
1542
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1549
1543
|
},
|
|
1550
|
-
"default": "
|
|
1551
|
-
"description": "The
|
|
1552
|
-
"fieldName": "
|
|
1544
|
+
"default": "{}",
|
|
1545
|
+
"description": "The `variant` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.",
|
|
1546
|
+
"fieldName": "variant"
|
|
1553
1547
|
},
|
|
1554
1548
|
{
|
|
1555
|
-
"name": "
|
|
1549
|
+
"name": "sequenceType",
|
|
1556
1550
|
"type": {
|
|
1557
|
-
"text": "
|
|
1551
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
1558
1552
|
},
|
|
1559
|
-
"default": "
|
|
1560
|
-
"description": "The
|
|
1561
|
-
"fieldName": "
|
|
1553
|
+
"default": "'nucleotide'",
|
|
1554
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
1555
|
+
"fieldName": "sequenceType"
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
"name": "views",
|
|
1559
|
+
"type": {
|
|
1560
|
+
"text": "('table' | 'grid' | 'insertions')[]"
|
|
1561
|
+
},
|
|
1562
|
+
"default": "['table', 'grid']",
|
|
1563
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1564
|
+
"fieldName": "views"
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
"name": "size",
|
|
1568
|
+
"type": {
|
|
1569
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1570
|
+
},
|
|
1571
|
+
"default": "undefined",
|
|
1572
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1573
|
+
"fieldName": "size"
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
"name": "headline",
|
|
1577
|
+
"type": {
|
|
1578
|
+
"text": "string | undefined"
|
|
1579
|
+
},
|
|
1580
|
+
"default": "'Mutations'",
|
|
1581
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1582
|
+
"fieldName": "headline"
|
|
1562
1583
|
}
|
|
1563
1584
|
],
|
|
1564
1585
|
"superclass": {
|
|
1565
|
-
"name": "
|
|
1566
|
-
"module": "/src/web-components/
|
|
1586
|
+
"name": "PreactLitAdapterWithGridJsStyles",
|
|
1587
|
+
"module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
|
|
1567
1588
|
},
|
|
1568
|
-
"tagName": "gs-
|
|
1589
|
+
"tagName": "gs-mutations",
|
|
1569
1590
|
"customElement": true
|
|
1570
1591
|
}
|
|
1571
1592
|
],
|
|
1572
1593
|
"exports": [
|
|
1573
1594
|
{
|
|
1574
1595
|
"kind": "js",
|
|
1575
|
-
"name": "
|
|
1596
|
+
"name": "MutationsComponent",
|
|
1576
1597
|
"declaration": {
|
|
1577
|
-
"name": "
|
|
1578
|
-
"module": "src/web-components/
|
|
1598
|
+
"name": "MutationsComponent",
|
|
1599
|
+
"module": "src/web-components/visualization/gs-mutations.tsx"
|
|
1579
1600
|
}
|
|
1580
1601
|
},
|
|
1581
1602
|
{
|
|
1582
1603
|
"kind": "custom-element-definition",
|
|
1583
|
-
"name": "gs-
|
|
1604
|
+
"name": "gs-mutations",
|
|
1584
1605
|
"declaration": {
|
|
1585
|
-
"name": "
|
|
1586
|
-
"module": "src/web-components/
|
|
1606
|
+
"name": "MutationsComponent",
|
|
1607
|
+
"module": "src/web-components/visualization/gs-mutations.tsx"
|
|
1587
1608
|
}
|
|
1588
1609
|
}
|
|
1589
1610
|
]
|
|
1590
1611
|
},
|
|
1591
1612
|
{
|
|
1592
1613
|
"kind": "javascript-module",
|
|
1593
|
-
"path": "src/web-components/
|
|
1614
|
+
"path": "src/web-components/visualization/gs-prevalence-over-time.stories.ts",
|
|
1594
1615
|
"declarations": [
|
|
1595
1616
|
{
|
|
1596
1617
|
"kind": "variable",
|
|
1597
1618
|
"name": "meta",
|
|
1598
1619
|
"type": {
|
|
1599
|
-
"text": "Meta"
|
|
1620
|
+
"text": "Meta<PrevalenceOverTimeProps>"
|
|
1600
1621
|
},
|
|
1601
|
-
"default": "{
|
|
1622
|
+
"default": "{ title: 'Visualization/Prevalence over time', component: 'gs-prevalence-over-time', argTypes: { numerator: { control: 'object' }, denominator: { control: 'object' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, smoothingWindow: { control: 'number' }, views: { options: ['bar', 'line', 'bubble', 'table'], control: { type: 'check' }, }, confidenceIntervalMethods: { options: ['wilson'], control: { type: 'check' }, }, size: [{ control: 'object' }], headline: { control: 'text' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1602
1623
|
},
|
|
1603
1624
|
{
|
|
1604
1625
|
"kind": "variable",
|
|
1605
|
-
"name": "
|
|
1626
|
+
"name": "TwoVariants",
|
|
1606
1627
|
"type": {
|
|
1607
|
-
"text": "StoryObj<
|
|
1628
|
+
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
1608
1629
|
},
|
|
1609
|
-
"default": "{
|
|
1630
|
+
"default": "{ ...Template, args: { numerator: [ { displayName: 'EG', country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' }, { displayName: 'JN.1', country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' }, ], denominator: { country: 'USA', dateFrom: '2023-01-01', displayName: 'All' }, granularity: 'month', smoothingWindow: 0, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], size: { width: '100%', height: '700px' }, headline: 'Prevalence over time', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorEG, }, }, { matcher: { name: 'numeratorJN1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorJN1, }, }, { matcher: { name: 'denominator', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: denominator, }, }, ], }, }, }"
|
|
1610
1631
|
},
|
|
1611
1632
|
{
|
|
1612
1633
|
"kind": "variable",
|
|
1613
|
-
"name": "
|
|
1634
|
+
"name": "OneVariant",
|
|
1614
1635
|
"type": {
|
|
1615
|
-
"text": "StoryObj<
|
|
1636
|
+
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
1616
1637
|
},
|
|
1617
|
-
"default": "{
|
|
1638
|
+
"default": "{ ...Template, args: { numerator: { displayName: 'EG', country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' }, denominator: { country: 'USA', dateFrom: '2023-10-01', displayName: 'All' }, granularity: 'day', smoothingWindow: 7, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], size: { width: '100%', height: '700px' }, headline: 'Prevalence over time', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorOneVariant', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: numeratorOneVariant, }, }, { matcher: { name: 'denominatorOneVariant', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: denominatorOneVariant, }, }, ], }, }, }"
|
|
1618
1639
|
},
|
|
1619
1640
|
{
|
|
1620
1641
|
"kind": "variable",
|
|
1621
|
-
"name": "
|
|
1642
|
+
"name": "OneVariantOnLineTab",
|
|
1622
1643
|
"type": {
|
|
1623
|
-
"text": "StoryObj<
|
|
1644
|
+
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
1645
|
+
},
|
|
1646
|
+
"default": "{ ...OneVariant, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Line' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Line' })); }, }"
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
"kind": "variable",
|
|
1650
|
+
"name": "OneVariantOnBubbleTab",
|
|
1651
|
+
"type": {
|
|
1652
|
+
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
1653
|
+
},
|
|
1654
|
+
"default": "{ ...OneVariant, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Bubble' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Bubble' })); }, }"
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
"kind": "variable",
|
|
1658
|
+
"name": "OneVariantOnTableTab",
|
|
1659
|
+
"type": {
|
|
1660
|
+
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
1624
1661
|
},
|
|
1625
|
-
"default": "{
|
|
1662
|
+
"default": "{ ...OneVariant, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Table' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Table' })); }, }"
|
|
1626
1663
|
}
|
|
1627
1664
|
],
|
|
1628
1665
|
"exports": [
|
|
@@ -1631,134 +1668,261 @@
|
|
|
1631
1668
|
"name": "default",
|
|
1632
1669
|
"declaration": {
|
|
1633
1670
|
"name": "meta",
|
|
1634
|
-
"module": "src/web-components/
|
|
1671
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.stories.ts"
|
|
1635
1672
|
}
|
|
1636
1673
|
},
|
|
1637
1674
|
{
|
|
1638
1675
|
"kind": "js",
|
|
1639
|
-
"name": "
|
|
1676
|
+
"name": "TwoVariants",
|
|
1640
1677
|
"declaration": {
|
|
1641
|
-
"name": "
|
|
1642
|
-
"module": "src/web-components/
|
|
1678
|
+
"name": "TwoVariants",
|
|
1679
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.stories.ts"
|
|
1643
1680
|
}
|
|
1644
1681
|
},
|
|
1645
1682
|
{
|
|
1646
1683
|
"kind": "js",
|
|
1647
|
-
"name": "
|
|
1684
|
+
"name": "OneVariant",
|
|
1648
1685
|
"declaration": {
|
|
1649
|
-
"name": "
|
|
1650
|
-
"module": "src/web-components/
|
|
1686
|
+
"name": "OneVariant",
|
|
1687
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.stories.ts"
|
|
1651
1688
|
}
|
|
1652
1689
|
},
|
|
1653
1690
|
{
|
|
1654
1691
|
"kind": "js",
|
|
1655
|
-
"name": "
|
|
1692
|
+
"name": "OneVariantOnLineTab",
|
|
1656
1693
|
"declaration": {
|
|
1657
|
-
"name": "
|
|
1658
|
-
"module": "src/web-components/
|
|
1694
|
+
"name": "OneVariantOnLineTab",
|
|
1695
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.stories.ts"
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
"kind": "js",
|
|
1700
|
+
"name": "OneVariantOnBubbleTab",
|
|
1701
|
+
"declaration": {
|
|
1702
|
+
"name": "OneVariantOnBubbleTab",
|
|
1703
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.stories.ts"
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
"kind": "js",
|
|
1708
|
+
"name": "OneVariantOnTableTab",
|
|
1709
|
+
"declaration": {
|
|
1710
|
+
"name": "OneVariantOnTableTab",
|
|
1711
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.stories.ts"
|
|
1659
1712
|
}
|
|
1660
1713
|
}
|
|
1661
1714
|
]
|
|
1662
1715
|
},
|
|
1663
1716
|
{
|
|
1664
1717
|
"kind": "javascript-module",
|
|
1665
|
-
"path": "src/web-components/
|
|
1718
|
+
"path": "src/web-components/visualization/gs-prevalence-over-time.tsx",
|
|
1666
1719
|
"declarations": [
|
|
1667
1720
|
{
|
|
1668
1721
|
"kind": "class",
|
|
1669
|
-
"description": "",
|
|
1670
|
-
"name": "
|
|
1722
|
+
"description": "This component displays the prevalence over time of one or more variants.\nThe prevalence is calculated as the ratio of the number of cases of each variant given as `numerator`\nto the number of cases of the variant given as `denominator`.\n\nIn the chart views,\n- the user can select whether to display a confidence interval (not available in the bubble chart).\n The confidence interval is calculated using [Wilson score interval](https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval),\n with a confidence level of 95%.\n- the x-axis shows time steps in the selected `granularity`.\n- the user can select the y-axis scale (linear, logistic, logit).\n\n## Views\n\n### Bar View\n\nDisplays the prevalence over time as a bar chart.\nShows a bar for each variant in the `numerator` on every time step.\n\n### Line View\n\nDisplays the prevalence over time as a line chart.\nEach data point is connected for better visibility.\nShows a line for each variant in the `numerator`.\n\n### Bubble View\n\nDisplays the prevalence over time as a bubble chart.\nThe size of the bubbles represents the number of cases of the `denominator` variant.\nThe height of the bubbles represents the prevalence of the `numerator` variants.\n\n### Table View\n\nDisplays the prevalence over time as a table with one row per time point.",
|
|
1723
|
+
"name": "PrevalenceOverTimeComponent",
|
|
1671
1724
|
"members": [
|
|
1672
1725
|
{
|
|
1673
1726
|
"kind": "field",
|
|
1674
|
-
"name": "
|
|
1727
|
+
"name": "numerator",
|
|
1728
|
+
"type": {
|
|
1729
|
+
"text": "(Record<string, string | number | null | boolean> & { displayName: string })\n | (Record<string, string | number | null | boolean> & {\n displayName: string;\n })[]"
|
|
1730
|
+
},
|
|
1731
|
+
"default": "{ displayName: '' }",
|
|
1732
|
+
"description": "Either a single variant or an array of variants to compare.\nThis must be a valid LAPIS filter object with an additional `displayName` property\nwhich will be used as the label for the variant in the views,\nor an array of such objects.",
|
|
1733
|
+
"attribute": "numerator"
|
|
1734
|
+
},
|
|
1735
|
+
{
|
|
1736
|
+
"kind": "field",
|
|
1737
|
+
"name": "denominator",
|
|
1738
|
+
"type": {
|
|
1739
|
+
"text": "Record<string, string | number | null | boolean> & { displayName: string }"
|
|
1740
|
+
},
|
|
1741
|
+
"default": "{ displayName: '' }",
|
|
1742
|
+
"description": "The variant that the variants in `numerator` are compared to.",
|
|
1743
|
+
"attribute": "denominator"
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
"kind": "field",
|
|
1747
|
+
"name": "granularity",
|
|
1748
|
+
"type": {
|
|
1749
|
+
"text": "'day' | 'week' | 'month' | 'year'"
|
|
1750
|
+
},
|
|
1751
|
+
"default": "'day'",
|
|
1752
|
+
"description": "The granularity of the time axis.",
|
|
1753
|
+
"attribute": "granularity"
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
"kind": "field",
|
|
1757
|
+
"name": "smoothingWindow",
|
|
1758
|
+
"type": {
|
|
1759
|
+
"text": "number"
|
|
1760
|
+
},
|
|
1761
|
+
"default": "0",
|
|
1762
|
+
"description": "The number of time steps to use for smoothing the data.\n`0` means no smoothing.\nMust be a non-negative integer.\n\nFor a given time, the shown value is the mean of the neighbouring measured values.\nThe `smoothingWindow` value provides the number of neighbouring values to take into account.\nThe resulting time is computed via `Math.floor(smoothingWindow / 2)`.",
|
|
1763
|
+
"attribute": "smoothingWindow"
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
"kind": "field",
|
|
1767
|
+
"name": "views",
|
|
1768
|
+
"type": {
|
|
1769
|
+
"text": "('bar' | 'line' | 'bubble' | 'table')[]"
|
|
1770
|
+
},
|
|
1771
|
+
"default": "['bar', 'line', 'bubble', 'table']",
|
|
1772
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1773
|
+
"attribute": "views"
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
"kind": "field",
|
|
1777
|
+
"name": "confidenceIntervalMethods",
|
|
1778
|
+
"type": {
|
|
1779
|
+
"text": "('wilson' | 'none')[]"
|
|
1780
|
+
},
|
|
1781
|
+
"default": "['wilson']",
|
|
1782
|
+
"description": "A list of methods to calculate the confidence interval.\nThe option `none` is always available and disables confidence intervals.\nPass an empty array to disable the confidence interval selector.",
|
|
1783
|
+
"attribute": "confidenceIntervalMethods"
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
"kind": "field",
|
|
1787
|
+
"name": "headline",
|
|
1788
|
+
"type": {
|
|
1789
|
+
"text": "string | undefined"
|
|
1790
|
+
},
|
|
1791
|
+
"default": "'Prevalence over time'",
|
|
1792
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1793
|
+
"attribute": "headline"
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
"kind": "field",
|
|
1797
|
+
"name": "size",
|
|
1675
1798
|
"type": {
|
|
1676
|
-
"text": "
|
|
1799
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1677
1800
|
},
|
|
1678
1801
|
"default": "undefined",
|
|
1679
|
-
"
|
|
1802
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1803
|
+
"attribute": "size"
|
|
1680
1804
|
}
|
|
1681
1805
|
],
|
|
1682
|
-
"
|
|
1806
|
+
"attributes": [
|
|
1683
1807
|
{
|
|
1808
|
+
"name": "numerator",
|
|
1684
1809
|
"type": {
|
|
1685
|
-
"text": "
|
|
1810
|
+
"text": "(Record<string, string | number | null | boolean> & { displayName: string })\n | (Record<string, string | number | null | boolean> & {\n displayName: string;\n })[]"
|
|
1686
1811
|
},
|
|
1687
|
-
"
|
|
1688
|
-
"
|
|
1812
|
+
"default": "{ displayName: '' }",
|
|
1813
|
+
"description": "Either a single variant or an array of variants to compare.\nThis must be a valid LAPIS filter object with an additional `displayName` property\nwhich will be used as the label for the variant in the views,\nor an array of such objects.",
|
|
1814
|
+
"fieldName": "numerator"
|
|
1689
1815
|
},
|
|
1690
1816
|
{
|
|
1817
|
+
"name": "denominator",
|
|
1691
1818
|
"type": {
|
|
1692
|
-
"text": "
|
|
1819
|
+
"text": "Record<string, string | number | null | boolean> & { displayName: string }"
|
|
1693
1820
|
},
|
|
1694
|
-
"
|
|
1695
|
-
"
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
"attributes": [
|
|
1821
|
+
"default": "{ displayName: '' }",
|
|
1822
|
+
"description": "The variant that the variants in `numerator` are compared to.",
|
|
1823
|
+
"fieldName": "denominator"
|
|
1824
|
+
},
|
|
1699
1825
|
{
|
|
1700
|
-
"name": "
|
|
1826
|
+
"name": "granularity",
|
|
1827
|
+
"type": {
|
|
1828
|
+
"text": "'day' | 'week' | 'month' | 'year'"
|
|
1829
|
+
},
|
|
1830
|
+
"default": "'day'",
|
|
1831
|
+
"description": "The granularity of the time axis.",
|
|
1832
|
+
"fieldName": "granularity"
|
|
1833
|
+
},
|
|
1834
|
+
{
|
|
1835
|
+
"name": "smoothingWindow",
|
|
1836
|
+
"type": {
|
|
1837
|
+
"text": "number"
|
|
1838
|
+
},
|
|
1839
|
+
"default": "0",
|
|
1840
|
+
"description": "The number of time steps to use for smoothing the data.\n`0` means no smoothing.\nMust be a non-negative integer.\n\nFor a given time, the shown value is the mean of the neighbouring measured values.\nThe `smoothingWindow` value provides the number of neighbouring values to take into account.\nThe resulting time is computed via `Math.floor(smoothingWindow / 2)`.",
|
|
1841
|
+
"fieldName": "smoothingWindow"
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
"name": "views",
|
|
1845
|
+
"type": {
|
|
1846
|
+
"text": "('bar' | 'line' | 'bubble' | 'table')[]"
|
|
1847
|
+
},
|
|
1848
|
+
"default": "['bar', 'line', 'bubble', 'table']",
|
|
1849
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1850
|
+
"fieldName": "views"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
"name": "confidenceIntervalMethods",
|
|
1854
|
+
"type": {
|
|
1855
|
+
"text": "('wilson' | 'none')[]"
|
|
1856
|
+
},
|
|
1857
|
+
"default": "['wilson']",
|
|
1858
|
+
"description": "A list of methods to calculate the confidence interval.\nThe option `none` is always available and disables confidence intervals.\nPass an empty array to disable the confidence interval selector.",
|
|
1859
|
+
"fieldName": "confidenceIntervalMethods"
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
"name": "headline",
|
|
1863
|
+
"type": {
|
|
1864
|
+
"text": "string | undefined"
|
|
1865
|
+
},
|
|
1866
|
+
"default": "'Prevalence over time'",
|
|
1867
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1868
|
+
"fieldName": "headline"
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
"name": "size",
|
|
1701
1872
|
"type": {
|
|
1702
|
-
"text": "
|
|
1873
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1703
1874
|
},
|
|
1704
1875
|
"default": "undefined",
|
|
1705
|
-
"
|
|
1876
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
1877
|
+
"fieldName": "size"
|
|
1706
1878
|
}
|
|
1707
1879
|
],
|
|
1708
1880
|
"superclass": {
|
|
1709
|
-
"name": "
|
|
1710
|
-
"module": "/src/web-components/
|
|
1881
|
+
"name": "PreactLitAdapterWithGridJsStyles",
|
|
1882
|
+
"module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
|
|
1711
1883
|
},
|
|
1712
|
-
"tagName": "gs-
|
|
1884
|
+
"tagName": "gs-prevalence-over-time",
|
|
1713
1885
|
"customElement": true
|
|
1714
1886
|
}
|
|
1715
1887
|
],
|
|
1716
1888
|
"exports": [
|
|
1717
1889
|
{
|
|
1718
1890
|
"kind": "js",
|
|
1719
|
-
"name": "
|
|
1891
|
+
"name": "PrevalenceOverTimeComponent",
|
|
1720
1892
|
"declaration": {
|
|
1721
|
-
"name": "
|
|
1722
|
-
"module": "src/web-components/
|
|
1893
|
+
"name": "PrevalenceOverTimeComponent",
|
|
1894
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.tsx"
|
|
1723
1895
|
}
|
|
1724
1896
|
},
|
|
1725
1897
|
{
|
|
1726
1898
|
"kind": "custom-element-definition",
|
|
1727
|
-
"name": "gs-
|
|
1899
|
+
"name": "gs-prevalence-over-time",
|
|
1728
1900
|
"declaration": {
|
|
1729
|
-
"name": "
|
|
1730
|
-
"module": "src/web-components/
|
|
1901
|
+
"name": "PrevalenceOverTimeComponent",
|
|
1902
|
+
"module": "src/web-components/visualization/gs-prevalence-over-time.tsx"
|
|
1731
1903
|
}
|
|
1732
1904
|
}
|
|
1733
1905
|
]
|
|
1734
1906
|
},
|
|
1735
1907
|
{
|
|
1736
1908
|
"kind": "javascript-module",
|
|
1737
|
-
"path": "src/web-components/
|
|
1909
|
+
"path": "src/web-components/visualization/gs-relative-growth-advantage.stories.ts",
|
|
1738
1910
|
"declarations": [
|
|
1739
1911
|
{
|
|
1740
1912
|
"kind": "variable",
|
|
1741
1913
|
"name": "meta",
|
|
1742
1914
|
"type": {
|
|
1743
|
-
"text": "Meta"
|
|
1915
|
+
"text": "Meta<RelativeGrowthAdvantageProps>"
|
|
1744
1916
|
},
|
|
1745
|
-
"default": "{
|
|
1917
|
+
"default": "{ title: 'Visualization/Relative growth advantage', component: 'gs-relative-growth-advantage', argTypes: { numerator: { control: 'object' }, denominator: { control: 'object' }, generationTime: { control: 'number' }, views: { options: ['line'], control: { type: 'check' }, }, size: [{ control: 'object' }], headline: { control: 'text' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1746
1918
|
},
|
|
1747
1919
|
{
|
|
1748
1920
|
"kind": "variable",
|
|
1749
1921
|
"name": "Default",
|
|
1750
1922
|
"type": {
|
|
1751
|
-
"text": "StoryObj<
|
|
1752
|
-
},
|
|
1753
|
-
"default": "{\n render: (args) => {\n return html` <gs-app lapis=\"${LAPIS_URL}\">\n <div class=\"max-w-screen-lg\">\n <gs-text-input\n .lapisField=${args.lapisField}\n .placeholderText=${args.placeholderText}\n .initialValue=${args.initialValue}\n ></gs-text-input>\n </div>\n </gs-app>`;\n },\n args: {\n lapisField: 'host',\n placeholderText: 'Enter host name',\n initialValue: 'Homo sapiens',\n },\n}"
|
|
1754
|
-
},
|
|
1755
|
-
{
|
|
1756
|
-
"kind": "variable",
|
|
1757
|
-
"name": "FiresEvent",
|
|
1758
|
-
"type": {
|
|
1759
|
-
"text": "StoryObj<TextInputProps>"
|
|
1923
|
+
"text": "StoryObj<RelativeGrowthAdvantageProps>"
|
|
1760
1924
|
},
|
|
1761
|
-
"default": "{
|
|
1925
|
+
"default": "{ ...Template, args: { numerator: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01' }, denominator: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01' }, generationTime: 7, views: ['line'], size: { width: '100%', height: '700px' }, headline: 'Relative growth advantage', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numerator', url: AGGREGATED_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01', fields: ['date'], }, }, response: { status: 200, body: numerator, }, }, { matcher: { name: 'denominator', url: AGGREGATED_ENDPOINT, body: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01', fields: ['date'], }, }, response: { status: 200, body: denominator, }, }, ], }, }, }"
|
|
1762
1926
|
}
|
|
1763
1927
|
],
|
|
1764
1928
|
"exports": [
|
|
@@ -1767,7 +1931,7 @@
|
|
|
1767
1931
|
"name": "default",
|
|
1768
1932
|
"declaration": {
|
|
1769
1933
|
"name": "meta",
|
|
1770
|
-
"module": "src/web-components/
|
|
1934
|
+
"module": "src/web-components/visualization/gs-relative-growth-advantage.stories.ts"
|
|
1771
1935
|
}
|
|
1772
1936
|
},
|
|
1773
1937
|
{
|
|
@@ -1775,154 +1939,207 @@
|
|
|
1775
1939
|
"name": "Default",
|
|
1776
1940
|
"declaration": {
|
|
1777
1941
|
"name": "Default",
|
|
1778
|
-
"module": "src/web-components/
|
|
1779
|
-
}
|
|
1780
|
-
},
|
|
1781
|
-
{
|
|
1782
|
-
"kind": "js",
|
|
1783
|
-
"name": "FiresEvent",
|
|
1784
|
-
"declaration": {
|
|
1785
|
-
"name": "FiresEvent",
|
|
1786
|
-
"module": "src/web-components/input/text-input-component.stories.ts"
|
|
1942
|
+
"module": "src/web-components/visualization/gs-relative-growth-advantage.stories.ts"
|
|
1787
1943
|
}
|
|
1788
1944
|
}
|
|
1789
1945
|
]
|
|
1790
1946
|
},
|
|
1791
1947
|
{
|
|
1792
1948
|
"kind": "javascript-module",
|
|
1793
|
-
"path": "src/web-components/
|
|
1949
|
+
"path": "src/web-components/visualization/gs-relative-growth-advantage.tsx",
|
|
1794
1950
|
"declarations": [
|
|
1795
1951
|
{
|
|
1796
1952
|
"kind": "class",
|
|
1797
|
-
"description": "",
|
|
1798
|
-
"name": "
|
|
1953
|
+
"description": "We assume a discrete time model, where new infections happen exactly every `generationTime` days.\nThis is what we call a \"generation\".\n\nThis component estimates the relative growth advantage of a variant by performing a logistic regression.\nBased on the inferred logistic growth rate, we derive the relative growth advantage (per generation).\n\nFor details on the scientific method, see:\nChen, Chaoran, et al. \"Quantification of the spread of SARS-CoV-2 variant B.1.1.7 in Switzerland.\" Epidemics (2021);\ndoi: [10.1016/j.epidem.2021.100480](https://doi.org/10.1016/j.epidem.2021.100480)\n\nThis component fetches aggregated data from LAPIS.\nThen the data is sent to `https://cov-spectrum.org/api/v2/computed/model/chen2021Fitness`\nwhich performs the logistic regression and calculates the relative growth advantage.\n\n## Views\n\n### Line View\n\nThe line view shows the relative growth advantage over time in a line chart.\nThe dots in the plot show the proportions of the focal variant (`numerator`) to the `denominator` variant\nfor every day as observed in the data.\nThe line shows a logistic curve fitted to the data points, including a 95% confidence interval.",
|
|
1954
|
+
"name": "RelativeGrowthAdvantageComponent",
|
|
1799
1955
|
"members": [
|
|
1800
1956
|
{
|
|
1801
1957
|
"kind": "field",
|
|
1802
|
-
"name": "
|
|
1958
|
+
"name": "numerator",
|
|
1803
1959
|
"type": {
|
|
1804
|
-
"text": "string |
|
|
1960
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1805
1961
|
},
|
|
1806
|
-
"default": "
|
|
1807
|
-
"
|
|
1962
|
+
"default": "{}",
|
|
1963
|
+
"description": "The LAPIS filter for the focal variant.",
|
|
1964
|
+
"attribute": "numerator"
|
|
1808
1965
|
},
|
|
1809
1966
|
{
|
|
1810
1967
|
"kind": "field",
|
|
1811
|
-
"name": "
|
|
1968
|
+
"name": "denominator",
|
|
1812
1969
|
"type": {
|
|
1813
|
-
"text": "string"
|
|
1970
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1814
1971
|
},
|
|
1815
|
-
"default": "
|
|
1816
|
-
"
|
|
1972
|
+
"default": "{}",
|
|
1973
|
+
"description": "The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
|
|
1974
|
+
"attribute": "denominator"
|
|
1817
1975
|
},
|
|
1818
1976
|
{
|
|
1819
1977
|
"kind": "field",
|
|
1820
|
-
"name": "
|
|
1978
|
+
"name": "generationTime",
|
|
1979
|
+
"type": {
|
|
1980
|
+
"text": "number"
|
|
1981
|
+
},
|
|
1982
|
+
"default": "7",
|
|
1983
|
+
"description": "The generation time represents the number of days over which the variant's relative growth advantage is measured.\nFor example, if we set a generation time of 7 days, then we estimate the growth advantage per week.",
|
|
1984
|
+
"attribute": "generationTime"
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
"kind": "field",
|
|
1988
|
+
"name": "views",
|
|
1989
|
+
"type": {
|
|
1990
|
+
"text": "'line'[]"
|
|
1991
|
+
},
|
|
1992
|
+
"default": "['line']",
|
|
1993
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1994
|
+
"attribute": "views"
|
|
1995
|
+
},
|
|
1996
|
+
{
|
|
1997
|
+
"kind": "field",
|
|
1998
|
+
"name": "headline",
|
|
1821
1999
|
"type": {
|
|
1822
2000
|
"text": "string | undefined"
|
|
1823
2001
|
},
|
|
1824
|
-
"default": "''",
|
|
1825
|
-
"
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
"events": [
|
|
2002
|
+
"default": "'Relative growth advantage'",
|
|
2003
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2004
|
+
"attribute": "headline"
|
|
2005
|
+
},
|
|
1829
2006
|
{
|
|
2007
|
+
"kind": "field",
|
|
2008
|
+
"name": "size",
|
|
1830
2009
|
"type": {
|
|
1831
|
-
"text": "
|
|
2010
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1832
2011
|
},
|
|
1833
|
-
"
|
|
1834
|
-
"
|
|
2012
|
+
"default": "undefined",
|
|
2013
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
2014
|
+
"attribute": "size"
|
|
1835
2015
|
}
|
|
1836
2016
|
],
|
|
1837
2017
|
"attributes": [
|
|
1838
2018
|
{
|
|
1839
|
-
"name": "
|
|
2019
|
+
"name": "numerator",
|
|
1840
2020
|
"type": {
|
|
1841
|
-
"text": "string |
|
|
2021
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1842
2022
|
},
|
|
1843
|
-
"default": "
|
|
1844
|
-
"
|
|
2023
|
+
"default": "{}",
|
|
2024
|
+
"description": "The LAPIS filter for the focal variant.",
|
|
2025
|
+
"fieldName": "numerator"
|
|
1845
2026
|
},
|
|
1846
2027
|
{
|
|
1847
|
-
"name": "
|
|
2028
|
+
"name": "denominator",
|
|
1848
2029
|
"type": {
|
|
1849
|
-
"text": "string"
|
|
2030
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1850
2031
|
},
|
|
1851
|
-
"default": "
|
|
1852
|
-
"
|
|
2032
|
+
"default": "{}",
|
|
2033
|
+
"description": "The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
|
|
2034
|
+
"fieldName": "denominator"
|
|
1853
2035
|
},
|
|
1854
2036
|
{
|
|
1855
|
-
"name": "
|
|
2037
|
+
"name": "generationTime",
|
|
2038
|
+
"type": {
|
|
2039
|
+
"text": "number"
|
|
2040
|
+
},
|
|
2041
|
+
"default": "7",
|
|
2042
|
+
"description": "The generation time represents the number of days over which the variant's relative growth advantage is measured.\nFor example, if we set a generation time of 7 days, then we estimate the growth advantage per week.",
|
|
2043
|
+
"fieldName": "generationTime"
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
"name": "views",
|
|
2047
|
+
"type": {
|
|
2048
|
+
"text": "'line'[]"
|
|
2049
|
+
},
|
|
2050
|
+
"default": "['line']",
|
|
2051
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
2052
|
+
"fieldName": "views"
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"name": "headline",
|
|
1856
2056
|
"type": {
|
|
1857
2057
|
"text": "string | undefined"
|
|
1858
2058
|
},
|
|
1859
|
-
"default": "''",
|
|
1860
|
-
"
|
|
2059
|
+
"default": "'Relative growth advantage'",
|
|
2060
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2061
|
+
"fieldName": "headline"
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
"name": "size",
|
|
2065
|
+
"type": {
|
|
2066
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
2067
|
+
},
|
|
2068
|
+
"default": "undefined",
|
|
2069
|
+
"description": "The size of the component.\n\nIf not set, the component will take the full width of its container with height 700px.\n\nThe width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.\nIf the unit is %, the size will be relative to the container of the component.",
|
|
2070
|
+
"fieldName": "size"
|
|
1861
2071
|
}
|
|
1862
2072
|
],
|
|
1863
2073
|
"superclass": {
|
|
1864
2074
|
"name": "PreactLitAdapter",
|
|
1865
2075
|
"module": "/src/web-components/PreactLitAdapter"
|
|
1866
2076
|
},
|
|
1867
|
-
"tagName": "gs-
|
|
2077
|
+
"tagName": "gs-relative-growth-advantage",
|
|
1868
2078
|
"customElement": true
|
|
1869
2079
|
}
|
|
1870
2080
|
],
|
|
1871
2081
|
"exports": [
|
|
1872
2082
|
{
|
|
1873
2083
|
"kind": "js",
|
|
1874
|
-
"name": "
|
|
2084
|
+
"name": "RelativeGrowthAdvantageComponent",
|
|
1875
2085
|
"declaration": {
|
|
1876
|
-
"name": "
|
|
1877
|
-
"module": "src/web-components/
|
|
2086
|
+
"name": "RelativeGrowthAdvantageComponent",
|
|
2087
|
+
"module": "src/web-components/visualization/gs-relative-growth-advantage.tsx"
|
|
1878
2088
|
}
|
|
1879
2089
|
},
|
|
1880
2090
|
{
|
|
1881
2091
|
"kind": "custom-element-definition",
|
|
1882
|
-
"name": "gs-
|
|
2092
|
+
"name": "gs-relative-growth-advantage",
|
|
1883
2093
|
"declaration": {
|
|
1884
|
-
"name": "
|
|
1885
|
-
"module": "src/web-components/
|
|
2094
|
+
"name": "RelativeGrowthAdvantageComponent",
|
|
2095
|
+
"module": "src/web-components/visualization/gs-relative-growth-advantage.tsx"
|
|
1886
2096
|
}
|
|
1887
2097
|
}
|
|
1888
2098
|
]
|
|
1889
2099
|
},
|
|
1890
2100
|
{
|
|
1891
2101
|
"kind": "javascript-module",
|
|
1892
|
-
"path": "src/web-components/
|
|
1893
|
-
"declarations": [
|
|
1894
|
-
{
|
|
1895
|
-
"kind": "variable",
|
|
1896
|
-
"name": "lapisContext"
|
|
1897
|
-
}
|
|
1898
|
-
],
|
|
2102
|
+
"path": "src/web-components/visualization/index.ts",
|
|
2103
|
+
"declarations": [],
|
|
1899
2104
|
"exports": [
|
|
1900
2105
|
{
|
|
1901
2106
|
"kind": "js",
|
|
1902
|
-
"name": "
|
|
2107
|
+
"name": "MutationComparisonComponent",
|
|
1903
2108
|
"declaration": {
|
|
1904
|
-
"name": "
|
|
1905
|
-
"module": "
|
|
2109
|
+
"name": "MutationComparisonComponent",
|
|
2110
|
+
"module": "./gs-mutation-comparison"
|
|
1906
2111
|
}
|
|
1907
|
-
}
|
|
1908
|
-
]
|
|
1909
|
-
},
|
|
1910
|
-
{
|
|
1911
|
-
"kind": "javascript-module",
|
|
1912
|
-
"path": "src/web-components/reference-genome-context.ts",
|
|
1913
|
-
"declarations": [
|
|
2112
|
+
},
|
|
1914
2113
|
{
|
|
1915
|
-
"kind": "
|
|
1916
|
-
"name": "
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
2114
|
+
"kind": "js",
|
|
2115
|
+
"name": "MutationsComponent",
|
|
2116
|
+
"declaration": {
|
|
2117
|
+
"name": "MutationsComponent",
|
|
2118
|
+
"module": "./gs-mutations"
|
|
2119
|
+
}
|
|
2120
|
+
},
|
|
1920
2121
|
{
|
|
1921
2122
|
"kind": "js",
|
|
1922
|
-
"name": "
|
|
2123
|
+
"name": "PrevalenceOverTimeComponent",
|
|
1923
2124
|
"declaration": {
|
|
1924
|
-
"name": "
|
|
1925
|
-
"module": "
|
|
2125
|
+
"name": "PrevalenceOverTimeComponent",
|
|
2126
|
+
"module": "./gs-prevalence-over-time"
|
|
2127
|
+
}
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
"kind": "js",
|
|
2131
|
+
"name": "RelativeGrowthAdvantageComponent",
|
|
2132
|
+
"declaration": {
|
|
2133
|
+
"name": "RelativeGrowthAdvantageComponent",
|
|
2134
|
+
"module": "./gs-relative-growth-advantage"
|
|
2135
|
+
}
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
"kind": "js",
|
|
2139
|
+
"name": "AggregateComponent",
|
|
2140
|
+
"declaration": {
|
|
2141
|
+
"name": "AggregateComponent",
|
|
2142
|
+
"module": "./gs-aggregate"
|
|
1926
2143
|
}
|
|
1927
2144
|
}
|
|
1928
2145
|
]
|