@genspectrum/dashboard-components 0.2.0 → 0.3.1

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.
Files changed (59) hide show
  1. package/custom-elements.json +330 -179
  2. package/dist/dashboard-components.js +379 -187
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +160 -114
  5. package/dist/style.css +171 -71
  6. package/package.json +1 -2
  7. package/src/constants.ts +1 -1
  8. package/src/lapisApi/lapisApi.ts +46 -2
  9. package/src/lapisApi/lapisTypes.ts +14 -0
  10. package/src/preact/aggregatedData/aggregate.stories.tsx +4 -2
  11. package/src/preact/aggregatedData/aggregate.tsx +8 -6
  12. package/src/preact/components/error-boundary.stories.tsx +6 -14
  13. package/src/preact/components/error-boundary.tsx +2 -11
  14. package/src/preact/components/error-display.stories.tsx +12 -5
  15. package/src/preact/components/error-display.tsx +37 -3
  16. package/src/preact/components/loading-display.stories.tsx +1 -1
  17. package/src/preact/components/resize-container.tsx +5 -14
  18. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +2 -0
  19. package/src/preact/dateRangeSelector/date-range-selector.tsx +11 -8
  20. package/src/preact/locationFilter/fetchAutocompletionList.ts +15 -1
  21. package/src/preact/locationFilter/location-filter.stories.tsx +1 -1
  22. package/src/preact/locationFilter/location-filter.tsx +16 -30
  23. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +6 -3
  24. package/src/preact/mutationComparison/mutation-comparison.tsx +10 -13
  25. package/src/preact/mutationComparison/queryMutationData.ts +2 -3
  26. package/src/preact/mutationFilter/mutation-filter.stories.tsx +8 -8
  27. package/src/preact/mutationFilter/mutation-filter.tsx +7 -6
  28. package/src/preact/mutations/mutations.stories.tsx +6 -3
  29. package/src/preact/mutations/mutations.tsx +8 -6
  30. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +14 -7
  31. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +10 -8
  32. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +6 -3
  33. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +9 -7
  34. package/src/preact/textInput/text-input.stories.tsx +26 -0
  35. package/src/preact/textInput/text-input.tsx +4 -5
  36. package/src/query/queryPrevalenceOverTime.ts +4 -10
  37. package/src/types.ts +4 -1
  38. package/src/web-components/ResizeContainer.mdx +13 -0
  39. package/src/web-components/app.ts +3 -1
  40. package/src/web-components/input/gs-date-range-selector.stories.ts +10 -2
  41. package/src/web-components/input/gs-date-range-selector.tsx +26 -16
  42. package/src/web-components/input/gs-location-filter.stories.ts +5 -7
  43. package/src/web-components/input/gs-location-filter.tsx +6 -7
  44. package/src/web-components/input/gs-mutation-filter.stories.ts +11 -8
  45. package/src/web-components/input/gs-mutation-filter.tsx +38 -26
  46. package/src/web-components/input/gs-text-input.stories.ts +3 -3
  47. package/src/web-components/input/gs-text-input.tsx +10 -10
  48. package/src/web-components/input/introduction.mdx +11 -0
  49. package/src/web-components/introduction.mdx +15 -0
  50. package/src/web-components/visualization/gs-aggregate.stories.ts +19 -6
  51. package/src/web-components/visualization/gs-aggregate.tsx +31 -15
  52. package/src/web-components/visualization/gs-mutation-comparison.stories.ts +13 -7
  53. package/src/web-components/visualization/gs-mutation-comparison.tsx +26 -17
  54. package/src/web-components/visualization/gs-mutations.stories.ts +14 -8
  55. package/src/web-components/visualization/gs-mutations.tsx +18 -8
  56. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +28 -18
  57. package/src/web-components/visualization/gs-prevalence-over-time.tsx +45 -22
  58. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +11 -5
  59. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +21 -9
@@ -54,6 +54,12 @@
54
54
  }
55
55
  ]
56
56
  },
57
+ {
58
+ "kind": "javascript-module",
59
+ "path": "src/web-components/ResizeContainer.mdx",
60
+ "declarations": [],
61
+ "exports": []
62
+ },
57
63
  {
58
64
  "kind": "javascript-module",
59
65
  "path": "src/web-components/app.stories.ts",
@@ -179,7 +185,7 @@
179
185
  "text": "string"
180
186
  },
181
187
  "default": "''",
182
- "description": "The URL of the LAPIS instance that all children of this component will use.",
188
+ "description": "Required.\n\nThe URL of the LAPIS instance that all children of this component will use.",
183
189
  "attribute": "lapis"
184
190
  }
185
191
  ],
@@ -190,7 +196,7 @@
190
196
  "text": "string"
191
197
  },
192
198
  "default": "''",
193
- "description": "The URL of the LAPIS instance that all children of this component will use.",
199
+ "description": "Required.\n\nThe URL of the LAPIS instance that all children of this component will use.",
194
200
  "fieldName": "lapis"
195
201
  }
196
202
  ],
@@ -260,17 +266,17 @@
260
266
  "kind": "variable",
261
267
  "name": "meta",
262
268
  "type": {
263
- "text": "Meta<DateRangeSelectorProps<'CustomDateRange'>>"
269
+ "text": "Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>>"
264
270
  },
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'], }"
271
+ "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', ], }, dateColumn: { control: { type: 'text' } }, 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, dateColumn: 'aDateColumn', width: '100%', }, decorators: [withActions], tags: ['autodocs'], }"
266
272
  },
267
273
  {
268
274
  "kind": "variable",
269
275
  "name": "DateRangeSelectorStory",
270
276
  "type": {
271
- "text": "StoryObj<DateRangeSelectorProps<'CustomDateRange'>>"
277
+ "text": "StoryObj<Required<DateRangeSelectorProps<'CustomDateRange'>>>"
272
278
  },
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())); }); }); }, }"
279
+ "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} .dateColumn=${args.dateColumn} ></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())); }); }); // Due to the limitations of storybook testing which does not fire an event, // when selecting a value from the dropdown we can't test the fired event here. // An e2e test (using playwright) for that can be found in tests/dateRangeSelector.spec.ts }, }"
274
280
  }
275
281
  ],
276
282
  "exports": [
@@ -298,7 +304,7 @@
298
304
  "declarations": [
299
305
  {
300
306
  "kind": "class",
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.",
307
+ "description": "## Context\nThis component is a group of input fields designed to specify date range filters\nfor a given date column of this Lapis instance. 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
308
  "name": "DateRangeSelectorComponent",
303
309
  "members": [
304
310
  {
@@ -315,7 +321,7 @@
315
321
  "kind": "field",
316
322
  "name": "earliestDate",
317
323
  "type": {
318
- "text": "string | undefined"
324
+ "text": "string"
319
325
  },
320
326
  "default": "'1900-01-01'",
321
327
  "description": "The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.",
@@ -325,7 +331,7 @@
325
331
  "kind": "field",
326
332
  "name": "initialValue",
327
333
  "type": {
328
- "text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string\n | undefined"
334
+ "text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string"
329
335
  },
330
336
  "default": "'last6Months'",
331
337
  "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'`.",
@@ -335,19 +341,29 @@
335
341
  "kind": "field",
336
342
  "name": "width",
337
343
  "type": {
338
- "text": "string | undefined"
344
+ "text": "string"
339
345
  },
340
- "default": "undefined",
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.",
346
+ "default": "'100%'",
347
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
342
348
  "attribute": "width"
349
+ },
350
+ {
351
+ "kind": "field",
352
+ "name": "dateColumn",
353
+ "type": {
354
+ "text": "string"
355
+ },
356
+ "default": "'date'",
357
+ "description": "The name of the column in LAPIS that contains the date information.",
358
+ "attribute": "dateColumn"
343
359
  }
344
360
  ],
345
361
  "events": [
346
362
  {
347
363
  "type": {
348
- "text": "CustomEvent<{ dateFrom: string; dateTo: string; }>"
364
+ "text": "CustomEvent<{ `${dateColumn}From`: string; `${dateColumn}To`: string; }>"
349
365
  },
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`.",
366
+ "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`. Example: For `dateColumn = yourDate`, an event with `detail` containing ``` { yourDataFrom: \"2021-01-01\", yourDataTo: \"2021-12-31\" } ``` will be fired.",
351
367
  "name": "gs-date-range-changed"
352
368
  }
353
369
  ],
@@ -364,7 +380,7 @@
364
380
  {
365
381
  "name": "earliestDate",
366
382
  "type": {
367
- "text": "string | undefined"
383
+ "text": "string"
368
384
  },
369
385
  "default": "'1900-01-01'",
370
386
  "description": "The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.",
@@ -373,7 +389,7 @@
373
389
  {
374
390
  "name": "initialValue",
375
391
  "type": {
376
- "text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string\n | undefined"
392
+ "text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string"
377
393
  },
378
394
  "default": "'last6Months'",
379
395
  "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'`.",
@@ -382,11 +398,20 @@
382
398
  {
383
399
  "name": "width",
384
400
  "type": {
385
- "text": "string | undefined"
401
+ "text": "string"
386
402
  },
387
- "default": "undefined",
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.",
403
+ "default": "'100%'",
404
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
389
405
  "fieldName": "width"
406
+ },
407
+ {
408
+ "name": "dateColumn",
409
+ "type": {
410
+ "text": "string"
411
+ },
412
+ "default": "'date'",
413
+ "description": "The name of the column in LAPIS that contains the date information.",
414
+ "fieldName": "dateColumn"
390
415
  }
391
416
  ],
392
417
  "superclass": {
@@ -450,7 +475,7 @@
450
475
  "type": {
451
476
  "text": "StoryObj<LocationFilterProps>"
452
477
  },
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(), ); }, }"
478
+ "default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 400, body: { error: { status: 400, detail: 'Dummy error message from mock LAPIS', type: 'about:blank' }, }, }, }, ], }, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter'); await waitFor(() => expect(canvas.getByText('Oops! Something went wrong.', { exact: false })).toBeInTheDocument(), ); }, }"
454
479
  },
455
480
  {
456
481
  "kind": "variable",
@@ -458,7 +483,7 @@
458
483
  "type": {
459
484
  "text": "StoryObj<LocationFilterProps>"
460
485
  },
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', }, }), ); }); }, }"
486
+ "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 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 expect(listenerMock).not.toHaveBeenCalled(); await userEvent.type(inputField(), '{backspace>18/}'); }); await step('Select Asia', async () => { await userEvent.type(inputField(), 'Asia'); 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 expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { region: 'Asia', country: 'Bangladesh', division: 'Rajshahi', location: 'Chapainawabgonj', }, }), ); }); }, }"
462
487
  }
463
488
  ],
464
489
  "exports": [
@@ -530,17 +555,17 @@
530
555
  "text": "string[]"
531
556
  },
532
557
  "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']`).",
558
+ "description": "Required.\n\nThe 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
559
  "attribute": "fields"
535
560
  },
536
561
  {
537
562
  "kind": "field",
538
563
  "name": "width",
539
564
  "type": {
540
- "text": "string | undefined"
565
+ "text": "string"
541
566
  },
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.",
567
+ "default": "'100%'",
568
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
544
569
  "attribute": "width"
545
570
  }
546
571
  ],
@@ -549,7 +574,7 @@
549
574
  "type": {
550
575
  "text": "CustomEvent<Record<string, string>>"
551
576
  },
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\" } ```",
577
+ "description": "Fired when a value from the datalist is selected or when a valid value is typed into the field. 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
578
  "name": "gs-location-changed"
554
579
  }
555
580
  ],
@@ -569,16 +594,16 @@
569
594
  "text": "string[]"
570
595
  },
571
596
  "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']`).",
597
+ "description": "Required.\n\nThe 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
598
  "fieldName": "fields"
574
599
  },
575
600
  {
576
601
  "name": "width",
577
602
  "type": {
578
- "text": "string | undefined"
603
+ "text": "string"
579
604
  },
580
- "default": "undefined",
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.",
605
+ "default": "'100%'",
606
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
582
607
  "fieldName": "width"
583
608
  }
584
609
  ],
@@ -619,7 +644,7 @@
619
644
  "type": {
620
645
  "text": "Meta<MutationFilterProps>"
621
646
  },
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'], }"
647
+ "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', }, }, width: { control: 'text' }, height: { control: 'text' }, }, decorators: [withActions], tags: ['autodocs'], }"
623
648
  },
624
649
  {
625
650
  "kind": "variable",
@@ -687,28 +712,38 @@
687
712
  "declarations": [
688
713
  {
689
714
  "kind": "class",
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",
715
+ "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\n## Input Validation\n\nValidation of the input is performed according to the following rules:\n\n### Mutations\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\nExamples: `S:614G`, `614G`, `614-`, `614G`\n\n### Insertions\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\nExamples: `ins_S:614:G`, `ins_614:G`",
691
716
  "name": "MutationFilterComponent",
692
717
  "members": [
693
718
  {
694
719
  "kind": "field",
695
720
  "name": "initialValue",
696
721
  "type": {
697
- "text": "{\n nucleotideMutations: string[];\n aminoAcidMutations: string[];\n nucleotideInsertions: string[];\n aminoAcidInsertions: string[];\n }\n | string[]\n | undefined"
722
+ "text": "{\n nucleotideMutations: string[];\n aminoAcidMutations: string[];\n nucleotideInsertions: string[];\n aminoAcidInsertions: string[];\n }\n | string[]\n | undefined"
698
723
  },
699
724
  "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.",
725
+ "description": "The initial value to use for this mutation filter.\nAll values provided must be valid mutations or insertions.\nInvalid values will be ignored.",
701
726
  "attribute": "initialValue"
702
727
  },
703
728
  {
704
729
  "kind": "field",
705
- "name": "size",
730
+ "name": "width",
706
731
  "type": {
707
- "text": "{ width?: string; height?: string } | undefined"
732
+ "text": "string"
708
733
  },
709
- "default": "undefined",
710
- "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.",
711
- "attribute": "size"
734
+ "default": "'100%'",
735
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
736
+ "attribute": "width"
737
+ },
738
+ {
739
+ "kind": "field",
740
+ "name": "height",
741
+ "type": {
742
+ "text": "string"
743
+ },
744
+ "default": "'6.5rem'",
745
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
746
+ "attribute": "height"
712
747
  }
713
748
  ],
714
749
  "events": [
@@ -731,20 +766,29 @@
731
766
  {
732
767
  "name": "initialValue",
733
768
  "type": {
734
- "text": "{\n nucleotideMutations: string[];\n aminoAcidMutations: string[];\n nucleotideInsertions: string[];\n aminoAcidInsertions: string[];\n }\n | string[]\n | undefined"
769
+ "text": "{\n nucleotideMutations: string[];\n aminoAcidMutations: string[];\n nucleotideInsertions: string[];\n aminoAcidInsertions: string[];\n }\n | string[]\n | undefined"
735
770
  },
736
771
  "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.",
772
+ "description": "The initial value to use for this mutation filter.\nAll values provided must be valid mutations or insertions.\nInvalid values will be ignored.",
738
773
  "fieldName": "initialValue"
739
774
  },
740
775
  {
741
- "name": "size",
776
+ "name": "width",
742
777
  "type": {
743
- "text": "{ width?: string; height?: string } | undefined"
778
+ "text": "string"
744
779
  },
745
- "default": "undefined",
746
- "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.",
747
- "fieldName": "size"
780
+ "default": "'100%'",
781
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
782
+ "fieldName": "width"
783
+ },
784
+ {
785
+ "name": "height",
786
+ "type": {
787
+ "text": "string"
788
+ },
789
+ "default": "'6.5rem'",
790
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
791
+ "fieldName": "height"
748
792
  }
749
793
  ],
750
794
  "superclass": {
@@ -782,7 +826,7 @@
782
826
  "kind": "variable",
783
827
  "name": "meta",
784
828
  "type": {
785
- "text": "Meta<TextInputProps>"
829
+ "text": "Meta<Required<TextInputProps>>"
786
830
  },
787
831
  "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'], }"
788
832
  },
@@ -790,7 +834,7 @@
790
834
  "kind": "variable",
791
835
  "name": "Default",
792
836
  "type": {
793
- "text": "StoryObj<TextInputProps>"
837
+ "text": "StoryObj<Required<TextInputProps>>"
794
838
  },
795
839
  "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%', }, }"
796
840
  },
@@ -798,7 +842,7 @@
798
842
  "kind": "variable",
799
843
  "name": "FiresEvent",
800
844
  "type": {
801
- "text": "StoryObj<TextInputProps>"
845
+ "text": "StoryObj<Required<TextInputProps>>"
802
846
  },
803
847
  "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: '', }, }"
804
848
  }
@@ -836,14 +880,14 @@
836
880
  "declarations": [
837
881
  {
838
882
  "kind": "class",
839
- "description": "\n## Context\n\nThis component provides a text input field to specify filters for arbitrary fields of this Lapis instance.",
883
+ "description": "\n## Context\n\nThis component provides a text input field to specify filters for arbitrary fields of this LAPIS instance.",
840
884
  "name": "TextInputComponent",
841
885
  "members": [
842
886
  {
843
887
  "kind": "field",
844
888
  "name": "initialValue",
845
889
  "type": {
846
- "text": "string | undefined"
890
+ "text": "string"
847
891
  },
848
892
  "default": "''",
849
893
  "description": "The initial value to use for this text input.",
@@ -856,14 +900,14 @@
856
900
  "text": "string"
857
901
  },
858
902
  "default": "''",
859
- "description": "The Lapis field name to use for this text input.",
903
+ "description": "Required.\n\nThe LAPIS field name to use for this text input.\nThe field must exist on this LAPIS instance.",
860
904
  "attribute": "lapisField"
861
905
  },
862
906
  {
863
907
  "kind": "field",
864
908
  "name": "placeholderText",
865
909
  "type": {
866
- "text": "string | undefined"
910
+ "text": "string"
867
911
  },
868
912
  "default": "''",
869
913
  "description": "The placeholder text to display in the input field.",
@@ -873,10 +917,10 @@
873
917
  "kind": "field",
874
918
  "name": "width",
875
919
  "type": {
876
- "text": "string | undefined"
920
+ "text": "string"
877
921
  },
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.",
922
+ "default": "'100%'",
923
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
880
924
  "attribute": "width"
881
925
  }
882
926
  ],
@@ -893,7 +937,7 @@
893
937
  {
894
938
  "name": "initialValue",
895
939
  "type": {
896
- "text": "string | undefined"
940
+ "text": "string"
897
941
  },
898
942
  "default": "''",
899
943
  "description": "The initial value to use for this text input.",
@@ -905,13 +949,13 @@
905
949
  "text": "string"
906
950
  },
907
951
  "default": "''",
908
- "description": "The Lapis field name to use for this text input.",
952
+ "description": "Required.\n\nThe LAPIS field name to use for this text input.\nThe field must exist on this LAPIS instance.",
909
953
  "fieldName": "lapisField"
910
954
  },
911
955
  {
912
956
  "name": "placeholderText",
913
957
  "type": {
914
- "text": "string | undefined"
958
+ "text": "string"
915
959
  },
916
960
  "default": "''",
917
961
  "description": "The placeholder text to display in the input field.",
@@ -920,10 +964,10 @@
920
964
  {
921
965
  "name": "width",
922
966
  "type": {
923
- "text": "string | undefined"
967
+ "text": "string"
924
968
  },
925
- "default": "undefined",
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.",
969
+ "default": "'100%'",
970
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
927
971
  "fieldName": "width"
928
972
  }
929
973
  ],
@@ -993,6 +1037,18 @@
993
1037
  }
994
1038
  ]
995
1039
  },
1040
+ {
1041
+ "kind": "javascript-module",
1042
+ "path": "src/web-components/input/introduction.mdx",
1043
+ "declarations": [],
1044
+ "exports": []
1045
+ },
1046
+ {
1047
+ "kind": "javascript-module",
1048
+ "path": "src/web-components/introduction.mdx",
1049
+ "declarations": [],
1050
+ "exports": []
1051
+ },
996
1052
  {
997
1053
  "kind": "javascript-module",
998
1054
  "path": "src/web-components/lapis-context.ts",
@@ -1047,17 +1103,17 @@
1047
1103
  "kind": "variable",
1048
1104
  "name": "meta",
1049
1105
  "type": {
1050
- "text": "Meta<AggregateProps>"
1106
+ "text": "Meta<Required<AggregateProps>>"
1051
1107
  },
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'], }"
1108
+ "default": "{ title: 'Visualization/Aggregate', component: 'gs-aggregate', argTypes: { fields: [{ control: 'object' }], views: { options: ['table'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, 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, }, }), tags: ['autodocs'], }"
1053
1109
  },
1054
1110
  {
1055
1111
  "kind": "variable",
1056
1112
  "name": "Table",
1057
1113
  "type": {
1058
- "text": "StoryObj<AggregateProps>"
1114
+ "text": "StoryObj<Required<AggregateProps>>"
1059
1115
  },
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', }, }"
1116
+ "default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <gs-aggregate .fields=${args.fields} .filter=${args.filter} .views=${args.views} .width=${args.width} .height=${args.height} .headline=${args.headline} ></gs-aggregate> </gs-app> `, args: { fields: ['division', 'host'], views: ['table'], filter: { country: 'USA', }, width: '100%', height: '700px', headline: 'Aggregate', }, }"
1061
1117
  }
1062
1118
  ],
1063
1119
  "exports": [
@@ -1085,7 +1141,7 @@
1085
1141
  "declarations": [
1086
1142
  {
1087
1143
  "kind": "class",
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.",
1144
+ "description": "## Context\n\nThis component displays aggregated data in a table, 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.\n\n## Views\n\n### Table View\n\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).",
1089
1145
  "name": "AggregateComponent",
1090
1146
  "members": [
1091
1147
  {
@@ -1095,7 +1151,7 @@
1095
1151
  "text": "string[]"
1096
1152
  },
1097
1153
  "default": "[]",
1098
- "description": "The fields to aggregate by.",
1154
+ "description": "The fields to aggregate by.\nEvery field will be a table column.\nEvery field must exist in the backing LAPIS instance.\n\nIf left empty, the component will only show the absolute count of the provided `filter` and proportion `100%`.",
1099
1155
  "attribute": "fields"
1100
1156
  },
1101
1157
  {
@@ -1105,7 +1161,7 @@
1105
1161
  "text": "View[]"
1106
1162
  },
1107
1163
  "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).",
1164
+ "description": "A list of tabs with views that this component should provide.",
1109
1165
  "attribute": "views"
1110
1166
  },
1111
1167
  {
@@ -1115,24 +1171,34 @@
1115
1171
  "text": "LapisFilter"
1116
1172
  },
1117
1173
  "default": "{}",
1118
- "description": "The filter to apply to the data.",
1174
+ "description": "The filter to apply to the data.\nIt must be a valid LAPIS filter object.",
1119
1175
  "attribute": "filter"
1120
1176
  },
1121
1177
  {
1122
1178
  "kind": "field",
1123
- "name": "size",
1179
+ "name": "width",
1124
1180
  "type": {
1125
- "text": "{ width?: string; height?: string } | undefined"
1181
+ "text": "string"
1126
1182
  },
1127
- "default": "undefined",
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.",
1129
- "attribute": "size"
1183
+ "default": "'100%'",
1184
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1185
+ "attribute": "width"
1186
+ },
1187
+ {
1188
+ "kind": "field",
1189
+ "name": "height",
1190
+ "type": {
1191
+ "text": "string"
1192
+ },
1193
+ "default": "'700px'",
1194
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1195
+ "attribute": "height"
1130
1196
  },
1131
1197
  {
1132
1198
  "kind": "field",
1133
1199
  "name": "headline",
1134
1200
  "type": {
1135
- "text": "string | undefined"
1201
+ "text": "string"
1136
1202
  },
1137
1203
  "default": "'Aggregate'",
1138
1204
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -1146,7 +1212,7 @@
1146
1212
  "text": "string[]"
1147
1213
  },
1148
1214
  "default": "[]",
1149
- "description": "The fields to aggregate by.",
1215
+ "description": "The fields to aggregate by.\nEvery field will be a table column.\nEvery field must exist in the backing LAPIS instance.\n\nIf left empty, the component will only show the absolute count of the provided `filter` and proportion `100%`.",
1150
1216
  "fieldName": "fields"
1151
1217
  },
1152
1218
  {
@@ -1155,7 +1221,7 @@
1155
1221
  "text": "View[]"
1156
1222
  },
1157
1223
  "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).",
1224
+ "description": "A list of tabs with views that this component should provide.",
1159
1225
  "fieldName": "views"
1160
1226
  },
1161
1227
  {
@@ -1164,22 +1230,31 @@
1164
1230
  "text": "LapisFilter"
1165
1231
  },
1166
1232
  "default": "{}",
1167
- "description": "The filter to apply to the data.",
1233
+ "description": "The filter to apply to the data.\nIt must be a valid LAPIS filter object.",
1168
1234
  "fieldName": "filter"
1169
1235
  },
1170
1236
  {
1171
- "name": "size",
1237
+ "name": "width",
1172
1238
  "type": {
1173
- "text": "{ width?: string; height?: string } | undefined"
1239
+ "text": "string"
1174
1240
  },
1175
- "default": "undefined",
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.",
1177
- "fieldName": "size"
1241
+ "default": "'100%'",
1242
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1243
+ "fieldName": "width"
1244
+ },
1245
+ {
1246
+ "name": "height",
1247
+ "type": {
1248
+ "text": "string"
1249
+ },
1250
+ "default": "'700px'",
1251
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1252
+ "fieldName": "height"
1178
1253
  },
1179
1254
  {
1180
1255
  "name": "headline",
1181
1256
  "type": {
1182
- "text": "string | undefined"
1257
+ "text": "string"
1183
1258
  },
1184
1259
  "default": "'Aggregate'",
1185
1260
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -1221,23 +1296,23 @@
1221
1296
  "kind": "variable",
1222
1297
  "name": "meta",
1223
1298
  "type": {
1224
- "text": "Meta<MutationComparisonProps>"
1299
+ "text": "Meta<Required<MutationComparisonProps>>"
1225
1300
  },
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'], }"
1301
+ "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' }, }, width: { control: 'text' }, height: { control: 'text' }, headline: { control: 'text' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
1227
1302
  },
1228
1303
  {
1229
1304
  "kind": "variable",
1230
1305
  "name": "Default",
1231
1306
  "type": {
1232
- "text": "StoryObj<MutationComparisonProps>"
1307
+ "text": "StoryObj<Required<MutationComparisonProps>>"
1233
1308
  },
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)); }); }, }"
1309
+ "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'], 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
1310
  },
1236
1311
  {
1237
1312
  "kind": "variable",
1238
1313
  "name": "VennDiagram",
1239
1314
  "type": {
1240
- "text": "StoryObj<MutationComparisonProps>"
1315
+ "text": "StoryObj<Required<MutationComparisonProps>>"
1241
1316
  },
1242
1317
  "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(), ); }); }, }"
1243
1318
  }
@@ -1275,7 +1350,7 @@
1275
1350
  "declarations": [
1276
1351
  {
1277
1352
  "kind": "class",
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\".",
1353
+ "description": "## Context\n\nThis 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
1354
  "name": "MutationComparisonComponent",
1280
1355
  "members": [
1281
1356
  {
@@ -1285,7 +1360,7 @@
1285
1360
  "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
1286
1361
  },
1287
1362
  "default": "[]",
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.",
1363
+ "description": "Required.\n\nAn 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
1364
  "attribute": "variants"
1290
1365
  },
1291
1366
  {
@@ -1310,19 +1385,29 @@
1310
1385
  },
1311
1386
  {
1312
1387
  "kind": "field",
1313
- "name": "size",
1388
+ "name": "width",
1389
+ "type": {
1390
+ "text": "string"
1391
+ },
1392
+ "default": "'100%'",
1393
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1394
+ "attribute": "width"
1395
+ },
1396
+ {
1397
+ "kind": "field",
1398
+ "name": "height",
1314
1399
  "type": {
1315
- "text": "{ width?: string; height?: string } | undefined"
1400
+ "text": "string"
1316
1401
  },
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"
1402
+ "default": "'700px'",
1403
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1404
+ "attribute": "height"
1320
1405
  },
1321
1406
  {
1322
1407
  "kind": "field",
1323
1408
  "name": "headline",
1324
1409
  "type": {
1325
- "text": "string | undefined"
1410
+ "text": "string"
1326
1411
  },
1327
1412
  "default": "'Mutation comparison'",
1328
1413
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -1336,7 +1421,7 @@
1336
1421
  "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
1337
1422
  },
1338
1423
  "default": "[]",
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.",
1424
+ "description": "Required.\n\nAn 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
1425
  "fieldName": "variants"
1341
1426
  },
1342
1427
  {
@@ -1358,18 +1443,27 @@
1358
1443
  "fieldName": "views"
1359
1444
  },
1360
1445
  {
1361
- "name": "size",
1446
+ "name": "width",
1447
+ "type": {
1448
+ "text": "string"
1449
+ },
1450
+ "default": "'100%'",
1451
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1452
+ "fieldName": "width"
1453
+ },
1454
+ {
1455
+ "name": "height",
1362
1456
  "type": {
1363
- "text": "{ width?: string; height?: string } | undefined"
1457
+ "text": "string"
1364
1458
  },
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"
1459
+ "default": "'700px'",
1460
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1461
+ "fieldName": "height"
1368
1462
  },
1369
1463
  {
1370
1464
  "name": "headline",
1371
1465
  "type": {
1372
- "text": "string | undefined"
1466
+ "text": "string"
1373
1467
  },
1374
1468
  "default": "'Mutation comparison'",
1375
1469
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -1411,15 +1505,15 @@
1411
1505
  "kind": "variable",
1412
1506
  "name": "meta",
1413
1507
  "type": {
1414
- "text": "Meta<MutationsProps>"
1508
+ "text": "Meta<Required<MutationsProps>>"
1415
1509
  },
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'], }"
1510
+ "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' }, }, width: { control: 'text' }, height: { control: 'text' }, headline: { control: 'text' }, }, args: { variant: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' }, sequenceType: 'nucleotide', views: ['grid', 'table', 'insertions'], width: '100%', height: '700px', headline: 'Mutations', }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
1417
1511
  },
1418
1512
  {
1419
1513
  "kind": "variable",
1420
1514
  "name": "Default",
1421
1515
  "type": {
1422
- "text": "StoryObj<MutationsProps>"
1516
+ "text": "StoryObj<Required<MutationsProps>>"
1423
1517
  },
1424
1518
  "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, }, }, ], }, }, }"
1425
1519
  },
@@ -1427,7 +1521,7 @@
1427
1521
  "kind": "variable",
1428
1522
  "name": "OnTableTab",
1429
1523
  "type": {
1430
- "text": "StoryObj<MutationsProps>"
1524
+ "text": "StoryObj<Required<MutationsProps>>"
1431
1525
  },
1432
1526
  "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' })); }, }"
1433
1527
  },
@@ -1435,7 +1529,7 @@
1435
1529
  "kind": "variable",
1436
1530
  "name": "OnInsertionsTab",
1437
1531
  "type": {
1438
- "text": "StoryObj<MutationsProps>"
1532
+ "text": "StoryObj<Required<MutationsProps>>"
1439
1533
  },
1440
1534
  "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' })); }, }"
1441
1535
  }
@@ -1481,7 +1575,7 @@
1481
1575
  "declarations": [
1482
1576
  {
1483
1577
  "kind": "class",
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.",
1578
+ "description": "## Context\n\nThis 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
1579
  "name": "MutationsComponent",
1486
1580
  "members": [
1487
1581
  {
@@ -1491,7 +1585,7 @@
1491
1585
  "text": "Record<string, string | number | null | boolean>"
1492
1586
  },
1493
1587
  "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.",
1588
+ "description": "Required.\n\nThe `variant` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.",
1495
1589
  "attribute": "variant"
1496
1590
  },
1497
1591
  {
@@ -1516,19 +1610,29 @@
1516
1610
  },
1517
1611
  {
1518
1612
  "kind": "field",
1519
- "name": "size",
1613
+ "name": "width",
1614
+ "type": {
1615
+ "text": "string"
1616
+ },
1617
+ "default": "'100%'",
1618
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1619
+ "attribute": "width"
1620
+ },
1621
+ {
1622
+ "kind": "field",
1623
+ "name": "height",
1520
1624
  "type": {
1521
- "text": "{ width?: string; height?: string } | undefined"
1625
+ "text": "string"
1522
1626
  },
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"
1627
+ "default": "'700px'",
1628
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1629
+ "attribute": "height"
1526
1630
  },
1527
1631
  {
1528
1632
  "kind": "field",
1529
1633
  "name": "headline",
1530
1634
  "type": {
1531
- "text": "string | undefined"
1635
+ "text": "string"
1532
1636
  },
1533
1637
  "default": "'Mutations'",
1534
1638
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -1542,7 +1646,7 @@
1542
1646
  "text": "Record<string, string | number | null | boolean>"
1543
1647
  },
1544
1648
  "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.",
1649
+ "description": "Required.\n\nThe `variant` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.",
1546
1650
  "fieldName": "variant"
1547
1651
  },
1548
1652
  {
@@ -1564,18 +1668,27 @@
1564
1668
  "fieldName": "views"
1565
1669
  },
1566
1670
  {
1567
- "name": "size",
1671
+ "name": "width",
1672
+ "type": {
1673
+ "text": "string"
1674
+ },
1675
+ "default": "'100%'",
1676
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1677
+ "fieldName": "width"
1678
+ },
1679
+ {
1680
+ "name": "height",
1568
1681
  "type": {
1569
- "text": "{ width?: string; height?: string } | undefined"
1682
+ "text": "string"
1570
1683
  },
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"
1684
+ "default": "'700px'",
1685
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1686
+ "fieldName": "height"
1574
1687
  },
1575
1688
  {
1576
1689
  "name": "headline",
1577
1690
  "type": {
1578
- "text": "string | undefined"
1691
+ "text": "string"
1579
1692
  },
1580
1693
  "default": "'Mutations'",
1581
1694
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -1617,31 +1730,31 @@
1617
1730
  "kind": "variable",
1618
1731
  "name": "meta",
1619
1732
  "type": {
1620
- "text": "Meta<PrevalenceOverTimeProps>"
1733
+ "text": "Meta<Required<PrevalenceOverTimeProps>>"
1621
1734
  },
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'], }"
1735
+ "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' }, }, width: { control: 'text' }, height: { control: 'text' }, headline: { control: 'text' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
1623
1736
  },
1624
1737
  {
1625
1738
  "kind": "variable",
1626
1739
  "name": "TwoVariants",
1627
1740
  "type": {
1628
- "text": "StoryObj<PrevalenceOverTimeProps>"
1741
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
1629
1742
  },
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, }, }, ], }, }, }"
1743
+ "default": "{ ...Template, args: { numerator: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' } }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], denominator: { country: 'USA', dateFrom: '2023-01-01' }, granularity: 'month', smoothingWindow: 0, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], 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, }, }, ], }, }, }"
1631
1744
  },
1632
1745
  {
1633
1746
  "kind": "variable",
1634
1747
  "name": "OneVariant",
1635
1748
  "type": {
1636
- "text": "StoryObj<PrevalenceOverTimeProps>"
1749
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
1637
1750
  },
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, }, }, ], }, }, }"
1751
+ "default": "{ ...Template, args: { numerator: { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' }, }, denominator: { country: 'USA', dateFrom: '2023-10-01' }, granularity: 'day', smoothingWindow: 7, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], 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, }, }, ], }, }, }"
1639
1752
  },
1640
1753
  {
1641
1754
  "kind": "variable",
1642
1755
  "name": "OneVariantOnLineTab",
1643
1756
  "type": {
1644
- "text": "StoryObj<PrevalenceOverTimeProps>"
1757
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
1645
1758
  },
1646
1759
  "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
1760
  },
@@ -1649,7 +1762,7 @@
1649
1762
  "kind": "variable",
1650
1763
  "name": "OneVariantOnBubbleTab",
1651
1764
  "type": {
1652
- "text": "StoryObj<PrevalenceOverTimeProps>"
1765
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
1653
1766
  },
1654
1767
  "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
1768
  },
@@ -1657,7 +1770,7 @@
1657
1770
  "kind": "variable",
1658
1771
  "name": "OneVariantOnTableTab",
1659
1772
  "type": {
1660
- "text": "StoryObj<PrevalenceOverTimeProps>"
1773
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
1661
1774
  },
1662
1775
  "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' })); }, }"
1663
1776
  }
@@ -1719,27 +1832,27 @@
1719
1832
  "declarations": [
1720
1833
  {
1721
1834
  "kind": "class",
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.",
1835
+ "description": "## Context\n\nThis 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
1836
  "name": "PrevalenceOverTimeComponent",
1724
1837
  "members": [
1725
1838
  {
1726
1839
  "kind": "field",
1727
1840
  "name": "numerator",
1728
1841
  "type": {
1729
- "text": "(Record<string, string | number | null | boolean> & { displayName: string })\n | (Record<string, string | number | null | boolean> & {\n displayName: string;\n })[]"
1842
+ "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
1730
1843
  },
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.",
1844
+ "default": "{ displayName: '', lapisFilter: {} }",
1845
+ "description": "Required.\n\nEither 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
1846
  "attribute": "numerator"
1734
1847
  },
1735
1848
  {
1736
1849
  "kind": "field",
1737
1850
  "name": "denominator",
1738
1851
  "type": {
1739
- "text": "Record<string, string | number | null | boolean> & { displayName: string }"
1852
+ "text": "Record<string, string | number | null | boolean>"
1740
1853
  },
1741
- "default": "{ displayName: '' }",
1742
- "description": "The variant that the variants in `numerator` are compared to.",
1854
+ "default": "{}",
1855
+ "description": "Required.\n\nThe variant that the variants in `numerator` are compared to.",
1743
1856
  "attribute": "denominator"
1744
1857
  },
1745
1858
  {
@@ -1786,7 +1899,7 @@
1786
1899
  "kind": "field",
1787
1900
  "name": "headline",
1788
1901
  "type": {
1789
- "text": "string | undefined"
1902
+ "text": "string"
1790
1903
  },
1791
1904
  "default": "'Prevalence over time'",
1792
1905
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -1794,32 +1907,42 @@
1794
1907
  },
1795
1908
  {
1796
1909
  "kind": "field",
1797
- "name": "size",
1910
+ "name": "width",
1798
1911
  "type": {
1799
- "text": "{ width?: string; height?: string } | undefined"
1912
+ "text": "string"
1800
1913
  },
1801
- "default": "undefined",
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"
1914
+ "default": "'100%'",
1915
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1916
+ "attribute": "width"
1917
+ },
1918
+ {
1919
+ "kind": "field",
1920
+ "name": "height",
1921
+ "type": {
1922
+ "text": "string"
1923
+ },
1924
+ "default": "'700px'",
1925
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
1926
+ "attribute": "height"
1804
1927
  }
1805
1928
  ],
1806
1929
  "attributes": [
1807
1930
  {
1808
1931
  "name": "numerator",
1809
1932
  "type": {
1810
- "text": "(Record<string, string | number | null | boolean> & { displayName: string })\n | (Record<string, string | number | null | boolean> & {\n displayName: string;\n })[]"
1933
+ "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
1811
1934
  },
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.",
1935
+ "default": "{ displayName: '', lapisFilter: {} }",
1936
+ "description": "Required.\n\nEither 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
1937
  "fieldName": "numerator"
1815
1938
  },
1816
1939
  {
1817
1940
  "name": "denominator",
1818
1941
  "type": {
1819
- "text": "Record<string, string | number | null | boolean> & { displayName: string }"
1942
+ "text": "Record<string, string | number | null | boolean>"
1820
1943
  },
1821
- "default": "{ displayName: '' }",
1822
- "description": "The variant that the variants in `numerator` are compared to.",
1944
+ "default": "{}",
1945
+ "description": "Required.\n\nThe variant that the variants in `numerator` are compared to.",
1823
1946
  "fieldName": "denominator"
1824
1947
  },
1825
1948
  {
@@ -1861,20 +1984,29 @@
1861
1984
  {
1862
1985
  "name": "headline",
1863
1986
  "type": {
1864
- "text": "string | undefined"
1987
+ "text": "string"
1865
1988
  },
1866
1989
  "default": "'Prevalence over time'",
1867
1990
  "description": "The headline of the component. Set to an empty string to hide the headline.",
1868
1991
  "fieldName": "headline"
1869
1992
  },
1870
1993
  {
1871
- "name": "size",
1994
+ "name": "width",
1872
1995
  "type": {
1873
- "text": "{ width?: string; height?: string } | undefined"
1996
+ "text": "string"
1874
1997
  },
1875
- "default": "undefined",
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"
1998
+ "default": "'100%'",
1999
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
2000
+ "fieldName": "width"
2001
+ },
2002
+ {
2003
+ "name": "height",
2004
+ "type": {
2005
+ "text": "string"
2006
+ },
2007
+ "default": "'700px'",
2008
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
2009
+ "fieldName": "height"
1878
2010
  }
1879
2011
  ],
1880
2012
  "superclass": {
@@ -1914,15 +2046,15 @@
1914
2046
  "type": {
1915
2047
  "text": "Meta<RelativeGrowthAdvantageProps>"
1916
2048
  },
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'], }"
2049
+ "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' }, }, width: { control: 'text' }, height: { control: 'text' }, headline: { control: 'text' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
1918
2050
  },
1919
2051
  {
1920
2052
  "kind": "variable",
1921
2053
  "name": "Default",
1922
2054
  "type": {
1923
- "text": "StoryObj<RelativeGrowthAdvantageProps>"
2055
+ "text": "StoryObj<Required<RelativeGrowthAdvantageProps>>"
1924
2056
  },
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, }, }, ], }, }, }"
2057
+ "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'], 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, }, }, ], }, }, }"
1926
2058
  }
1927
2059
  ],
1928
2060
  "exports": [
@@ -1950,7 +2082,7 @@
1950
2082
  "declarations": [
1951
2083
  {
1952
2084
  "kind": "class",
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.",
2085
+ "description": "## Context\n\nFor this component, 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
2086
  "name": "RelativeGrowthAdvantageComponent",
1955
2087
  "members": [
1956
2088
  {
@@ -1960,7 +2092,7 @@
1960
2092
  "text": "Record<string, string | number | null | boolean>"
1961
2093
  },
1962
2094
  "default": "{}",
1963
- "description": "The LAPIS filter for the focal variant.",
2095
+ "description": "Required.\n\nThe LAPIS filter for the focal variant.",
1964
2096
  "attribute": "numerator"
1965
2097
  },
1966
2098
  {
@@ -1970,7 +2102,7 @@
1970
2102
  "text": "Record<string, string | number | null | boolean>"
1971
2103
  },
1972
2104
  "default": "{}",
1973
- "description": "The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
2105
+ "description": "Required.\n\nThe LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
1974
2106
  "attribute": "denominator"
1975
2107
  },
1976
2108
  {
@@ -1997,7 +2129,7 @@
1997
2129
  "kind": "field",
1998
2130
  "name": "headline",
1999
2131
  "type": {
2000
- "text": "string | undefined"
2132
+ "text": "string"
2001
2133
  },
2002
2134
  "default": "'Relative growth advantage'",
2003
2135
  "description": "The headline of the component. Set to an empty string to hide the headline.",
@@ -2005,13 +2137,23 @@
2005
2137
  },
2006
2138
  {
2007
2139
  "kind": "field",
2008
- "name": "size",
2140
+ "name": "width",
2009
2141
  "type": {
2010
- "text": "{ width?: string; height?: string } | undefined"
2142
+ "text": "string"
2011
2143
  },
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"
2144
+ "default": "'100%'",
2145
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
2146
+ "attribute": "width"
2147
+ },
2148
+ {
2149
+ "kind": "field",
2150
+ "name": "height",
2151
+ "type": {
2152
+ "text": "string"
2153
+ },
2154
+ "default": "'700px'",
2155
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
2156
+ "attribute": "height"
2015
2157
  }
2016
2158
  ],
2017
2159
  "attributes": [
@@ -2021,7 +2163,7 @@
2021
2163
  "text": "Record<string, string | number | null | boolean>"
2022
2164
  },
2023
2165
  "default": "{}",
2024
- "description": "The LAPIS filter for the focal variant.",
2166
+ "description": "Required.\n\nThe LAPIS filter for the focal variant.",
2025
2167
  "fieldName": "numerator"
2026
2168
  },
2027
2169
  {
@@ -2030,7 +2172,7 @@
2030
2172
  "text": "Record<string, string | number | null | boolean>"
2031
2173
  },
2032
2174
  "default": "{}",
2033
- "description": "The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
2175
+ "description": "Required.\n\nThe LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
2034
2176
  "fieldName": "denominator"
2035
2177
  },
2036
2178
  {
@@ -2054,20 +2196,29 @@
2054
2196
  {
2055
2197
  "name": "headline",
2056
2198
  "type": {
2057
- "text": "string | undefined"
2199
+ "text": "string"
2058
2200
  },
2059
2201
  "default": "'Relative growth advantage'",
2060
2202
  "description": "The headline of the component. Set to an empty string to hide the headline.",
2061
2203
  "fieldName": "headline"
2062
2204
  },
2063
2205
  {
2064
- "name": "size",
2206
+ "name": "width",
2065
2207
  "type": {
2066
- "text": "{ width?: string; height?: string } | undefined"
2208
+ "text": "string"
2067
2209
  },
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"
2210
+ "default": "'100%'",
2211
+ "description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
2212
+ "fieldName": "width"
2213
+ },
2214
+ {
2215
+ "name": "height",
2216
+ "type": {
2217
+ "text": "string"
2218
+ },
2219
+ "default": "'700px'",
2220
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
2221
+ "fieldName": "height"
2071
2222
  }
2072
2223
  ],
2073
2224
  "superclass": {