@genspectrum/dashboard-components 0.1.3 → 0.1.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 +488 -117
- package/dist/dashboard-components.js +904 -466
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +473 -67
- package/dist/style.css +273 -153
- package/package.json +11 -7
- package/src/preact/aggregatedData/aggregate.stories.tsx +7 -5
- package/src/preact/aggregatedData/aggregate.tsx +16 -7
- package/src/preact/components/ReferenceGenomesAwaiter.tsx +25 -0
- package/src/preact/components/csv-download-button.tsx +8 -2
- package/src/preact/components/headline.stories.tsx +19 -1
- package/src/preact/components/headline.tsx +25 -5
- package/src/preact/components/info.stories.tsx +24 -3
- package/src/preact/components/info.tsx +49 -5
- package/src/preact/components/min-max-range-slider.tsx +4 -4
- package/src/preact/components/percent-intput.tsx +2 -3
- package/src/preact/components/resize-container.tsx +23 -0
- package/src/preact/components/table.tsx +1 -0
- package/src/preact/components/tabs.stories.tsx +2 -2
- package/src/preact/components/tabs.tsx +47 -24
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +36 -4
- package/src/preact/dateRangeSelector/date-range-selector.tsx +67 -53
- package/src/preact/locationFilter/location-filter.tsx +2 -2
- package/src/preact/mutationComparison/getMutationComparisonTableData.spec.ts +5 -5
- package/src/preact/mutationComparison/getMutationComparisonTableData.ts +45 -10
- package/src/preact/mutationComparison/mutation-comparison-table.tsx +20 -22
- package/src/preact/mutationComparison/mutation-comparison-venn.tsx +6 -3
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +11 -1
- package/src/preact/mutationComparison/mutation-comparison.tsx +16 -7
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +70 -31
- package/src/preact/mutationFilter/mutation-filter.tsx +62 -14
- package/src/preact/mutations/getInsertionsTableData.spec.ts +6 -4
- package/src/preact/mutations/getInsertionsTableData.ts +1 -1
- package/src/preact/mutations/getMutationsTableData.spec.ts +9 -19
- package/src/preact/mutations/getMutationsTableData.ts +1 -1
- package/src/preact/mutations/mutations-insertions-table.tsx +3 -1
- package/src/preact/mutations/mutations-table.tsx +3 -1
- package/src/preact/mutations/mutations.stories.tsx +11 -1
- package/src/preact/mutations/mutations.tsx +24 -7
- package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +1 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +1 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +1 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +8 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +31 -13
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +8 -5
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +15 -0
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +62 -12
- package/src/preact/shared/sort/sortInsertions.spec.ts +11 -10
- package/src/preact/shared/sort/sortInsertions.ts +10 -17
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.spec.ts +19 -10
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.ts +45 -12
- package/src/preact/textInput/text-input.stories.tsx +22 -1
- package/src/preact/textInput/text-input.tsx +3 -1
- package/src/utils/typeAssertions.spec.ts +31 -0
- package/src/utils/typeAssertions.ts +16 -0
- package/src/web-components/PreactLitAdapter.tsx +0 -1
- package/src/web-components/app.stories.ts +129 -0
- package/src/web-components/app.ts +27 -6
- package/src/web-components/display/aggregate-component.stories.ts +24 -11
- package/src/web-components/display/aggregate-component.tsx +26 -5
- package/src/web-components/display/mutation-comparison-component.stories.ts +32 -11
- package/src/web-components/display/mutation-comparison-component.tsx +79 -4
- package/src/web-components/display/mutations-component.stories.ts +40 -19
- package/src/web-components/display/mutations-component.tsx +71 -4
- package/src/web-components/display/prevalence-over-time-component.stories.ts +44 -18
- package/src/web-components/display/prevalence-over-time-component.tsx +105 -5
- package/src/web-components/display/relative-growth-advantage-component.stories.ts +32 -10
- package/src/web-components/display/relative-growth-advantage-component.tsx +66 -3
- package/src/web-components/input/date-range-selector-component.stories.ts +51 -9
- package/src/web-components/input/date-range-selector-component.tsx +69 -4
- package/src/web-components/input/location-filter-component.stories.ts +15 -4
- package/src/web-components/input/location-filter-component.tsx +2 -6
- package/src/web-components/input/mutation-filter-component.stories.ts +33 -12
- package/src/web-components/input/mutation-filter-component.tsx +60 -4
- package/src/web-components/input/text-input-component.stories.ts +26 -6
- package/src/web-components/input/text-input-component.tsx +34 -3
- package/src/web-components/display/aggregate-component.mdx +0 -25
- package/src/web-components/input/location-filter.mdx +0 -25
package/custom-elements.json
CHANGED
|
@@ -56,12 +56,44 @@
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"kind": "javascript-module",
|
|
59
|
-
"path": "src/web-components/app.ts",
|
|
59
|
+
"path": "src/web-components/app.stories.ts",
|
|
60
60
|
"declarations": [
|
|
61
|
+
{
|
|
62
|
+
"kind": "variable",
|
|
63
|
+
"name": "meta",
|
|
64
|
+
"type": {
|
|
65
|
+
"text": "Meta"
|
|
66
|
+
},
|
|
67
|
+
"default": "{ title: 'Wrapper/App', component: 'gs-app', parameters: withComponentDocs({ fetchMock: {}, componentDocs: { tag: 'gs-app', opensShadowDom: false, expectsChildren: true, codeExample, }, }), decorators: [withActions], tags: ['autodocs'], }"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"kind": "variable",
|
|
71
|
+
"name": "Default",
|
|
72
|
+
"type": {
|
|
73
|
+
"text": "StoryObj<{ lapis: string }>"
|
|
74
|
+
},
|
|
75
|
+
"default": "{ ...Template, play: async ({ canvasElement }) => { const canvas = within(canvasElement); await waitFor(() => { expect(canvas.getByText(LAPIS_URL)).toBeVisible(); expect(canvas.getByText('\"name\": \"ORF1a\",', { exact: false })).toBeVisible(); }); }, }"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"kind": "variable",
|
|
79
|
+
"name": "DelayFetchingReferenceGenome",
|
|
80
|
+
"type": {
|
|
81
|
+
"text": "StoryObj<{ lapis: string }>"
|
|
82
|
+
},
|
|
83
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: { name: 'referenceGenome', url: REFERENCE_GENOME_ENDPOINT, }, response: { status: 200, body: referenceGenome, }, options: { delay: 5000, }, }, ], }, }, }"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"kind": "variable",
|
|
87
|
+
"name": "FailsToFetchReferenceGenome",
|
|
88
|
+
"type": {
|
|
89
|
+
"text": "StoryObj<{ lapis: string }>"
|
|
90
|
+
},
|
|
91
|
+
"default": "{ ...Template, args: { lapis: 'definitely-not-a-valid-url', }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); await waitFor(() => { expect(canvas.getByText('Error')).toBeVisible(); }); }, }"
|
|
92
|
+
},
|
|
61
93
|
{
|
|
62
94
|
"kind": "class",
|
|
63
95
|
"description": "",
|
|
64
|
-
"name": "
|
|
96
|
+
"name": "AppDisplay",
|
|
65
97
|
"members": [
|
|
66
98
|
{
|
|
67
99
|
"kind": "field",
|
|
@@ -69,8 +101,7 @@
|
|
|
69
101
|
"type": {
|
|
70
102
|
"text": "string"
|
|
71
103
|
},
|
|
72
|
-
"default": "''"
|
|
73
|
-
"attribute": "lapis"
|
|
104
|
+
"default": "''"
|
|
74
105
|
},
|
|
75
106
|
{
|
|
76
107
|
"kind": "field",
|
|
@@ -78,17 +109,78 @@
|
|
|
78
109
|
"type": {
|
|
79
110
|
"text": "ReferenceGenome"
|
|
80
111
|
},
|
|
81
|
-
"default": "{
|
|
82
|
-
}
|
|
112
|
+
"default": "{ nucleotideSequences: [], genes: [], }"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"superclass": {
|
|
116
|
+
"name": "LitElement",
|
|
117
|
+
"package": "lit"
|
|
118
|
+
},
|
|
119
|
+
"tagName": "gs-app-display",
|
|
120
|
+
"customElement": true
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"exports": [
|
|
124
|
+
{
|
|
125
|
+
"kind": "js",
|
|
126
|
+
"name": "default",
|
|
127
|
+
"declaration": {
|
|
128
|
+
"name": "meta",
|
|
129
|
+
"module": "src/web-components/app.stories.ts"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"kind": "js",
|
|
134
|
+
"name": "Default",
|
|
135
|
+
"declaration": {
|
|
136
|
+
"name": "Default",
|
|
137
|
+
"module": "src/web-components/app.stories.ts"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"kind": "js",
|
|
142
|
+
"name": "DelayFetchingReferenceGenome",
|
|
143
|
+
"declaration": {
|
|
144
|
+
"name": "DelayFetchingReferenceGenome",
|
|
145
|
+
"module": "src/web-components/app.stories.ts"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"kind": "js",
|
|
150
|
+
"name": "FailsToFetchReferenceGenome",
|
|
151
|
+
"declaration": {
|
|
152
|
+
"name": "FailsToFetchReferenceGenome",
|
|
153
|
+
"module": "src/web-components/app.stories.ts"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"kind": "custom-element-definition",
|
|
158
|
+
"name": "gs-app-display",
|
|
159
|
+
"declaration": {
|
|
160
|
+
"name": "AppDisplay",
|
|
161
|
+
"module": "src/web-components/app.stories.ts"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"kind": "javascript-module",
|
|
168
|
+
"path": "src/web-components/app.ts",
|
|
169
|
+
"declarations": [
|
|
170
|
+
{
|
|
171
|
+
"kind": "class",
|
|
172
|
+
"description": "## Context\n\nThis component provides the main application context.\nAll other `gs-*` components must be (possibly nested) children of this component.\nIt makes use of the [Lit Context](https://lit.dev/docs/data/context/) to\n- provide the URL to the LAPIS instance to all its children\n- fetch the reference genomes from LAPIS and provide it to all its children\n\nThis will show an error message if the reference genome cannot be fetched\n(e.g., due to an invalid LAPIS URL).\n\n## Shadow DOM\n\nThis component does __not__ use a shadow DOM. Children of this component will be rendered directly in the light DOM.",
|
|
173
|
+
"name": "App",
|
|
174
|
+
"members": [
|
|
83
175
|
{
|
|
84
176
|
"kind": "field",
|
|
85
|
-
"name": "
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
"
|
|
177
|
+
"name": "lapis",
|
|
178
|
+
"type": {
|
|
179
|
+
"text": "string"
|
|
180
|
+
},
|
|
181
|
+
"default": "''",
|
|
182
|
+
"description": "The URL of the LAPIS instance that all children of this component will use.",
|
|
183
|
+
"attribute": "lapis"
|
|
92
184
|
}
|
|
93
185
|
],
|
|
94
186
|
"attributes": [
|
|
@@ -98,6 +190,7 @@
|
|
|
98
190
|
"text": "string"
|
|
99
191
|
},
|
|
100
192
|
"default": "''",
|
|
193
|
+
"description": "The URL of the LAPIS instance that all children of this component will use.",
|
|
101
194
|
"fieldName": "lapis"
|
|
102
195
|
}
|
|
103
196
|
],
|
|
@@ -128,12 +221,6 @@
|
|
|
128
221
|
}
|
|
129
222
|
]
|
|
130
223
|
},
|
|
131
|
-
{
|
|
132
|
-
"kind": "javascript-module",
|
|
133
|
-
"path": "src/web-components/display/aggregate-component.mdx",
|
|
134
|
-
"declarations": [],
|
|
135
|
-
"exports": []
|
|
136
|
-
},
|
|
137
224
|
{
|
|
138
225
|
"kind": "javascript-module",
|
|
139
226
|
"path": "src/web-components/display/aggregate-component.stories.ts",
|
|
@@ -144,7 +231,7 @@
|
|
|
144
231
|
"type": {
|
|
145
232
|
"text": "Meta<AggregateProps>"
|
|
146
233
|
},
|
|
147
|
-
"default": "{
|
|
234
|
+
"default": "{ title: 'Visualization/Aggregate', component: 'gs-aggregate-component', 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: { tag: 'gs-aggregate-component', opensShadowDom: true, expectsChildren: false, codeExample: `<gs-aggregate-component fields='[\"division\", \"host\"]' filter='{\"country\": \"USA\"}' views='[\"table\"]'></gs-aggregate-component>`, }, }), tags: ['autodocs'], }"
|
|
148
235
|
},
|
|
149
236
|
{
|
|
150
237
|
"kind": "variable",
|
|
@@ -152,7 +239,7 @@
|
|
|
152
239
|
"type": {
|
|
153
240
|
"text": "StoryObj<AggregateProps>"
|
|
154
241
|
},
|
|
155
|
-
"default": "{
|
|
242
|
+
"default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <gs-aggregate-component .fields=${args.fields} .filter=${args.filter} .views=${args.views} .size=${args.size} .headline=${args.headline} ></gs-aggregate-component> </gs-app> `, args: { fields: ['division', 'host'], views: ['table'], filter: { country: 'USA', }, size: { width: '100%', height: '700px' }, headline: 'Aggregate', }, }"
|
|
156
243
|
}
|
|
157
244
|
],
|
|
158
245
|
"exports": [
|
|
@@ -180,7 +267,7 @@
|
|
|
180
267
|
"declarations": [
|
|
181
268
|
{
|
|
182
269
|
"kind": "class",
|
|
183
|
-
"description": "##
|
|
270
|
+
"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.",
|
|
184
271
|
"name": "AggregateComponent",
|
|
185
272
|
"members": [
|
|
186
273
|
{
|
|
@@ -212,6 +299,26 @@
|
|
|
212
299
|
"default": "{}",
|
|
213
300
|
"description": "The filter to apply to the data.",
|
|
214
301
|
"attribute": "filter"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"kind": "field",
|
|
305
|
+
"name": "size",
|
|
306
|
+
"type": {
|
|
307
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
308
|
+
},
|
|
309
|
+
"default": "undefined",
|
|
310
|
+
"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.",
|
|
311
|
+
"attribute": "size"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"kind": "field",
|
|
315
|
+
"name": "headline",
|
|
316
|
+
"type": {
|
|
317
|
+
"text": "string | undefined"
|
|
318
|
+
},
|
|
319
|
+
"default": "'Aggregate'",
|
|
320
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
321
|
+
"attribute": "headline"
|
|
215
322
|
}
|
|
216
323
|
],
|
|
217
324
|
"attributes": [
|
|
@@ -241,6 +348,24 @@
|
|
|
241
348
|
"default": "{}",
|
|
242
349
|
"description": "The filter to apply to the data.",
|
|
243
350
|
"fieldName": "filter"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"name": "size",
|
|
354
|
+
"type": {
|
|
355
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
356
|
+
},
|
|
357
|
+
"default": "undefined",
|
|
358
|
+
"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.",
|
|
359
|
+
"fieldName": "size"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"name": "headline",
|
|
363
|
+
"type": {
|
|
364
|
+
"text": "string | undefined"
|
|
365
|
+
},
|
|
366
|
+
"default": "'Aggregate'",
|
|
367
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
368
|
+
"fieldName": "headline"
|
|
244
369
|
}
|
|
245
370
|
],
|
|
246
371
|
"superclass": {
|
|
@@ -327,7 +452,7 @@
|
|
|
327
452
|
"type": {
|
|
328
453
|
"text": "Meta<MutationComparisonProps>"
|
|
329
454
|
},
|
|
330
|
-
"default": "{
|
|
455
|
+
"default": "{ title: 'Visualization/Mutation comparison', component: 'gs-mutation-comparison-component', 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: { tag: 'gs-mutation-comparison-component', opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
331
456
|
},
|
|
332
457
|
{
|
|
333
458
|
"kind": "variable",
|
|
@@ -335,7 +460,7 @@
|
|
|
335
460
|
"type": {
|
|
336
461
|
"text": "StoryObj<MutationComparisonProps>"
|
|
337
462
|
},
|
|
338
|
-
"default": "{
|
|
463
|
+
"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-component'); 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)); }); }, }"
|
|
339
464
|
},
|
|
340
465
|
{
|
|
341
466
|
"kind": "variable",
|
|
@@ -343,7 +468,7 @@
|
|
|
343
468
|
"type": {
|
|
344
469
|
"text": "StoryObj<MutationComparisonProps>"
|
|
345
470
|
},
|
|
346
|
-
"default": "{
|
|
471
|
+
"default": "{ ...Default, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-comparison-component'); 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(), ); }); }, }"
|
|
347
472
|
}
|
|
348
473
|
],
|
|
349
474
|
"exports": [
|
|
@@ -379,61 +504,105 @@
|
|
|
379
504
|
"declarations": [
|
|
380
505
|
{
|
|
381
506
|
"kind": "class",
|
|
382
|
-
"description": "",
|
|
507
|
+
"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\".",
|
|
383
508
|
"name": "MutationComparisonComponent",
|
|
384
509
|
"members": [
|
|
385
510
|
{
|
|
386
511
|
"kind": "field",
|
|
387
512
|
"name": "variants",
|
|
388
513
|
"type": {
|
|
389
|
-
"text": "
|
|
514
|
+
"text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
|
|
390
515
|
},
|
|
391
516
|
"default": "[]",
|
|
517
|
+
"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.",
|
|
392
518
|
"attribute": "variants"
|
|
393
519
|
},
|
|
394
520
|
{
|
|
395
521
|
"kind": "field",
|
|
396
522
|
"name": "sequenceType",
|
|
397
523
|
"type": {
|
|
398
|
-
"text": "
|
|
524
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
399
525
|
},
|
|
400
526
|
"default": "'nucleotide'",
|
|
527
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
401
528
|
"attribute": "sequenceType"
|
|
402
529
|
},
|
|
403
530
|
{
|
|
404
531
|
"kind": "field",
|
|
405
532
|
"name": "views",
|
|
406
533
|
"type": {
|
|
407
|
-
"text": "
|
|
534
|
+
"text": "('table' | 'venn')[]"
|
|
408
535
|
},
|
|
409
536
|
"default": "['table']",
|
|
537
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
410
538
|
"attribute": "views"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"kind": "field",
|
|
542
|
+
"name": "size",
|
|
543
|
+
"type": {
|
|
544
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
545
|
+
},
|
|
546
|
+
"default": "undefined",
|
|
547
|
+
"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.",
|
|
548
|
+
"attribute": "size"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"kind": "field",
|
|
552
|
+
"name": "headline",
|
|
553
|
+
"type": {
|
|
554
|
+
"text": "string | undefined"
|
|
555
|
+
},
|
|
556
|
+
"default": "'Mutation comparison'",
|
|
557
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
558
|
+
"attribute": "headline"
|
|
411
559
|
}
|
|
412
560
|
],
|
|
413
561
|
"attributes": [
|
|
414
562
|
{
|
|
415
563
|
"name": "variants",
|
|
416
564
|
"type": {
|
|
417
|
-
"text": "
|
|
565
|
+
"text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
|
|
418
566
|
},
|
|
419
567
|
"default": "[]",
|
|
568
|
+
"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.",
|
|
420
569
|
"fieldName": "variants"
|
|
421
570
|
},
|
|
422
571
|
{
|
|
423
572
|
"name": "sequenceType",
|
|
424
573
|
"type": {
|
|
425
|
-
"text": "
|
|
574
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
426
575
|
},
|
|
427
576
|
"default": "'nucleotide'",
|
|
577
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
428
578
|
"fieldName": "sequenceType"
|
|
429
579
|
},
|
|
430
580
|
{
|
|
431
581
|
"name": "views",
|
|
432
582
|
"type": {
|
|
433
|
-
"text": "
|
|
583
|
+
"text": "('table' | 'venn')[]"
|
|
434
584
|
},
|
|
435
585
|
"default": "['table']",
|
|
586
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
436
587
|
"fieldName": "views"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"name": "size",
|
|
591
|
+
"type": {
|
|
592
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
593
|
+
},
|
|
594
|
+
"default": "undefined",
|
|
595
|
+
"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.",
|
|
596
|
+
"fieldName": "size"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"name": "headline",
|
|
600
|
+
"type": {
|
|
601
|
+
"text": "string | undefined"
|
|
602
|
+
},
|
|
603
|
+
"default": "'Mutation comparison'",
|
|
604
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
605
|
+
"fieldName": "headline"
|
|
437
606
|
}
|
|
438
607
|
],
|
|
439
608
|
"superclass": {
|
|
@@ -473,7 +642,7 @@
|
|
|
473
642
|
"type": {
|
|
474
643
|
"text": "Meta<MutationsProps>"
|
|
475
644
|
},
|
|
476
|
-
"default": "{
|
|
645
|
+
"default": "{ title: 'Visualization/Mutations', component: 'gs-mutations-component', 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: { tag: 'gs-mutations-component', opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
477
646
|
},
|
|
478
647
|
{
|
|
479
648
|
"kind": "variable",
|
|
@@ -481,7 +650,7 @@
|
|
|
481
650
|
"type": {
|
|
482
651
|
"text": "StoryObj<MutationsProps>"
|
|
483
652
|
},
|
|
484
|
-
"default": "{
|
|
653
|
+
"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, }, }, ], }, }, }"
|
|
485
654
|
},
|
|
486
655
|
{
|
|
487
656
|
"kind": "variable",
|
|
@@ -489,7 +658,7 @@
|
|
|
489
658
|
"type": {
|
|
490
659
|
"text": "StoryObj<MutationsProps>"
|
|
491
660
|
},
|
|
492
|
-
"default": "{
|
|
661
|
+
"default": "{ ...Default, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutations-component'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Table' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Table' })); }, }"
|
|
493
662
|
},
|
|
494
663
|
{
|
|
495
664
|
"kind": "variable",
|
|
@@ -497,7 +666,7 @@
|
|
|
497
666
|
"type": {
|
|
498
667
|
"text": "StoryObj<MutationsProps>"
|
|
499
668
|
},
|
|
500
|
-
"default": "{
|
|
669
|
+
"default": "{ ...Default, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutations-component'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Insertions' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Insertions' })); }, }"
|
|
501
670
|
}
|
|
502
671
|
],
|
|
503
672
|
"exports": [
|
|
@@ -541,61 +710,105 @@
|
|
|
541
710
|
"declarations": [
|
|
542
711
|
{
|
|
543
712
|
"kind": "class",
|
|
544
|
-
"description": "",
|
|
713
|
+
"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.",
|
|
545
714
|
"name": "MutationsComponent",
|
|
546
715
|
"members": [
|
|
547
716
|
{
|
|
548
717
|
"kind": "field",
|
|
549
718
|
"name": "variant",
|
|
550
719
|
"type": {
|
|
551
|
-
"text": "
|
|
720
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
552
721
|
},
|
|
553
722
|
"default": "{ displayName: '' }",
|
|
723
|
+
"description": "The `variant` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.",
|
|
554
724
|
"attribute": "variant"
|
|
555
725
|
},
|
|
556
726
|
{
|
|
557
727
|
"kind": "field",
|
|
558
728
|
"name": "sequenceType",
|
|
559
729
|
"type": {
|
|
560
|
-
"text": "
|
|
730
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
561
731
|
},
|
|
562
732
|
"default": "'nucleotide'",
|
|
733
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
563
734
|
"attribute": "sequenceType"
|
|
564
735
|
},
|
|
565
736
|
{
|
|
566
737
|
"kind": "field",
|
|
567
738
|
"name": "views",
|
|
568
739
|
"type": {
|
|
569
|
-
"text": "
|
|
740
|
+
"text": "('table' | 'grid' | 'insertions')[]"
|
|
570
741
|
},
|
|
571
742
|
"default": "['table', 'grid']",
|
|
743
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
572
744
|
"attribute": "views"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"kind": "field",
|
|
748
|
+
"name": "size",
|
|
749
|
+
"type": {
|
|
750
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
751
|
+
},
|
|
752
|
+
"default": "undefined",
|
|
753
|
+
"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.",
|
|
754
|
+
"attribute": "size"
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"kind": "field",
|
|
758
|
+
"name": "headline",
|
|
759
|
+
"type": {
|
|
760
|
+
"text": "string | undefined"
|
|
761
|
+
},
|
|
762
|
+
"default": "'Mutations'",
|
|
763
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
764
|
+
"attribute": "headline"
|
|
573
765
|
}
|
|
574
766
|
],
|
|
575
767
|
"attributes": [
|
|
576
768
|
{
|
|
577
769
|
"name": "variant",
|
|
578
770
|
"type": {
|
|
579
|
-
"text": "
|
|
771
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
580
772
|
},
|
|
581
773
|
"default": "{ displayName: '' }",
|
|
774
|
+
"description": "The `variant` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.",
|
|
582
775
|
"fieldName": "variant"
|
|
583
776
|
},
|
|
584
777
|
{
|
|
585
778
|
"name": "sequenceType",
|
|
586
779
|
"type": {
|
|
587
|
-
"text": "
|
|
780
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
588
781
|
},
|
|
589
782
|
"default": "'nucleotide'",
|
|
783
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
590
784
|
"fieldName": "sequenceType"
|
|
591
785
|
},
|
|
592
786
|
{
|
|
593
787
|
"name": "views",
|
|
594
788
|
"type": {
|
|
595
|
-
"text": "
|
|
789
|
+
"text": "('table' | 'grid' | 'insertions')[]"
|
|
596
790
|
},
|
|
597
791
|
"default": "['table', 'grid']",
|
|
792
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
598
793
|
"fieldName": "views"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "size",
|
|
797
|
+
"type": {
|
|
798
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
799
|
+
},
|
|
800
|
+
"default": "undefined",
|
|
801
|
+
"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.",
|
|
802
|
+
"fieldName": "size"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
"name": "headline",
|
|
806
|
+
"type": {
|
|
807
|
+
"text": "string | undefined"
|
|
808
|
+
},
|
|
809
|
+
"default": "'Mutations'",
|
|
810
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
811
|
+
"fieldName": "headline"
|
|
599
812
|
}
|
|
600
813
|
],
|
|
601
814
|
"superclass": {
|
|
@@ -635,7 +848,7 @@
|
|
|
635
848
|
"type": {
|
|
636
849
|
"text": "Meta<PrevalenceOverTimeProps>"
|
|
637
850
|
},
|
|
638
|
-
"default": "{
|
|
851
|
+
"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: { tag: 'gs-prevalence-over-time', opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
639
852
|
},
|
|
640
853
|
{
|
|
641
854
|
"kind": "variable",
|
|
@@ -643,7 +856,7 @@
|
|
|
643
856
|
"type": {
|
|
644
857
|
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
645
858
|
},
|
|
646
|
-
"default": "{
|
|
859
|
+
"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, }, }, ], }, }, }"
|
|
647
860
|
},
|
|
648
861
|
{
|
|
649
862
|
"kind": "variable",
|
|
@@ -651,7 +864,7 @@
|
|
|
651
864
|
"type": {
|
|
652
865
|
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
653
866
|
},
|
|
654
|
-
"default": "{
|
|
867
|
+
"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, }, }, ], }, }, }"
|
|
655
868
|
},
|
|
656
869
|
{
|
|
657
870
|
"kind": "variable",
|
|
@@ -659,7 +872,7 @@
|
|
|
659
872
|
"type": {
|
|
660
873
|
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
661
874
|
},
|
|
662
|
-
"default": "{
|
|
875
|
+
"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' })); }, }"
|
|
663
876
|
},
|
|
664
877
|
{
|
|
665
878
|
"kind": "variable",
|
|
@@ -667,7 +880,7 @@
|
|
|
667
880
|
"type": {
|
|
668
881
|
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
669
882
|
},
|
|
670
|
-
"default": "{
|
|
883
|
+
"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' })); }, }"
|
|
671
884
|
},
|
|
672
885
|
{
|
|
673
886
|
"kind": "variable",
|
|
@@ -675,7 +888,7 @@
|
|
|
675
888
|
"type": {
|
|
676
889
|
"text": "StoryObj<PrevalenceOverTimeProps>"
|
|
677
890
|
},
|
|
678
|
-
"default": "{
|
|
891
|
+
"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' })); }, }"
|
|
679
892
|
}
|
|
680
893
|
],
|
|
681
894
|
"exports": [
|
|
@@ -735,34 +948,37 @@
|
|
|
735
948
|
"declarations": [
|
|
736
949
|
{
|
|
737
950
|
"kind": "class",
|
|
738
|
-
"description": "",
|
|
951
|
+
"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.",
|
|
739
952
|
"name": "PrevalenceOverTimeComponent",
|
|
740
953
|
"members": [
|
|
741
954
|
{
|
|
742
955
|
"kind": "field",
|
|
743
956
|
"name": "numerator",
|
|
744
957
|
"type": {
|
|
745
|
-
"text": "
|
|
958
|
+
"text": "| (Record<string, string | number | null | boolean> & { displayName: string })\n | (Record<string, string | number | null | boolean> & {\n displayName: string;\n })[]"
|
|
746
959
|
},
|
|
747
960
|
"default": "{ displayName: '' }",
|
|
961
|
+
"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.",
|
|
748
962
|
"attribute": "numerator"
|
|
749
963
|
},
|
|
750
964
|
{
|
|
751
965
|
"kind": "field",
|
|
752
966
|
"name": "denominator",
|
|
753
967
|
"type": {
|
|
754
|
-
"text": "
|
|
968
|
+
"text": "Record<string, string | number | null | boolean> & { displayName: string }"
|
|
755
969
|
},
|
|
756
970
|
"default": "{ displayName: '' }",
|
|
971
|
+
"description": "The variant that the variants in `numerator` are compared to.",
|
|
757
972
|
"attribute": "denominator"
|
|
758
973
|
},
|
|
759
974
|
{
|
|
760
975
|
"kind": "field",
|
|
761
976
|
"name": "granularity",
|
|
762
977
|
"type": {
|
|
763
|
-
"text": "
|
|
978
|
+
"text": "'day' | 'week' | 'month' | 'year'"
|
|
764
979
|
},
|
|
765
980
|
"default": "'day'",
|
|
981
|
+
"description": "The granularity of the time axis.",
|
|
766
982
|
"attribute": "granularity"
|
|
767
983
|
},
|
|
768
984
|
{
|
|
@@ -772,50 +988,76 @@
|
|
|
772
988
|
"text": "number"
|
|
773
989
|
},
|
|
774
990
|
"default": "0",
|
|
991
|
+
"description": "The number of time steps to use for smoothing the data.\n`0` means no smoothing.\nMust be a non-negative integer.\n\nFor a given time, the shown value is the mean of the neighbouring measured values.\nThe `smoothingWindow` value provides the number of neighbouring values to take into account.\nThe resulting time is computed via `Math.floor(smoothingWindow / 2)`.",
|
|
775
992
|
"attribute": "smoothingWindow"
|
|
776
993
|
},
|
|
777
994
|
{
|
|
778
995
|
"kind": "field",
|
|
779
996
|
"name": "views",
|
|
780
997
|
"type": {
|
|
781
|
-
"text": "
|
|
998
|
+
"text": "('bar' | 'line' | 'bubble' | 'table')[]"
|
|
782
999
|
},
|
|
783
1000
|
"default": "['bar', 'line', 'bubble', 'table']",
|
|
1001
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
784
1002
|
"attribute": "views"
|
|
785
1003
|
},
|
|
786
1004
|
{
|
|
787
1005
|
"kind": "field",
|
|
788
1006
|
"name": "confidenceIntervalMethods",
|
|
789
1007
|
"type": {
|
|
790
|
-
"text": "
|
|
1008
|
+
"text": "('wilson' | 'none')[]"
|
|
791
1009
|
},
|
|
792
1010
|
"default": "['wilson']",
|
|
1011
|
+
"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.",
|
|
793
1012
|
"attribute": "confidenceIntervalMethods"
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"kind": "field",
|
|
1016
|
+
"name": "headline",
|
|
1017
|
+
"type": {
|
|
1018
|
+
"text": "string | undefined"
|
|
1019
|
+
},
|
|
1020
|
+
"default": "'Prevalence over time'",
|
|
1021
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1022
|
+
"attribute": "headline"
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"kind": "field",
|
|
1026
|
+
"name": "size",
|
|
1027
|
+
"type": {
|
|
1028
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1029
|
+
},
|
|
1030
|
+
"default": "undefined",
|
|
1031
|
+
"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.",
|
|
1032
|
+
"attribute": "size"
|
|
794
1033
|
}
|
|
795
1034
|
],
|
|
796
1035
|
"attributes": [
|
|
797
1036
|
{
|
|
798
1037
|
"name": "numerator",
|
|
799
1038
|
"type": {
|
|
800
|
-
"text": "
|
|
1039
|
+
"text": "| (Record<string, string | number | null | boolean> & { displayName: string })\n | (Record<string, string | number | null | boolean> & {\n displayName: string;\n })[]"
|
|
801
1040
|
},
|
|
802
1041
|
"default": "{ displayName: '' }",
|
|
1042
|
+
"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.",
|
|
803
1043
|
"fieldName": "numerator"
|
|
804
1044
|
},
|
|
805
1045
|
{
|
|
806
1046
|
"name": "denominator",
|
|
807
1047
|
"type": {
|
|
808
|
-
"text": "
|
|
1048
|
+
"text": "Record<string, string | number | null | boolean> & { displayName: string }"
|
|
809
1049
|
},
|
|
810
1050
|
"default": "{ displayName: '' }",
|
|
1051
|
+
"description": "The variant that the variants in `numerator` are compared to.",
|
|
811
1052
|
"fieldName": "denominator"
|
|
812
1053
|
},
|
|
813
1054
|
{
|
|
814
1055
|
"name": "granularity",
|
|
815
1056
|
"type": {
|
|
816
|
-
"text": "
|
|
1057
|
+
"text": "'day' | 'week' | 'month' | 'year'"
|
|
817
1058
|
},
|
|
818
1059
|
"default": "'day'",
|
|
1060
|
+
"description": "The granularity of the time axis.",
|
|
819
1061
|
"fieldName": "granularity"
|
|
820
1062
|
},
|
|
821
1063
|
{
|
|
@@ -824,23 +1066,44 @@
|
|
|
824
1066
|
"text": "number"
|
|
825
1067
|
},
|
|
826
1068
|
"default": "0",
|
|
1069
|
+
"description": "The number of time steps to use for smoothing the data.\n`0` means no smoothing.\nMust be a non-negative integer.\n\nFor a given time, the shown value is the mean of the neighbouring measured values.\nThe `smoothingWindow` value provides the number of neighbouring values to take into account.\nThe resulting time is computed via `Math.floor(smoothingWindow / 2)`.",
|
|
827
1070
|
"fieldName": "smoothingWindow"
|
|
828
1071
|
},
|
|
829
1072
|
{
|
|
830
1073
|
"name": "views",
|
|
831
1074
|
"type": {
|
|
832
|
-
"text": "
|
|
1075
|
+
"text": "('bar' | 'line' | 'bubble' | 'table')[]"
|
|
833
1076
|
},
|
|
834
1077
|
"default": "['bar', 'line', 'bubble', 'table']",
|
|
1078
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
835
1079
|
"fieldName": "views"
|
|
836
1080
|
},
|
|
837
1081
|
{
|
|
838
1082
|
"name": "confidenceIntervalMethods",
|
|
839
1083
|
"type": {
|
|
840
|
-
"text": "
|
|
1084
|
+
"text": "('wilson' | 'none')[]"
|
|
841
1085
|
},
|
|
842
1086
|
"default": "['wilson']",
|
|
1087
|
+
"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.",
|
|
843
1088
|
"fieldName": "confidenceIntervalMethods"
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
"name": "headline",
|
|
1092
|
+
"type": {
|
|
1093
|
+
"text": "string | undefined"
|
|
1094
|
+
},
|
|
1095
|
+
"default": "'Prevalence over time'",
|
|
1096
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1097
|
+
"fieldName": "headline"
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
"name": "size",
|
|
1101
|
+
"type": {
|
|
1102
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1103
|
+
},
|
|
1104
|
+
"default": "undefined",
|
|
1105
|
+
"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.",
|
|
1106
|
+
"fieldName": "size"
|
|
844
1107
|
}
|
|
845
1108
|
],
|
|
846
1109
|
"superclass": {
|
|
@@ -880,7 +1143,7 @@
|
|
|
880
1143
|
"type": {
|
|
881
1144
|
"text": "Meta<RelativeGrowthAdvantageProps>"
|
|
882
1145
|
},
|
|
883
|
-
"default": "{
|
|
1146
|
+
"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: { tag: 'gs-relative-growth-advantage', opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
884
1147
|
},
|
|
885
1148
|
{
|
|
886
1149
|
"kind": "variable",
|
|
@@ -888,7 +1151,7 @@
|
|
|
888
1151
|
"type": {
|
|
889
1152
|
"text": "StoryObj<RelativeGrowthAdvantageProps>"
|
|
890
1153
|
},
|
|
891
|
-
"default": "{
|
|
1154
|
+
"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, }, }, ], }, }, }"
|
|
892
1155
|
}
|
|
893
1156
|
],
|
|
894
1157
|
"exports": [
|
|
@@ -916,25 +1179,27 @@
|
|
|
916
1179
|
"declarations": [
|
|
917
1180
|
{
|
|
918
1181
|
"kind": "class",
|
|
919
|
-
"description": "",
|
|
1182
|
+
"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.",
|
|
920
1183
|
"name": "RelativeGrowthAdvantageComponent",
|
|
921
1184
|
"members": [
|
|
922
1185
|
{
|
|
923
1186
|
"kind": "field",
|
|
924
1187
|
"name": "numerator",
|
|
925
1188
|
"type": {
|
|
926
|
-
"text": "
|
|
1189
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
927
1190
|
},
|
|
928
1191
|
"default": "{}",
|
|
1192
|
+
"description": "The LAPIS filter for the focal variant.",
|
|
929
1193
|
"attribute": "numerator"
|
|
930
1194
|
},
|
|
931
1195
|
{
|
|
932
1196
|
"kind": "field",
|
|
933
1197
|
"name": "denominator",
|
|
934
1198
|
"type": {
|
|
935
|
-
"text": "
|
|
1199
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
936
1200
|
},
|
|
937
1201
|
"default": "{}",
|
|
1202
|
+
"description": "The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
|
|
938
1203
|
"attribute": "denominator"
|
|
939
1204
|
},
|
|
940
1205
|
{
|
|
@@ -944,33 +1209,57 @@
|
|
|
944
1209
|
"text": "number"
|
|
945
1210
|
},
|
|
946
1211
|
"default": "7",
|
|
1212
|
+
"description": "The generation time represents the number of days over which the variant's relative growth advantage is measured.\nFor example, if we set a generation time of 7 days, then we estimate the growth advantage per week.",
|
|
947
1213
|
"attribute": "generationTime"
|
|
948
1214
|
},
|
|
949
1215
|
{
|
|
950
1216
|
"kind": "field",
|
|
951
1217
|
"name": "views",
|
|
952
1218
|
"type": {
|
|
953
|
-
"text": "
|
|
1219
|
+
"text": "'line'[]"
|
|
954
1220
|
},
|
|
955
1221
|
"default": "['line']",
|
|
1222
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
956
1223
|
"attribute": "views"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"kind": "field",
|
|
1227
|
+
"name": "headline",
|
|
1228
|
+
"type": {
|
|
1229
|
+
"text": "string | undefined"
|
|
1230
|
+
},
|
|
1231
|
+
"default": "'Relative growth advantage'",
|
|
1232
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1233
|
+
"attribute": "headline"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"kind": "field",
|
|
1237
|
+
"name": "size",
|
|
1238
|
+
"type": {
|
|
1239
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1240
|
+
},
|
|
1241
|
+
"default": "undefined",
|
|
1242
|
+
"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.",
|
|
1243
|
+
"attribute": "size"
|
|
957
1244
|
}
|
|
958
1245
|
],
|
|
959
1246
|
"attributes": [
|
|
960
1247
|
{
|
|
961
1248
|
"name": "numerator",
|
|
962
1249
|
"type": {
|
|
963
|
-
"text": "
|
|
1250
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
964
1251
|
},
|
|
965
1252
|
"default": "{}",
|
|
1253
|
+
"description": "The LAPIS filter for the focal variant.",
|
|
966
1254
|
"fieldName": "numerator"
|
|
967
1255
|
},
|
|
968
1256
|
{
|
|
969
1257
|
"name": "denominator",
|
|
970
1258
|
"type": {
|
|
971
|
-
"text": "
|
|
1259
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
972
1260
|
},
|
|
973
1261
|
"default": "{}",
|
|
1262
|
+
"description": "The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.",
|
|
974
1263
|
"fieldName": "denominator"
|
|
975
1264
|
},
|
|
976
1265
|
{
|
|
@@ -979,15 +1268,35 @@
|
|
|
979
1268
|
"text": "number"
|
|
980
1269
|
},
|
|
981
1270
|
"default": "7",
|
|
1271
|
+
"description": "The generation time represents the number of days over which the variant's relative growth advantage is measured.\nFor example, if we set a generation time of 7 days, then we estimate the growth advantage per week.",
|
|
982
1272
|
"fieldName": "generationTime"
|
|
983
1273
|
},
|
|
984
1274
|
{
|
|
985
1275
|
"name": "views",
|
|
986
1276
|
"type": {
|
|
987
|
-
"text": "
|
|
1277
|
+
"text": "'line'[]"
|
|
988
1278
|
},
|
|
989
1279
|
"default": "['line']",
|
|
1280
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
990
1281
|
"fieldName": "views"
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
"name": "headline",
|
|
1285
|
+
"type": {
|
|
1286
|
+
"text": "string | undefined"
|
|
1287
|
+
},
|
|
1288
|
+
"default": "'Relative growth advantage'",
|
|
1289
|
+
"description": "The headline of the component. Set to an empty string to hide the headline.",
|
|
1290
|
+
"fieldName": "headline"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
"name": "size",
|
|
1294
|
+
"type": {
|
|
1295
|
+
"text": "{ width?: string; height?: string } | undefined"
|
|
1296
|
+
},
|
|
1297
|
+
"default": "undefined",
|
|
1298
|
+
"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.",
|
|
1299
|
+
"fieldName": "size"
|
|
991
1300
|
}
|
|
992
1301
|
],
|
|
993
1302
|
"superclass": {
|
|
@@ -1056,17 +1365,17 @@
|
|
|
1056
1365
|
"kind": "variable",
|
|
1057
1366
|
"name": "meta",
|
|
1058
1367
|
"type": {
|
|
1059
|
-
"text": "Meta<DateRangeSelectorProps
|
|
1368
|
+
"text": "Meta<DateRangeSelectorProps<'CustomDateRange'>>"
|
|
1060
1369
|
},
|
|
1061
|
-
"default": "{
|
|
1370
|
+
"default": "{ title: 'Input/DateRangeSelector', component: 'gs-date-range-selector', parameters: withComponentDocs({ actions: { handles: ['gs-date-range-changed'], }, fetchMock: {}, componentDocs: { tag: 'gs-date-range-selector', 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', ], }, }, args: { customSelectOptions: [{ label: 'CustomDateRange', dateFrom: '2021-01-01', dateTo: '2021-12-31' }], earliestDate: '1970-01-01', initialValue: PRESET_VALUE_LAST_6_MONTHS, }, decorators: [withActions], tags: ['autodocs'], }"
|
|
1062
1371
|
},
|
|
1063
1372
|
{
|
|
1064
1373
|
"kind": "variable",
|
|
1065
1374
|
"name": "DateRangeSelectorStory",
|
|
1066
1375
|
"type": {
|
|
1067
|
-
"text": "StoryObj<DateRangeSelectorProps
|
|
1376
|
+
"text": "StoryObj<DateRangeSelectorProps<'CustomDateRange'>>"
|
|
1068
1377
|
},
|
|
1069
|
-
"default": "{
|
|
1378
|
+
"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} ></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())); }); }); }, }"
|
|
1070
1379
|
}
|
|
1071
1380
|
],
|
|
1072
1381
|
"exports": [
|
|
@@ -1094,16 +1403,17 @@
|
|
|
1094
1403
|
"declarations": [
|
|
1095
1404
|
{
|
|
1096
1405
|
"kind": "class",
|
|
1097
|
-
"description": "",
|
|
1406
|
+
"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.",
|
|
1098
1407
|
"name": "DateRangeSelectorComponent",
|
|
1099
1408
|
"members": [
|
|
1100
1409
|
{
|
|
1101
1410
|
"kind": "field",
|
|
1102
1411
|
"name": "customSelectOptions",
|
|
1103
1412
|
"type": {
|
|
1104
|
-
"text": "
|
|
1413
|
+
"text": "{ label: string; dateFrom: string; dateTo: string }[]"
|
|
1105
1414
|
},
|
|
1106
1415
|
"default": "[]",
|
|
1416
|
+
"description": "An array of custom options that the select field should provide,\nin addition to the predefined options.\nThe `label` will be shown to the user, and it will be available as `initialValue`.\nThe dates must be in the format `YYYY-MM-DD`.",
|
|
1107
1417
|
"attribute": "customSelectOptions"
|
|
1108
1418
|
},
|
|
1109
1419
|
{
|
|
@@ -1113,7 +1423,18 @@
|
|
|
1113
1423
|
"text": "string | undefined"
|
|
1114
1424
|
},
|
|
1115
1425
|
"default": "'1900-01-01'",
|
|
1426
|
+
"description": "The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.",
|
|
1116
1427
|
"attribute": "earliestDate"
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
"kind": "field",
|
|
1431
|
+
"name": "initialValue",
|
|
1432
|
+
"type": {
|
|
1433
|
+
"text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string\n | undefined"
|
|
1434
|
+
},
|
|
1435
|
+
"default": "'last6Months'",
|
|
1436
|
+
"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'`.",
|
|
1437
|
+
"attribute": "initialValue"
|
|
1117
1438
|
}
|
|
1118
1439
|
],
|
|
1119
1440
|
"events": [
|
|
@@ -1121,7 +1442,7 @@
|
|
|
1121
1442
|
"type": {
|
|
1122
1443
|
"text": "CustomEvent<{ dateFrom: string; dateTo: string; }>"
|
|
1123
1444
|
},
|
|
1124
|
-
"description": "
|
|
1445
|
+
"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`.",
|
|
1125
1446
|
"name": "gs-date-range-changed"
|
|
1126
1447
|
}
|
|
1127
1448
|
],
|
|
@@ -1129,9 +1450,10 @@
|
|
|
1129
1450
|
{
|
|
1130
1451
|
"name": "customSelectOptions",
|
|
1131
1452
|
"type": {
|
|
1132
|
-
"text": "
|
|
1453
|
+
"text": "{ label: string; dateFrom: string; dateTo: string }[]"
|
|
1133
1454
|
},
|
|
1134
1455
|
"default": "[]",
|
|
1456
|
+
"description": "An array of custom options that the select field should provide,\nin addition to the predefined options.\nThe `label` will be shown to the user, and it will be available as `initialValue`.\nThe dates must be in the format `YYYY-MM-DD`.",
|
|
1135
1457
|
"fieldName": "customSelectOptions"
|
|
1136
1458
|
},
|
|
1137
1459
|
{
|
|
@@ -1140,7 +1462,17 @@
|
|
|
1140
1462
|
"text": "string | undefined"
|
|
1141
1463
|
},
|
|
1142
1464
|
"default": "'1900-01-01'",
|
|
1465
|
+
"description": "The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.",
|
|
1143
1466
|
"fieldName": "earliestDate"
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
"name": "initialValue",
|
|
1470
|
+
"type": {
|
|
1471
|
+
"text": "'custom'\n | 'allTimes'\n | 'last2Weeks'\n | 'lastMonth'\n | 'last2Months'\n | 'last3Months'\n | 'last6Months'\n | string\n | undefined"
|
|
1472
|
+
},
|
|
1473
|
+
"default": "'last6Months'",
|
|
1474
|
+
"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'`.",
|
|
1475
|
+
"fieldName": "initialValue"
|
|
1144
1476
|
}
|
|
1145
1477
|
],
|
|
1146
1478
|
"superclass": {
|
|
@@ -1219,7 +1551,7 @@
|
|
|
1219
1551
|
"type": {
|
|
1220
1552
|
"text": "Meta"
|
|
1221
1553
|
},
|
|
1222
|
-
"default": "{
|
|
1554
|
+
"default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: ['gs-location-changed'], }, componentDocs: { tag: 'gs-location-filter', opensShadowDom: true, expectsChildren: false, codeExample: `<gs-location-filter fields=\"['continent', 'country']\" value='Europe / Switzerland'></gs-location-filter>`, }, }), decorators: [withActions], tags: ['autodocs'], }"
|
|
1223
1555
|
},
|
|
1224
1556
|
{
|
|
1225
1557
|
"kind": "variable",
|
|
@@ -1227,7 +1559,7 @@
|
|
|
1227
1559
|
"type": {
|
|
1228
1560
|
"text": "StoryObj<LocationFilterProps>"
|
|
1229
1561
|
},
|
|
1230
|
-
"default": "{
|
|
1562
|
+
"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(); }); }, }"
|
|
1231
1563
|
},
|
|
1232
1564
|
{
|
|
1233
1565
|
"kind": "variable",
|
|
@@ -1235,7 +1567,7 @@
|
|
|
1235
1567
|
"type": {
|
|
1236
1568
|
"text": "StoryObj<LocationFilterProps>"
|
|
1237
1569
|
},
|
|
1238
|
-
"default": "{
|
|
1570
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: aggregatedEndpointMatcher, response: { status: 200, body: data, }, options: { delay: 5000, }, }, ], }, }, }"
|
|
1239
1571
|
},
|
|
1240
1572
|
{
|
|
1241
1573
|
"kind": "variable",
|
|
@@ -1243,7 +1575,7 @@
|
|
|
1243
1575
|
"type": {
|
|
1244
1576
|
"text": "StoryObj<LocationFilterProps>"
|
|
1245
1577
|
},
|
|
1246
|
-
"default": "{
|
|
1578
|
+
"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('Bad Request: {\"error\":\"no data\"} ', { exact: false })).toBeInTheDocument(), ); }, }"
|
|
1247
1579
|
},
|
|
1248
1580
|
{
|
|
1249
1581
|
"kind": "variable",
|
|
@@ -1251,7 +1583,7 @@
|
|
|
1251
1583
|
"type": {
|
|
1252
1584
|
"text": "StoryObj<LocationFilterProps>"
|
|
1253
1585
|
},
|
|
1254
|
-
"default": "{
|
|
1586
|
+
"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', }, }), ); }); }, }"
|
|
1255
1587
|
}
|
|
1256
1588
|
],
|
|
1257
1589
|
"exports": [
|
|
@@ -1303,18 +1635,18 @@
|
|
|
1303
1635
|
"declarations": [
|
|
1304
1636
|
{
|
|
1305
1637
|
"kind": "class",
|
|
1306
|
-
"description": "##
|
|
1638
|
+
"description": "## Context\n\nThis component provides an input field to specify filters for locations.\n\nIt expects a list of fields that form a strict hierarchical order, such as continent, country, and city.\nThe component retrieves a list of all possible values for these fields from the Lapis instance.\nThis list is then utilized to display autocomplete suggestions and to validate the input.\n\nGiven `fields` are `['field1', 'field2', ..., 'fieldN']`,\nthen valid values for the location filter must be in the form `valueForField1 / valueForField2 / ... / valueForFieldK`,\nwhere `1 <= K <= N`.\nValues for the fields `i > K` are considered `undefined`.",
|
|
1307
1639
|
"name": "LocationFilterComponent",
|
|
1308
1640
|
"members": [
|
|
1309
1641
|
{
|
|
1310
1642
|
"kind": "field",
|
|
1311
|
-
"name": "
|
|
1643
|
+
"name": "initialValue",
|
|
1312
1644
|
"type": {
|
|
1313
1645
|
"text": "string"
|
|
1314
1646
|
},
|
|
1315
1647
|
"default": "''",
|
|
1316
1648
|
"description": "The initial value to use for this location filter.\nMust be of the form `valueForField1 / valueForField2 / ... / valueForFieldN`.",
|
|
1317
|
-
"attribute": "
|
|
1649
|
+
"attribute": "initialValue"
|
|
1318
1650
|
},
|
|
1319
1651
|
{
|
|
1320
1652
|
"kind": "field",
|
|
@@ -1338,13 +1670,13 @@
|
|
|
1338
1670
|
],
|
|
1339
1671
|
"attributes": [
|
|
1340
1672
|
{
|
|
1341
|
-
"name": "
|
|
1673
|
+
"name": "initialValue",
|
|
1342
1674
|
"type": {
|
|
1343
1675
|
"text": "string"
|
|
1344
1676
|
},
|
|
1345
1677
|
"default": "''",
|
|
1346
1678
|
"description": "The initial value to use for this location filter.\nMust be of the form `valueForField1 / valueForField2 / ... / valueForFieldN`.",
|
|
1347
|
-
"fieldName": "
|
|
1679
|
+
"fieldName": "initialValue"
|
|
1348
1680
|
},
|
|
1349
1681
|
{
|
|
1350
1682
|
"name": "fields",
|
|
@@ -1383,12 +1715,6 @@
|
|
|
1383
1715
|
}
|
|
1384
1716
|
]
|
|
1385
1717
|
},
|
|
1386
|
-
{
|
|
1387
|
-
"kind": "javascript-module",
|
|
1388
|
-
"path": "src/web-components/input/location-filter.mdx",
|
|
1389
|
-
"declarations": [],
|
|
1390
|
-
"exports": []
|
|
1391
|
-
},
|
|
1392
1718
|
{
|
|
1393
1719
|
"kind": "javascript-module",
|
|
1394
1720
|
"path": "src/web-components/input/mutation-filter-component.stories.ts",
|
|
@@ -1397,33 +1723,33 @@
|
|
|
1397
1723
|
"kind": "variable",
|
|
1398
1724
|
"name": "meta",
|
|
1399
1725
|
"type": {
|
|
1400
|
-
"text": "Meta"
|
|
1726
|
+
"text": "Meta<MutationFilterProps>"
|
|
1401
1727
|
},
|
|
1402
|
-
"default": "{
|
|
1728
|
+
"default": "{ title: 'Input/Mutation filter', component: 'gs-mutation-filter', parameters: withComponentDocs({ actions: { handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur'], }, fetchMock: {}, componentDocs: { tag: 'gs-mutation-filter', opensShadowDom: true, expectsChildren: false, codeExample, }, }), decorators: [withActions], tags: ['autodocs'], }"
|
|
1403
1729
|
},
|
|
1404
1730
|
{
|
|
1405
1731
|
"kind": "variable",
|
|
1406
1732
|
"name": "Default",
|
|
1407
1733
|
"type": {
|
|
1408
|
-
"text": "StoryObj<
|
|
1734
|
+
"text": "StoryObj<MutationFilterProps>"
|
|
1409
1735
|
},
|
|
1410
|
-
"default": "{
|
|
1736
|
+
"default": "{ ...Template, args: { initialValue: ['A123T'], }, }"
|
|
1411
1737
|
},
|
|
1412
1738
|
{
|
|
1413
1739
|
"kind": "variable",
|
|
1414
1740
|
"name": "FiresFilterChangedEvent",
|
|
1415
1741
|
"type": {
|
|
1416
|
-
"text": "StoryObj<
|
|
1742
|
+
"text": "StoryObj<MutationFilterProps>"
|
|
1417
1743
|
},
|
|
1418
|
-
"default": "{
|
|
1744
|
+
"default": "{ ...Template, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-filter'); const inputField = () => canvas.getByPlaceholderText('Enter a mutation', { exact: false }); const submitButton = () => canvas.getByRole('button', { name: '+' }); const listenerMock = fn(); await step('Setup event listener mock', async () => { canvasElement.addEventListener('gs-mutation-filter-changed', listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Enter a valid mutation', async () => { await userEvent.type(inputField(), 'A123T'); await waitFor(() => submitButton().click()); await waitFor(() => expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { nucleotideMutations: ['A123T'], aminoAcidMutations: [], nucleotideInsertions: [], aminoAcidInsertions: [], }, }), ), ); }); }, }"
|
|
1419
1745
|
},
|
|
1420
1746
|
{
|
|
1421
1747
|
"kind": "variable",
|
|
1422
1748
|
"name": "FiresFilterOnBlurEvent",
|
|
1423
1749
|
"type": {
|
|
1424
|
-
"text": "StoryObj<
|
|
1750
|
+
"text": "StoryObj<MutationFilterProps>"
|
|
1425
1751
|
},
|
|
1426
|
-
"default": "{
|
|
1752
|
+
"default": "{ ...Template, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-filter'); const inputField = () => canvas.getByPlaceholderText('Enter a mutation', { exact: false }); const listenerMock = fn(); await step('Setup event listener mock', async () => { canvasElement.addEventListener('gs-mutation-filter-on-blur', listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Move outside of input', async () => { await userEvent.type(inputField(), 'A123T'); await userEvent.tab(); await expect(listenerMock).toHaveBeenCalled(); }); }, }"
|
|
1427
1753
|
}
|
|
1428
1754
|
],
|
|
1429
1755
|
"exports": [
|
|
@@ -1467,25 +1793,47 @@
|
|
|
1467
1793
|
"declarations": [
|
|
1468
1794
|
{
|
|
1469
1795
|
"kind": "class",
|
|
1470
|
-
"description": "",
|
|
1796
|
+
"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",
|
|
1471
1797
|
"name": "MutationFilterComponent",
|
|
1472
|
-
"members": [
|
|
1798
|
+
"members": [
|
|
1799
|
+
{
|
|
1800
|
+
"kind": "field",
|
|
1801
|
+
"name": "initialValue",
|
|
1802
|
+
"type": {
|
|
1803
|
+
"text": "SelectedMutationFilterStrings | string[] | undefined"
|
|
1804
|
+
},
|
|
1805
|
+
"default": "undefined",
|
|
1806
|
+
"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.",
|
|
1807
|
+
"attribute": "initialValue"
|
|
1808
|
+
}
|
|
1809
|
+
],
|
|
1473
1810
|
"events": [
|
|
1474
1811
|
{
|
|
1475
1812
|
"type": {
|
|
1476
|
-
"text": "CustomEvent<
|
|
1813
|
+
"text": "CustomEvent<{nucleotideMutations: string[],aminoAcidMutations: string[],nucleotideInsertions: string[],aminoAcidInsertions: string[]}>"
|
|
1477
1814
|
},
|
|
1478
|
-
"description": "
|
|
1815
|
+
"description": "Fired when: - The user has submitted a valid mutation or insertion - The user has removed a mutation or insertion",
|
|
1479
1816
|
"name": "gs-mutation-filter-changed"
|
|
1480
1817
|
},
|
|
1481
1818
|
{
|
|
1482
1819
|
"type": {
|
|
1483
|
-
"text": "CustomEvent<
|
|
1820
|
+
"text": "CustomEvent<{nucleotideMutations: string[],aminoAcidMutations: string[],nucleotideInsertions: string[],aminoAcidInsertions: string[]}>"
|
|
1484
1821
|
},
|
|
1485
|
-
"description": "
|
|
1822
|
+
"description": "Fired when: - the mutation filter has lost focus Contains the selected mutations in the format",
|
|
1486
1823
|
"name": "gs-mutation-filter-on-blur"
|
|
1487
1824
|
}
|
|
1488
1825
|
],
|
|
1826
|
+
"attributes": [
|
|
1827
|
+
{
|
|
1828
|
+
"name": "initialValue",
|
|
1829
|
+
"type": {
|
|
1830
|
+
"text": "SelectedMutationFilterStrings | string[] | undefined"
|
|
1831
|
+
},
|
|
1832
|
+
"default": "undefined",
|
|
1833
|
+
"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.",
|
|
1834
|
+
"fieldName": "initialValue"
|
|
1835
|
+
}
|
|
1836
|
+
],
|
|
1489
1837
|
"superclass": {
|
|
1490
1838
|
"name": "PreactLitAdapter",
|
|
1491
1839
|
"module": "/src/web-components/PreactLitAdapter"
|
|
@@ -1521,25 +1869,25 @@
|
|
|
1521
1869
|
"kind": "variable",
|
|
1522
1870
|
"name": "meta",
|
|
1523
1871
|
"type": {
|
|
1524
|
-
"text": "Meta"
|
|
1872
|
+
"text": "Meta<TextInputProps>"
|
|
1525
1873
|
},
|
|
1526
|
-
"default": "{
|
|
1874
|
+
"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: { tag: 'gs-text-input', opensShadowDom: true, expectsChildren: false, codeExample, }, }), decorators: [withActions], tags: ['autodocs'], }"
|
|
1527
1875
|
},
|
|
1528
1876
|
{
|
|
1529
1877
|
"kind": "variable",
|
|
1530
1878
|
"name": "Default",
|
|
1531
1879
|
"type": {
|
|
1532
|
-
"text": "StoryObj<
|
|
1880
|
+
"text": "StoryObj<TextInputProps>"
|
|
1533
1881
|
},
|
|
1534
|
-
"default": "{
|
|
1882
|
+
"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} ></gs-text-input> </div> </gs-app>`; }, args: { lapisField: 'host', placeholderText: 'Enter host name', initialValue: 'Homo sapiens', }, }"
|
|
1535
1883
|
},
|
|
1536
1884
|
{
|
|
1537
1885
|
"kind": "variable",
|
|
1538
1886
|
"name": "FiresEvent",
|
|
1539
1887
|
"type": {
|
|
1540
|
-
"text": "StoryObj<
|
|
1888
|
+
"text": "StoryObj<TextInputProps>"
|
|
1541
1889
|
},
|
|
1542
|
-
"default": "{
|
|
1890
|
+
"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: '', }, }"
|
|
1543
1891
|
}
|
|
1544
1892
|
],
|
|
1545
1893
|
"exports": [
|
|
@@ -1575,9 +1923,19 @@
|
|
|
1575
1923
|
"declarations": [
|
|
1576
1924
|
{
|
|
1577
1925
|
"kind": "class",
|
|
1578
|
-
"description": "",
|
|
1926
|
+
"description": "\n## Context\n\nThis component provides a text input field to specify filters for arbitrary fields of this Lapis instance.",
|
|
1579
1927
|
"name": "TextInputComponent",
|
|
1580
1928
|
"members": [
|
|
1929
|
+
{
|
|
1930
|
+
"kind": "field",
|
|
1931
|
+
"name": "initialValue",
|
|
1932
|
+
"type": {
|
|
1933
|
+
"text": "string | undefined"
|
|
1934
|
+
},
|
|
1935
|
+
"default": "''",
|
|
1936
|
+
"description": "The initial value to use for this text input.",
|
|
1937
|
+
"attribute": "initialValue"
|
|
1938
|
+
},
|
|
1581
1939
|
{
|
|
1582
1940
|
"kind": "field",
|
|
1583
1941
|
"name": "lapisField",
|
|
@@ -1585,15 +1943,17 @@
|
|
|
1585
1943
|
"text": "string"
|
|
1586
1944
|
},
|
|
1587
1945
|
"default": "''",
|
|
1946
|
+
"description": "The Lapis field name to use for this text input.",
|
|
1588
1947
|
"attribute": "lapisField"
|
|
1589
1948
|
},
|
|
1590
1949
|
{
|
|
1591
1950
|
"kind": "field",
|
|
1592
1951
|
"name": "placeholderText",
|
|
1593
1952
|
"type": {
|
|
1594
|
-
"text": "string"
|
|
1953
|
+
"text": "string | undefined"
|
|
1595
1954
|
},
|
|
1596
1955
|
"default": "''",
|
|
1956
|
+
"description": "The placeholder text to display in the input field.",
|
|
1597
1957
|
"attribute": "placeholderText"
|
|
1598
1958
|
}
|
|
1599
1959
|
],
|
|
@@ -1602,25 +1962,36 @@
|
|
|
1602
1962
|
"type": {
|
|
1603
1963
|
"text": "CustomEvent<Record<string, string>>"
|
|
1604
1964
|
},
|
|
1605
|
-
"description": "
|
|
1965
|
+
"description": "Fired when the input field is changed. The `details` of this event contain an object with the `lapisField` as key and the input value as value. Example: ``` { \"host\": \"Homo sapiens\" } ```",
|
|
1606
1966
|
"name": "gs-text-input-changed"
|
|
1607
1967
|
}
|
|
1608
1968
|
],
|
|
1609
1969
|
"attributes": [
|
|
1970
|
+
{
|
|
1971
|
+
"name": "initialValue",
|
|
1972
|
+
"type": {
|
|
1973
|
+
"text": "string | undefined"
|
|
1974
|
+
},
|
|
1975
|
+
"default": "''",
|
|
1976
|
+
"description": "The initial value to use for this text input.",
|
|
1977
|
+
"fieldName": "initialValue"
|
|
1978
|
+
},
|
|
1610
1979
|
{
|
|
1611
1980
|
"name": "lapisField",
|
|
1612
1981
|
"type": {
|
|
1613
1982
|
"text": "string"
|
|
1614
1983
|
},
|
|
1615
1984
|
"default": "''",
|
|
1985
|
+
"description": "The Lapis field name to use for this text input.",
|
|
1616
1986
|
"fieldName": "lapisField"
|
|
1617
1987
|
},
|
|
1618
1988
|
{
|
|
1619
1989
|
"name": "placeholderText",
|
|
1620
1990
|
"type": {
|
|
1621
|
-
"text": "string"
|
|
1991
|
+
"text": "string | undefined"
|
|
1622
1992
|
},
|
|
1623
1993
|
"default": "''",
|
|
1994
|
+
"description": "The placeholder text to display in the input field.",
|
|
1624
1995
|
"fieldName": "placeholderText"
|
|
1625
1996
|
}
|
|
1626
1997
|
],
|