@genspectrum/dashboard-components 0.5.7 → 0.6.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.
- package/custom-elements.json +194 -128
- package/dist/dashboard-components.js +14 -93
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +24 -28
- package/dist/style.css +0 -4
- package/package.json +1 -1
- package/src/preact/aggregatedData/aggregate.stories.tsx +0 -2
- package/src/preact/aggregatedData/aggregate.tsx +3 -12
- package/src/preact/components/error-boundary.stories.tsx +2 -6
- package/src/preact/components/error-boundary.tsx +2 -5
- package/src/preact/lineageFilter/__mockData__/aggregated.json +14510 -0
- package/src/preact/lineageFilter/fetchLineageAutocompleteList.spec.ts +14 -0
- package/src/preact/lineageFilter/fetchLineageAutocompleteList.ts +9 -0
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +56 -0
- package/src/preact/lineageFilter/lineage-filter.tsx +100 -0
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -3
- package/src/preact/mutationComparison/mutation-comparison.tsx +3 -12
- package/src/preact/mutations/mutations.stories.tsx +0 -3
- package/src/preact/mutations/mutations.tsx +3 -12
- package/src/preact/numberSequencesOverTime/__mockData__/twoVariantsEG.json +0 -8
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +0 -2
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +3 -7
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -4
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +3 -12
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -3
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +2 -7
- package/src/preact/textInput/text-input.tsx +1 -5
- package/src/web-components/input/gs-lineage-filter.stories.ts +137 -0
- package/src/web-components/input/gs-lineage-filter.tsx +79 -0
- package/src/web-components/visualization/gs-aggregate.stories.ts +0 -4
- package/src/web-components/visualization/gs-aggregate.tsx +0 -7
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +0 -4
- package/src/web-components/visualization/gs-mutation-comparison.tsx +0 -7
- package/src/web-components/visualization/gs-mutations.stories.ts +0 -4
- package/src/web-components/visualization/gs-mutations.tsx +0 -7
- package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +1 -3
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +14 -11
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +0 -5
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +0 -7
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +0 -4
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +0 -7
- package/src/preact/components/headline.stories.tsx +0 -47
- package/src/preact/components/headline.tsx +0 -36
package/custom-elements.json
CHANGED
|
@@ -479,6 +479,186 @@
|
|
|
479
479
|
}
|
|
480
480
|
]
|
|
481
481
|
},
|
|
482
|
+
{
|
|
483
|
+
"kind": "javascript-module",
|
|
484
|
+
"path": "src/web-components/input/gs-lineage-filter.stories.ts",
|
|
485
|
+
"declarations": [
|
|
486
|
+
{
|
|
487
|
+
"kind": "variable",
|
|
488
|
+
"name": "meta",
|
|
489
|
+
"type": {
|
|
490
|
+
"text": "Meta<Required<LineageFilterProps>>"
|
|
491
|
+
},
|
|
492
|
+
"default": "{ title: 'Input/Lineage filter', component: 'gs-lineage-filter', parameters: withComponentDocs({ actions: { handles: ['gs-lineage-filter-changed'], }, fetchMock: { mocks: [ { matcher: { name: 'pangoLineage', url: AGGREGATED_ENDPOINT, body: { fields: ['pangoLineage'], }, }, response: { status: 200, body: aggregatedData, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), decorators: [withActions], tags: ['autodocs'], }"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"kind": "variable",
|
|
496
|
+
"name": "Default",
|
|
497
|
+
"type": {
|
|
498
|
+
"text": "StoryObj<Required<LineageFilterProps>>"
|
|
499
|
+
},
|
|
500
|
+
"default": "{ render: (args) => { return html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-screen-lg\"> <gs-lineage-filter .lapisField=${args.lapisField} .placeholderText=${args.placeholderText} .initialValue=${args.initialValue} .width=${args.width} ></gs-lineage-filter> </div> </gs-app>`; }, args: { lapisField: 'pangoLineage', placeholderText: 'Enter lineage', initialValue: 'B.1.1.7', width: '100%', }, }"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"kind": "variable",
|
|
504
|
+
"name": "FiresEvent",
|
|
505
|
+
"type": {
|
|
506
|
+
"text": "StoryObj<Required<LineageFilterProps>>"
|
|
507
|
+
},
|
|
508
|
+
"default": "{ ...Default, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-lineage-filter'); const inputField = () => canvas.getByPlaceholderText('Enter lineage'); const listenerMock = fn(); await step('Setup event listener mock', async () => { canvasElement.addEventListener('gs-lineage-filter-changed', listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Enters an invalid lineage value', async () => { await userEvent.type(inputField(), 'notInList'); await expect(listenerMock).not.toHaveBeenCalled(); }); await step('Empty input', async () => { await userEvent.type(inputField(), '{backspace>9/}'); await expect(listenerMock.mock.calls.at(-1)[0].detail).toStrictEqual({ pangoLineage: undefined, }); }); await step('Enter a valid lineage value', async () => { await userEvent.type(inputField(), 'B.1.1.7'); await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { pangoLineage: 'B.1.1.7', }, }), ); }); await step('Enter a valid lineage value', async () => { await userEvent.type(inputField(), '{backspace>9/}'); await userEvent.type(inputField(), 'B.1.1.7*'); await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { pangoLineage: 'B.1.1.7*', }, }), ); }); }, args: { ...Default.args, initialValue: '', }, }"
|
|
509
|
+
}
|
|
510
|
+
],
|
|
511
|
+
"exports": [
|
|
512
|
+
{
|
|
513
|
+
"kind": "js",
|
|
514
|
+
"name": "default",
|
|
515
|
+
"declaration": {
|
|
516
|
+
"name": "meta",
|
|
517
|
+
"module": "src/web-components/input/gs-lineage-filter.stories.ts"
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"kind": "js",
|
|
522
|
+
"name": "Default",
|
|
523
|
+
"declaration": {
|
|
524
|
+
"name": "Default",
|
|
525
|
+
"module": "src/web-components/input/gs-lineage-filter.stories.ts"
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"kind": "js",
|
|
530
|
+
"name": "FiresEvent",
|
|
531
|
+
"declaration": {
|
|
532
|
+
"name": "FiresEvent",
|
|
533
|
+
"module": "src/web-components/input/gs-lineage-filter.stories.ts"
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
]
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"kind": "javascript-module",
|
|
540
|
+
"path": "src/web-components/input/gs-lineage-filter.tsx",
|
|
541
|
+
"declarations": [
|
|
542
|
+
{
|
|
543
|
+
"kind": "class",
|
|
544
|
+
"description": "\n## Context\n\nThis component provides a text input field to filter by lineages.\nCurrently, it is designed to work well with Pango Lineages,\nbut it may also be used for other lineage types, if suitable.\n\nIt fetches all available values of the `lapisField` from the LAPIS instance\nand provides an autocomplete list with the available values of the lineage and sublineage queries\n(a `*` appended to the lineage value).",
|
|
545
|
+
"name": "LineageFilterComponent",
|
|
546
|
+
"members": [
|
|
547
|
+
{
|
|
548
|
+
"kind": "field",
|
|
549
|
+
"name": "initialValue",
|
|
550
|
+
"type": {
|
|
551
|
+
"text": "string"
|
|
552
|
+
},
|
|
553
|
+
"default": "''",
|
|
554
|
+
"description": "The initial value to use for this lineage filter.",
|
|
555
|
+
"attribute": "initialValue"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"kind": "field",
|
|
559
|
+
"name": "lapisField",
|
|
560
|
+
"type": {
|
|
561
|
+
"text": "string"
|
|
562
|
+
},
|
|
563
|
+
"default": "''",
|
|
564
|
+
"description": "Required.\n\nThe LAPIS field name to use for this lineage filter.\nThe field must exist on this LAPIS instance.",
|
|
565
|
+
"attribute": "lapisField"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"kind": "field",
|
|
569
|
+
"name": "placeholderText",
|
|
570
|
+
"type": {
|
|
571
|
+
"text": "string"
|
|
572
|
+
},
|
|
573
|
+
"default": "''",
|
|
574
|
+
"description": "The placeholder text to display in the input field.",
|
|
575
|
+
"attribute": "placeholderText"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"kind": "field",
|
|
579
|
+
"name": "width",
|
|
580
|
+
"type": {
|
|
581
|
+
"text": "string"
|
|
582
|
+
},
|
|
583
|
+
"default": "'100%'",
|
|
584
|
+
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
585
|
+
"attribute": "width"
|
|
586
|
+
}
|
|
587
|
+
],
|
|
588
|
+
"events": [
|
|
589
|
+
{
|
|
590
|
+
"type": {
|
|
591
|
+
"text": "CustomEvent<Record<string, string>>"
|
|
592
|
+
},
|
|
593
|
+
"description": "Fired when the input field is changed. The `details` of this event contain an object with the `lapisField` as key and the input value as value. Example: ``` { \"pangoLineage\": \"B.1.1.7\" } ```",
|
|
594
|
+
"name": "gs-lineage-filter-changed"
|
|
595
|
+
}
|
|
596
|
+
],
|
|
597
|
+
"attributes": [
|
|
598
|
+
{
|
|
599
|
+
"name": "initialValue",
|
|
600
|
+
"type": {
|
|
601
|
+
"text": "string"
|
|
602
|
+
},
|
|
603
|
+
"default": "''",
|
|
604
|
+
"description": "The initial value to use for this lineage filter.",
|
|
605
|
+
"fieldName": "initialValue"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "lapisField",
|
|
609
|
+
"type": {
|
|
610
|
+
"text": "string"
|
|
611
|
+
},
|
|
612
|
+
"default": "''",
|
|
613
|
+
"description": "Required.\n\nThe LAPIS field name to use for this lineage filter.\nThe field must exist on this LAPIS instance.",
|
|
614
|
+
"fieldName": "lapisField"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"name": "placeholderText",
|
|
618
|
+
"type": {
|
|
619
|
+
"text": "string"
|
|
620
|
+
},
|
|
621
|
+
"default": "''",
|
|
622
|
+
"description": "The placeholder text to display in the input field.",
|
|
623
|
+
"fieldName": "placeholderText"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"name": "width",
|
|
627
|
+
"type": {
|
|
628
|
+
"text": "string"
|
|
629
|
+
},
|
|
630
|
+
"default": "'100%'",
|
|
631
|
+
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
632
|
+
"fieldName": "width"
|
|
633
|
+
}
|
|
634
|
+
],
|
|
635
|
+
"superclass": {
|
|
636
|
+
"name": "PreactLitAdapter",
|
|
637
|
+
"module": "/src/web-components/PreactLitAdapter"
|
|
638
|
+
},
|
|
639
|
+
"tagName": "gs-lineage-filter",
|
|
640
|
+
"customElement": true
|
|
641
|
+
}
|
|
642
|
+
],
|
|
643
|
+
"exports": [
|
|
644
|
+
{
|
|
645
|
+
"kind": "js",
|
|
646
|
+
"name": "LineageFilterComponent",
|
|
647
|
+
"declaration": {
|
|
648
|
+
"name": "LineageFilterComponent",
|
|
649
|
+
"module": "src/web-components/input/gs-lineage-filter.tsx"
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"kind": "custom-element-definition",
|
|
654
|
+
"name": "gs-lineage-filter",
|
|
655
|
+
"declaration": {
|
|
656
|
+
"name": "LineageFilterComponent",
|
|
657
|
+
"module": "src/web-components/input/gs-lineage-filter.tsx"
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
},
|
|
482
662
|
{
|
|
483
663
|
"kind": "javascript-module",
|
|
484
664
|
"path": "src/web-components/input/gs-location-filter.stories.ts",
|
|
@@ -1159,7 +1339,7 @@
|
|
|
1159
1339
|
"type": {
|
|
1160
1340
|
"text": "Meta<Required<AggregateProps>>"
|
|
1161
1341
|
},
|
|
1162
|
-
"default": "{ title: 'Visualization/Aggregate', component: 'gs-aggregate', argTypes: { fields: [{ control: 'object' }], views: { options: ['table'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' },
|
|
1342
|
+
"default": "{ title: 'Visualization/Aggregate', component: 'gs-aggregate', argTypes: { fields: [{ control: 'object' }], views: { options: ['table'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, pageSize: { control: 'object' }, initialSortField: { control: 'text' }, initialSortDirection: { options: ['ascending', 'descending'], control: { type: 'radio' }, }, }, 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'], }"
|
|
1163
1343
|
},
|
|
1164
1344
|
{
|
|
1165
1345
|
"kind": "variable",
|
|
@@ -1167,7 +1347,7 @@
|
|
|
1167
1347
|
"type": {
|
|
1168
1348
|
"text": "StoryObj<Required<AggregateProps>>"
|
|
1169
1349
|
},
|
|
1170
|
-
"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} .
|
|
1350
|
+
"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} .initialSortField=${args.initialSortField} .initialSortDirection=${args.initialSortDirection} .pageSize=${args.pageSize} ></gs-aggregate> </gs-app> `, args: { fields: ['division', 'host'], views: ['table'], filter: { country: 'USA', }, width: '100%', height: '700px', initialSortField: 'count', initialSortDirection: 'descending', pageSize: 10, }, }"
|
|
1171
1351
|
}
|
|
1172
1352
|
],
|
|
1173
1353
|
"exports": [
|
|
@@ -1248,16 +1428,6 @@
|
|
|
1248
1428
|
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1249
1429
|
"attribute": "height"
|
|
1250
1430
|
},
|
|
1251
|
-
{
|
|
1252
|
-
"kind": "field",
|
|
1253
|
-
"name": "headline",
|
|
1254
|
-
"type": {
|
|
1255
|
-
"text": "string"
|
|
1256
|
-
},
|
|
1257
|
-
"default": "'Aggregate'",
|
|
1258
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1259
|
-
"attribute": "headline"
|
|
1260
|
-
},
|
|
1261
1431
|
{
|
|
1262
1432
|
"kind": "field",
|
|
1263
1433
|
"name": "initialSortField",
|
|
@@ -1335,15 +1505,6 @@
|
|
|
1335
1505
|
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1336
1506
|
"fieldName": "height"
|
|
1337
1507
|
},
|
|
1338
|
-
{
|
|
1339
|
-
"name": "headline",
|
|
1340
|
-
"type": {
|
|
1341
|
-
"text": "string"
|
|
1342
|
-
},
|
|
1343
|
-
"default": "'Aggregate'",
|
|
1344
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1345
|
-
"fieldName": "headline"
|
|
1346
|
-
},
|
|
1347
1508
|
{
|
|
1348
1509
|
"name": "initialSortField",
|
|
1349
1510
|
"type": {
|
|
@@ -1409,7 +1570,7 @@
|
|
|
1409
1570
|
"type": {
|
|
1410
1571
|
"text": "Meta<Required<MutationComparisonProps>>"
|
|
1411
1572
|
},
|
|
1412
|
-
"default": "{ title: 'Visualization/Mutation comparison', component: 'gs-mutation-comparison', argTypes: { lapisFilters: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'venn'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' },
|
|
1573
|
+
"default": "{ title: 'Visualization/Mutation comparison', component: 'gs-mutation-comparison', argTypes: { lapisFilters: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'venn'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, pageSize: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1413
1574
|
},
|
|
1414
1575
|
{
|
|
1415
1576
|
"kind": "variable",
|
|
@@ -1417,7 +1578,7 @@
|
|
|
1417
1578
|
"type": {
|
|
1418
1579
|
"text": "StoryObj<Required<MutationComparisonProps>>"
|
|
1419
1580
|
},
|
|
1420
|
-
"default": "{ ...Template, args: { lapisFilters: [ { displayName: 'Some dataset', lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo }, }, { displayName: 'Other dataset', lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom, dateTo, }, }, ], sequenceType: 'nucleotide', views: ['table', 'venn'], width: '100%', height: '700px',
|
|
1581
|
+
"default": "{ ...Template, args: { lapisFilters: [ { displayName: 'Some dataset', lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo }, }, { displayName: 'Other dataset', lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom, dateTo, }, }, ], sequenceType: 'nucleotide', views: ['table', 'venn'], width: '100%', height: '700px', pageSize: 10, }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'nucleotideMutationsSomeDataset', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo, minProportion: 0, }, }, response: { status: 200, body: nucleotideMutationsSomeDataset, }, }, { matcher: { name: 'nucleotideMutationsOtherDataset', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom, dateTo, minProportion: 0, }, }, response: { status: 200, body: nucleotideMutationsOtherDataset, }, }, ], }, }, 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)); }); }, }"
|
|
1421
1582
|
},
|
|
1422
1583
|
{
|
|
1423
1584
|
"kind": "variable",
|
|
@@ -1514,16 +1675,6 @@
|
|
|
1514
1675
|
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1515
1676
|
"attribute": "height"
|
|
1516
1677
|
},
|
|
1517
|
-
{
|
|
1518
|
-
"kind": "field",
|
|
1519
|
-
"name": "headline",
|
|
1520
|
-
"type": {
|
|
1521
|
-
"text": "string"
|
|
1522
|
-
},
|
|
1523
|
-
"default": "'Mutation comparison'",
|
|
1524
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1525
|
-
"attribute": "headline"
|
|
1526
|
-
},
|
|
1527
1678
|
{
|
|
1528
1679
|
"kind": "field",
|
|
1529
1680
|
"name": "pageSize",
|
|
@@ -1581,15 +1732,6 @@
|
|
|
1581
1732
|
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1582
1733
|
"fieldName": "height"
|
|
1583
1734
|
},
|
|
1584
|
-
{
|
|
1585
|
-
"name": "headline",
|
|
1586
|
-
"type": {
|
|
1587
|
-
"text": "string"
|
|
1588
|
-
},
|
|
1589
|
-
"default": "'Mutation comparison'",
|
|
1590
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1591
|
-
"fieldName": "headline"
|
|
1592
|
-
},
|
|
1593
1735
|
{
|
|
1594
1736
|
"name": "pageSize",
|
|
1595
1737
|
"type": {
|
|
@@ -1637,7 +1779,7 @@
|
|
|
1637
1779
|
"type": {
|
|
1638
1780
|
"text": "Meta<Required<MutationsProps>>"
|
|
1639
1781
|
},
|
|
1640
|
-
"default": "{ title: 'Visualization/Mutations', component: 'gs-mutations', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'grid', 'insertions'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' },
|
|
1782
|
+
"default": "{ title: 'Visualization/Mutations', component: 'gs-mutations', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'grid', 'insertions'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, pageSize: { control: 'object' }, }, args: { lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' }, sequenceType: 'nucleotide', views: ['grid', 'table', 'insertions'], width: '100%', height: '700px', pageSize: 10, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1641
1783
|
},
|
|
1642
1784
|
{
|
|
1643
1785
|
"kind": "variable",
|
|
@@ -1758,16 +1900,6 @@
|
|
|
1758
1900
|
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1759
1901
|
"attribute": "height"
|
|
1760
1902
|
},
|
|
1761
|
-
{
|
|
1762
|
-
"kind": "field",
|
|
1763
|
-
"name": "headline",
|
|
1764
|
-
"type": {
|
|
1765
|
-
"text": "string"
|
|
1766
|
-
},
|
|
1767
|
-
"default": "'Mutations'",
|
|
1768
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1769
|
-
"attribute": "headline"
|
|
1770
|
-
},
|
|
1771
1903
|
{
|
|
1772
1904
|
"kind": "field",
|
|
1773
1905
|
"name": "pageSize",
|
|
@@ -1825,15 +1957,6 @@
|
|
|
1825
1957
|
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1826
1958
|
"fieldName": "height"
|
|
1827
1959
|
},
|
|
1828
|
-
{
|
|
1829
|
-
"name": "headline",
|
|
1830
|
-
"type": {
|
|
1831
|
-
"text": "string"
|
|
1832
|
-
},
|
|
1833
|
-
"default": "'Mutations'",
|
|
1834
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1835
|
-
"fieldName": "headline"
|
|
1836
|
-
},
|
|
1837
1960
|
{
|
|
1838
1961
|
"name": "pageSize",
|
|
1839
1962
|
"type": {
|
|
@@ -1913,7 +2036,7 @@
|
|
|
1913
2036
|
"type": {
|
|
1914
2037
|
"text": "StoryObj<NumberSequencesOverTimeProps>"
|
|
1915
2038
|
},
|
|
1916
|
-
"default": "{ ...Template, args: { ...Template.args, lapisFilter: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2022-10-01' }, }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregatedEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', fields: ['date'], }, }, response: { status: 200, body: twoVariantsEG, }, }, { matcher: { name: 'aggregatedJN.1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsJN1, }, }, ], }, }, }"
|
|
2039
|
+
"default": "{ ...Template, args: { ...Template.args, lapisFilter: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2022-10-01' }, }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregatedEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2022-10-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsEG, }, }, { matcher: { name: 'aggregatedJN.1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsJN1, }, }, ], }, }, }"
|
|
1917
2040
|
},
|
|
1918
2041
|
{
|
|
1919
2042
|
"kind": "variable",
|
|
@@ -1981,7 +2104,7 @@
|
|
|
1981
2104
|
"declarations": [
|
|
1982
2105
|
{
|
|
1983
2106
|
"kind": "class",
|
|
1984
|
-
"description": "
|
|
2107
|
+
"description": "## Context\n\nThis component displays the number of sequences over time of one or more datasets,\nselected by LAPIS filters.\n\nIn the chart views, the user can select the y-axis scale (linear, logistic).\nThe x-axis shows all available time intervals available in the datasets in the selected `granularity`.\nThus, the `lapisFilter` implicitly also defines the range that is shown on the x-axis.\nIf you want to restrict the x-axis to a smaller date range,\nthen you need to set appropriate filter values in the `lapisFilter`.",
|
|
1985
2108
|
"name": "NumberSequencesOverTimeComponent",
|
|
1986
2109
|
"members": [
|
|
1987
2110
|
{
|
|
@@ -1991,7 +2114,7 @@
|
|
|
1991
2114
|
"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 }[]"
|
|
1992
2115
|
},
|
|
1993
2116
|
"default": "{ displayName: '', lapisFilter: {} }",
|
|
1994
|
-
"description": "Required.\nEither a LAPIS filter or an array of LAPIS filters to
|
|
2117
|
+
"description": "Required.\n\nEither a LAPIS filter or an array of LAPIS filters to fetch the number of sequences for.\n\nThe `lapisFilter` will be sent as is to LAPIS to select the data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used to label the component views.\nIt should be human-readable.",
|
|
1995
2118
|
"attribute": "lapisFilter"
|
|
1996
2119
|
},
|
|
1997
2120
|
{
|
|
@@ -2014,16 +2137,6 @@
|
|
|
2014
2137
|
"description": "A list of tabs with views that this component should provide.",
|
|
2015
2138
|
"attribute": "views"
|
|
2016
2139
|
},
|
|
2017
|
-
{
|
|
2018
|
-
"kind": "field",
|
|
2019
|
-
"name": "headline",
|
|
2020
|
-
"type": {
|
|
2021
|
-
"text": "string"
|
|
2022
|
-
},
|
|
2023
|
-
"default": "'Number of sequences of time'",
|
|
2024
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2025
|
-
"attribute": "headline"
|
|
2026
|
-
},
|
|
2027
2140
|
{
|
|
2028
2141
|
"kind": "field",
|
|
2029
2142
|
"name": "width",
|
|
@@ -2082,7 +2195,7 @@
|
|
|
2082
2195
|
"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 }[]"
|
|
2083
2196
|
},
|
|
2084
2197
|
"default": "{ displayName: '', lapisFilter: {} }",
|
|
2085
|
-
"description": "Required.\nEither a LAPIS filter or an array of LAPIS filters to
|
|
2198
|
+
"description": "Required.\n\nEither a LAPIS filter or an array of LAPIS filters to fetch the number of sequences for.\n\nThe `lapisFilter` will be sent as is to LAPIS to select the data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used to label the component views.\nIt should be human-readable.",
|
|
2086
2199
|
"fieldName": "lapisFilter"
|
|
2087
2200
|
},
|
|
2088
2201
|
{
|
|
@@ -2103,15 +2216,6 @@
|
|
|
2103
2216
|
"description": "A list of tabs with views that this component should provide.",
|
|
2104
2217
|
"fieldName": "views"
|
|
2105
2218
|
},
|
|
2106
|
-
{
|
|
2107
|
-
"name": "headline",
|
|
2108
|
-
"type": {
|
|
2109
|
-
"text": "string"
|
|
2110
|
-
},
|
|
2111
|
-
"default": "'Number of sequences of time'",
|
|
2112
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2113
|
-
"fieldName": "headline"
|
|
2114
|
-
},
|
|
2115
2219
|
{
|
|
2116
2220
|
"name": "width",
|
|
2117
2221
|
"type": {
|
|
@@ -2195,7 +2299,7 @@
|
|
|
2195
2299
|
"type": {
|
|
2196
2300
|
"text": "Meta<Required<PrevalenceOverTimeComponentProps>>"
|
|
2197
2301
|
},
|
|
2198
|
-
"default": "{ title: 'Visualization/Prevalence over time', component: 'gs-prevalence-over-time', argTypes: { numeratorFilter: { control: 'object' }, denominatorFilter: { 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' },
|
|
2302
|
+
"default": "{ title: 'Visualization/Prevalence over time', component: 'gs-prevalence-over-time', argTypes: { numeratorFilter: { control: 'object' }, denominatorFilter: { 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' }, pageSize: { control: 'object' }, yAxisMaxLinear: { control: 'object' }, yAxisMaxLogarithmic: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
2199
2303
|
},
|
|
2200
2304
|
{
|
|
2201
2305
|
"kind": "variable",
|
|
@@ -2203,7 +2307,7 @@
|
|
|
2203
2307
|
"type": {
|
|
2204
2308
|
"text": "StoryObj<Required<PrevalenceOverTimeComponentProps>>"
|
|
2205
2309
|
},
|
|
2206
|
-
"default": "{ ...Template, args: { numeratorFilter: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' } }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], denominatorFilter: { country: 'USA', dateFrom: '2023-01-01' }, granularity: 'month', smoothingWindow: 0, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px',
|
|
2310
|
+
"default": "{ ...Template, args: { numeratorFilter: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' } }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], denominatorFilter: { country: 'USA', dateFrom: '2023-01-01' }, granularity: 'month', smoothingWindow: 0, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px', lapisDateField: 'date', pageSize: 10, yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterEG, }, }, { matcher: { name: 'numeratorJN1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterJN1, }, }, { matcher: { name: 'denominator', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilter, }, }, ], }, }, }"
|
|
2207
2311
|
},
|
|
2208
2312
|
{
|
|
2209
2313
|
"kind": "variable",
|
|
@@ -2211,7 +2315,7 @@
|
|
|
2211
2315
|
"type": {
|
|
2212
2316
|
"text": "StoryObj<Required<PrevalenceOverTimeComponentProps>>"
|
|
2213
2317
|
},
|
|
2214
|
-
"default": "{ ...Template, args: { numeratorFilter: { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' }, }, denominatorFilter: { country: 'USA', dateFrom: '2023-10-01' }, granularity: 'week', smoothingWindow: 2, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px',
|
|
2318
|
+
"default": "{ ...Template, args: { numeratorFilter: { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' }, }, denominatorFilter: { country: 'USA', dateFrom: '2023-10-01' }, granularity: 'week', smoothingWindow: 2, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px', lapisDateField: 'date', pageSize: 10, yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorOneDataset', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterOneDataset, }, }, { matcher: { name: 'denominatorOneDataset', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilterOneDataset, }, }, ], }, }, }"
|
|
2215
2319
|
},
|
|
2216
2320
|
{
|
|
2217
2321
|
"kind": "variable",
|
|
@@ -2358,16 +2462,6 @@
|
|
|
2358
2462
|
"description": "A list of methods to calculate the confidence interval.\nThe option `none` is always available and disables confidence intervals.\nPass an empty array to disable the confidence interval selector.",
|
|
2359
2463
|
"attribute": "confidenceIntervalMethods"
|
|
2360
2464
|
},
|
|
2361
|
-
{
|
|
2362
|
-
"kind": "field",
|
|
2363
|
-
"name": "headline",
|
|
2364
|
-
"type": {
|
|
2365
|
-
"text": "string"
|
|
2366
|
-
},
|
|
2367
|
-
"default": "'Prevalence over time'",
|
|
2368
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2369
|
-
"attribute": "headline"
|
|
2370
|
-
},
|
|
2371
2465
|
{
|
|
2372
2466
|
"kind": "field",
|
|
2373
2467
|
"name": "width",
|
|
@@ -2484,15 +2578,6 @@
|
|
|
2484
2578
|
"description": "A list of methods to calculate the confidence interval.\nThe option `none` is always available and disables confidence intervals.\nPass an empty array to disable the confidence interval selector.",
|
|
2485
2579
|
"fieldName": "confidenceIntervalMethods"
|
|
2486
2580
|
},
|
|
2487
|
-
{
|
|
2488
|
-
"name": "headline",
|
|
2489
|
-
"type": {
|
|
2490
|
-
"text": "string"
|
|
2491
|
-
},
|
|
2492
|
-
"default": "'Prevalence over time'",
|
|
2493
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2494
|
-
"fieldName": "headline"
|
|
2495
|
-
},
|
|
2496
2581
|
{
|
|
2497
2582
|
"name": "width",
|
|
2498
2583
|
"type": {
|
|
@@ -2585,7 +2670,7 @@
|
|
|
2585
2670
|
"type": {
|
|
2586
2671
|
"text": "Meta<RelativeGrowthAdvantageComponentProps>"
|
|
2587
2672
|
},
|
|
2588
|
-
"default": "{ title: 'Visualization/Relative growth advantage', component: 'gs-relative-growth-advantage', argTypes: { numeratorFilter: { control: 'object' }, denominatorFilter: { control: 'object' }, generationTime: { control: 'number' }, views: { options: ['line'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' },
|
|
2673
|
+
"default": "{ title: 'Visualization/Relative growth advantage', component: 'gs-relative-growth-advantage', argTypes: { numeratorFilter: { control: 'object' }, denominatorFilter: { control: 'object' }, generationTime: { control: 'number' }, views: { options: ['line'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, yAxisMaxLinear: { control: 'object' }, yAxisMaxLogarithmic: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
2589
2674
|
},
|
|
2590
2675
|
{
|
|
2591
2676
|
"kind": "variable",
|
|
@@ -2593,7 +2678,7 @@
|
|
|
2593
2678
|
"type": {
|
|
2594
2679
|
"text": "StoryObj<Required<RelativeGrowthAdvantageComponentProps>>"
|
|
2595
2680
|
},
|
|
2596
|
-
"default": "{ ...Template, args: { numeratorFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01', }, denominatorFilter: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01' }, generationTime: 7, views: ['line'], width: '100%', height: '700px',
|
|
2681
|
+
"default": "{ ...Template, args: { numeratorFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01', }, denominatorFilter: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01' }, generationTime: 7, views: ['line'], width: '100%', height: '700px', lapisDateField: 'date', yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorFilter', 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: numeratorFilter, }, }, { matcher: { name: 'denominatorFilter', url: AGGREGATED_ENDPOINT, body: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilter, }, }, ], }, }, }"
|
|
2597
2682
|
}
|
|
2598
2683
|
],
|
|
2599
2684
|
"exports": [
|
|
@@ -2664,16 +2749,6 @@
|
|
|
2664
2749
|
"description": "A list of tabs with views that this component should provide.",
|
|
2665
2750
|
"attribute": "views"
|
|
2666
2751
|
},
|
|
2667
|
-
{
|
|
2668
|
-
"kind": "field",
|
|
2669
|
-
"name": "headline",
|
|
2670
|
-
"type": {
|
|
2671
|
-
"text": "string"
|
|
2672
|
-
},
|
|
2673
|
-
"default": "'Relative growth advantage'",
|
|
2674
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2675
|
-
"attribute": "headline"
|
|
2676
|
-
},
|
|
2677
2752
|
{
|
|
2678
2753
|
"kind": "field",
|
|
2679
2754
|
"name": "width",
|
|
@@ -2762,15 +2837,6 @@
|
|
|
2762
2837
|
"description": "A list of tabs with views that this component should provide.",
|
|
2763
2838
|
"fieldName": "views"
|
|
2764
2839
|
},
|
|
2765
|
-
{
|
|
2766
|
-
"name": "headline",
|
|
2767
|
-
"type": {
|
|
2768
|
-
"text": "string"
|
|
2769
|
-
},
|
|
2770
|
-
"default": "'Relative growth advantage'",
|
|
2771
|
-
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
2772
|
-
"fieldName": "headline"
|
|
2773
|
-
},
|
|
2774
2840
|
{
|
|
2775
2841
|
"name": "width",
|
|
2776
2842
|
"type": {
|