@genspectrum/dashboard-components 0.4.3 → 0.4.5
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 +145 -12
- package/dist/dashboard-components.js +232 -149
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +33 -0
- package/package.json +1 -1
- package/src/preact/aggregatedData/aggregate-table.tsx +3 -2
- package/src/preact/aggregatedData/aggregate.stories.tsx +6 -0
- package/src/preact/aggregatedData/aggregate.tsx +28 -6
- package/src/preact/components/table.stories.tsx +51 -1
- package/src/preact/components/table.tsx +4 -3
- package/src/preact/locationFilter/location-filter.stories.tsx +12 -1
- package/src/preact/locationFilter/location-filter.tsx +10 -3
- package/src/preact/mutationComparison/mutation-comparison-table.tsx +7 -2
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +3 -0
- package/src/preact/mutationComparison/mutation-comparison.tsx +25 -3
- package/src/preact/mutations/mutations-grid.tsx +8 -2
- package/src/preact/mutations/mutations-insertions-table.tsx +3 -2
- package/src/preact/mutations/mutations-table.tsx +3 -2
- package/src/preact/mutations/mutations.stories.tsx +3 -0
- package/src/preact/mutations/mutations.tsx +16 -6
- package/src/preact/prevalenceOverTime/prevalence-over-time-table.tsx +3 -2
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +4 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +8 -1
- package/src/query/queryAggregateData.spec.ts +117 -3
- package/src/query/queryAggregateData.ts +31 -2
- package/src/web-components/input/gs-location-filter.stories.ts +11 -0
- package/src/web-components/input/gs-location-filter.tsx +14 -1
- package/src/web-components/visualization/gs-aggregate.stories.ts +15 -0
- package/src/web-components/visualization/gs-aggregate.tsx +23 -0
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +4 -0
- package/src/web-components/visualization/gs-mutation-comparison.tsx +8 -0
- package/src/web-components/visualization/gs-mutations.stories.ts +4 -0
- package/src/web-components/visualization/gs-mutations.tsx +8 -0
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +5 -0
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +12 -4
package/custom-elements.json
CHANGED
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
"type": {
|
|
490
490
|
"text": "Meta"
|
|
491
491
|
},
|
|
492
|
-
"default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: ['gs-location-changed'], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { fields: { control: { type: 'object', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, decorators: [withActions], tags: ['autodocs'], }"
|
|
492
|
+
"default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: ['gs-location-changed'], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { fields: { control: { type: 'object', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, }, decorators: [withActions], tags: ['autodocs'], }"
|
|
493
493
|
},
|
|
494
494
|
{
|
|
495
495
|
"kind": "variable",
|
|
@@ -497,7 +497,7 @@
|
|
|
497
497
|
"type": {
|
|
498
498
|
"text": "StoryObj<LocationFilterProps>"
|
|
499
499
|
},
|
|
500
|
-
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 200, body: data, }, }, ], }, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter'); await waitFor(() => { return expect(canvas.getByRole('combobox')).toBeEnabled(); }); }, }"
|
|
500
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 200, body: data, }, }, ], }, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter'); await waitFor(() => { return expect(canvas.getByRole('combobox')).toBeEnabled(); }); await waitFor(() => { return expect(canvas.getByPlaceholderText('Enter a location')).toBeInTheDocument(); }); }, }"
|
|
501
501
|
},
|
|
502
502
|
{
|
|
503
503
|
"kind": "variable",
|
|
@@ -605,6 +605,16 @@
|
|
|
605
605
|
"default": "'100%'",
|
|
606
606
|
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
|
|
607
607
|
"attribute": "width"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"kind": "field",
|
|
611
|
+
"name": "placeholderText",
|
|
612
|
+
"type": {
|
|
613
|
+
"text": "string"
|
|
614
|
+
},
|
|
615
|
+
"default": "''",
|
|
616
|
+
"description": "The placeholder text to display in the input field, if it is empty.",
|
|
617
|
+
"attribute": "placeholderText"
|
|
608
618
|
}
|
|
609
619
|
],
|
|
610
620
|
"events": [
|
|
@@ -643,6 +653,15 @@
|
|
|
643
653
|
"default": "'100%'",
|
|
644
654
|
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.",
|
|
645
655
|
"fieldName": "width"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"name": "placeholderText",
|
|
659
|
+
"type": {
|
|
660
|
+
"text": "string"
|
|
661
|
+
},
|
|
662
|
+
"default": "''",
|
|
663
|
+
"description": "The placeholder text to display in the input field, if it is empty.",
|
|
664
|
+
"fieldName": "placeholderText"
|
|
646
665
|
}
|
|
647
666
|
],
|
|
648
667
|
"superclass": {
|
|
@@ -1124,7 +1143,7 @@
|
|
|
1124
1143
|
"type": {
|
|
1125
1144
|
"text": "Meta<Required<AggregateProps>>"
|
|
1126
1145
|
},
|
|
1127
|
-
"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'], }"
|
|
1146
|
+
"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' }, 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'], }"
|
|
1128
1147
|
},
|
|
1129
1148
|
{
|
|
1130
1149
|
"kind": "variable",
|
|
@@ -1132,7 +1151,7 @@
|
|
|
1132
1151
|
"type": {
|
|
1133
1152
|
"text": "StoryObj<Required<AggregateProps>>"
|
|
1134
1153
|
},
|
|
1135
|
-
"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', }, }"
|
|
1154
|
+
"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} .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', headline: 'Aggregate', initialSortField: 'count', initialSortDirection: 'descending', pageSize: 10, }, }"
|
|
1136
1155
|
}
|
|
1137
1156
|
],
|
|
1138
1157
|
"exports": [
|
|
@@ -1222,6 +1241,36 @@
|
|
|
1222
1241
|
"default": "'Aggregate'",
|
|
1223
1242
|
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1224
1243
|
"attribute": "headline"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"kind": "field",
|
|
1247
|
+
"name": "initialSortField",
|
|
1248
|
+
"type": {
|
|
1249
|
+
"text": "string"
|
|
1250
|
+
},
|
|
1251
|
+
"default": "'count'",
|
|
1252
|
+
"description": "The field by which the table is initially sorted.\nMust be one of the fields specified in the fields property, 'count', or 'proportion'.",
|
|
1253
|
+
"attribute": "initialSortField"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"kind": "field",
|
|
1257
|
+
"name": "initialSortDirection",
|
|
1258
|
+
"type": {
|
|
1259
|
+
"text": "'ascending' | 'descending'"
|
|
1260
|
+
},
|
|
1261
|
+
"default": "'descending'",
|
|
1262
|
+
"description": "The initial sort direction of the table.",
|
|
1263
|
+
"attribute": "initialSortDirection"
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
"kind": "field",
|
|
1267
|
+
"name": "pageSize",
|
|
1268
|
+
"type": {
|
|
1269
|
+
"text": "boolean | number"
|
|
1270
|
+
},
|
|
1271
|
+
"default": "false",
|
|
1272
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
1273
|
+
"attribute": "pageSize"
|
|
1225
1274
|
}
|
|
1226
1275
|
],
|
|
1227
1276
|
"attributes": [
|
|
@@ -1278,6 +1327,33 @@
|
|
|
1278
1327
|
"default": "'Aggregate'",
|
|
1279
1328
|
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1280
1329
|
"fieldName": "headline"
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"name": "initialSortField",
|
|
1333
|
+
"type": {
|
|
1334
|
+
"text": "string"
|
|
1335
|
+
},
|
|
1336
|
+
"default": "'count'",
|
|
1337
|
+
"description": "The field by which the table is initially sorted.\nMust be one of the fields specified in the fields property, 'count', or 'proportion'.",
|
|
1338
|
+
"fieldName": "initialSortField"
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
"name": "initialSortDirection",
|
|
1342
|
+
"type": {
|
|
1343
|
+
"text": "'ascending' | 'descending'"
|
|
1344
|
+
},
|
|
1345
|
+
"default": "'descending'",
|
|
1346
|
+
"description": "The initial sort direction of the table.",
|
|
1347
|
+
"fieldName": "initialSortDirection"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
"name": "pageSize",
|
|
1351
|
+
"type": {
|
|
1352
|
+
"text": "boolean | number"
|
|
1353
|
+
},
|
|
1354
|
+
"default": "false",
|
|
1355
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
1356
|
+
"fieldName": "pageSize"
|
|
1281
1357
|
}
|
|
1282
1358
|
],
|
|
1283
1359
|
"superclass": {
|
|
@@ -1317,7 +1393,7 @@
|
|
|
1317
1393
|
"type": {
|
|
1318
1394
|
"text": "Meta<Required<MutationComparisonProps>>"
|
|
1319
1395
|
},
|
|
1320
|
-
"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'], }"
|
|
1396
|
+
"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' }, pageSize: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1321
1397
|
},
|
|
1322
1398
|
{
|
|
1323
1399
|
"kind": "variable",
|
|
@@ -1325,7 +1401,7 @@
|
|
|
1325
1401
|
"type": {
|
|
1326
1402
|
"text": "StoryObj<Required<MutationComparisonProps>>"
|
|
1327
1403
|
},
|
|
1328
|
-
"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)); }); }, }"
|
|
1404
|
+
"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', pageSize: 10, }, 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)); }); }, }"
|
|
1329
1405
|
},
|
|
1330
1406
|
{
|
|
1331
1407
|
"kind": "variable",
|
|
@@ -1431,6 +1507,16 @@
|
|
|
1431
1507
|
"default": "'Mutation comparison'",
|
|
1432
1508
|
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1433
1509
|
"attribute": "headline"
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
"kind": "field",
|
|
1513
|
+
"name": "pageSize",
|
|
1514
|
+
"type": {
|
|
1515
|
+
"text": "boolean | number"
|
|
1516
|
+
},
|
|
1517
|
+
"default": "false",
|
|
1518
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
1519
|
+
"attribute": "pageSize"
|
|
1434
1520
|
}
|
|
1435
1521
|
],
|
|
1436
1522
|
"attributes": [
|
|
@@ -1487,6 +1573,15 @@
|
|
|
1487
1573
|
"default": "'Mutation comparison'",
|
|
1488
1574
|
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1489
1575
|
"fieldName": "headline"
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
"name": "pageSize",
|
|
1579
|
+
"type": {
|
|
1580
|
+
"text": "boolean | number"
|
|
1581
|
+
},
|
|
1582
|
+
"default": "false",
|
|
1583
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
1584
|
+
"fieldName": "pageSize"
|
|
1490
1585
|
}
|
|
1491
1586
|
],
|
|
1492
1587
|
"superclass": {
|
|
@@ -1526,7 +1621,7 @@
|
|
|
1526
1621
|
"type": {
|
|
1527
1622
|
"text": "Meta<Required<MutationsProps>>"
|
|
1528
1623
|
},
|
|
1529
|
-
"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'], }"
|
|
1624
|
+
"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' }, pageSize: { control: 'object' }, }, 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', pageSize: 10, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1530
1625
|
},
|
|
1531
1626
|
{
|
|
1532
1627
|
"kind": "variable",
|
|
@@ -1656,6 +1751,16 @@
|
|
|
1656
1751
|
"default": "'Mutations'",
|
|
1657
1752
|
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1658
1753
|
"attribute": "headline"
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
"kind": "field",
|
|
1757
|
+
"name": "pageSize",
|
|
1758
|
+
"type": {
|
|
1759
|
+
"text": "boolean | number"
|
|
1760
|
+
},
|
|
1761
|
+
"default": "false",
|
|
1762
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
1763
|
+
"attribute": "pageSize"
|
|
1659
1764
|
}
|
|
1660
1765
|
],
|
|
1661
1766
|
"attributes": [
|
|
@@ -1712,6 +1817,15 @@
|
|
|
1712
1817
|
"default": "'Mutations'",
|
|
1713
1818
|
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1714
1819
|
"fieldName": "headline"
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"name": "pageSize",
|
|
1823
|
+
"type": {
|
|
1824
|
+
"text": "boolean | number"
|
|
1825
|
+
},
|
|
1826
|
+
"default": "false",
|
|
1827
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
1828
|
+
"fieldName": "pageSize"
|
|
1715
1829
|
}
|
|
1716
1830
|
],
|
|
1717
1831
|
"superclass": {
|
|
@@ -1751,7 +1865,7 @@
|
|
|
1751
1865
|
"type": {
|
|
1752
1866
|
"text": "Meta<Required<PrevalenceOverTimeProps>>"
|
|
1753
1867
|
},
|
|
1754
|
-
"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'], }"
|
|
1868
|
+
"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' }, pageSize: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1755
1869
|
},
|
|
1756
1870
|
{
|
|
1757
1871
|
"kind": "variable",
|
|
@@ -1759,7 +1873,7 @@
|
|
|
1759
1873
|
"type": {
|
|
1760
1874
|
"text": "StoryObj<Required<PrevalenceOverTimeProps>>"
|
|
1761
1875
|
},
|
|
1762
|
-
"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', lapisDateField: 'date', }, 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, }, }, ], }, }, }"
|
|
1876
|
+
"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', lapisDateField: 'date', pageSize: 10, }, 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, }, }, ], }, }, }"
|
|
1763
1877
|
},
|
|
1764
1878
|
{
|
|
1765
1879
|
"kind": "variable",
|
|
@@ -1767,7 +1881,7 @@
|
|
|
1767
1881
|
"type": {
|
|
1768
1882
|
"text": "StoryObj<Required<PrevalenceOverTimeProps>>"
|
|
1769
1883
|
},
|
|
1770
|
-
"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', lapisDateField: 'date', }, 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, }, }, ], }, }, }"
|
|
1884
|
+
"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', lapisDateField: 'date', pageSize: 10, }, 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, }, }, ], }, }, }"
|
|
1771
1885
|
},
|
|
1772
1886
|
{
|
|
1773
1887
|
"kind": "variable",
|
|
@@ -1858,7 +1972,7 @@
|
|
|
1858
1972
|
"kind": "field",
|
|
1859
1973
|
"name": "numerator",
|
|
1860
1974
|
"type": {
|
|
1861
|
-
"text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n
|
|
1975
|
+
"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 }[]"
|
|
1862
1976
|
},
|
|
1863
1977
|
"default": "{ displayName: '', lapisFilter: {} }",
|
|
1864
1978
|
"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.",
|
|
@@ -1953,13 +2067,23 @@
|
|
|
1953
2067
|
"default": "'date'",
|
|
1954
2068
|
"description": "Required.\n\nThe LAPIS field that the data should be aggregated by.\nThe values will be used on the x-axis of the diagram.\nMust be a field of type `date` in LAPIS.",
|
|
1955
2069
|
"attribute": "lapisDateField"
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
"kind": "field",
|
|
2073
|
+
"name": "pageSize",
|
|
2074
|
+
"type": {
|
|
2075
|
+
"text": "boolean | number"
|
|
2076
|
+
},
|
|
2077
|
+
"default": "false",
|
|
2078
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
2079
|
+
"attribute": "pageSize"
|
|
1956
2080
|
}
|
|
1957
2081
|
],
|
|
1958
2082
|
"attributes": [
|
|
1959
2083
|
{
|
|
1960
2084
|
"name": "numerator",
|
|
1961
2085
|
"type": {
|
|
1962
|
-
"text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n
|
|
2086
|
+
"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 }[]"
|
|
1963
2087
|
},
|
|
1964
2088
|
"default": "{ displayName: '', lapisFilter: {} }",
|
|
1965
2089
|
"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.",
|
|
@@ -2045,6 +2169,15 @@
|
|
|
2045
2169
|
"default": "'date'",
|
|
2046
2170
|
"description": "Required.\n\nThe LAPIS field that the data should be aggregated by.\nThe values will be used on the x-axis of the diagram.\nMust be a field of type `date` in LAPIS.",
|
|
2047
2171
|
"fieldName": "lapisDateField"
|
|
2172
|
+
},
|
|
2173
|
+
{
|
|
2174
|
+
"name": "pageSize",
|
|
2175
|
+
"type": {
|
|
2176
|
+
"text": "boolean | number"
|
|
2177
|
+
},
|
|
2178
|
+
"default": "false",
|
|
2179
|
+
"description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
|
|
2180
|
+
"fieldName": "pageSize"
|
|
2048
2181
|
}
|
|
2049
2182
|
],
|
|
2050
2183
|
"superclass": {
|