@genspectrum/dashboard-components 0.11.6 → 0.11.7
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 +38 -3
- package/dist/assets/{mutationOverTimeWorker-CWneD7i5.js.map → mutationOverTimeWorker-DTv93Ere.js.map} +1 -1
- package/dist/components.d.ts +50 -16
- package/dist/components.js +129 -66
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +44 -16
- package/package.json +1 -1
- package/src/preact/mutations/__mockData__/baselineNucleotideMutations.json +337412 -0
- package/src/preact/mutations/__mockData__/overallVariantCount.json +14 -0
- package/src/preact/mutations/getMutationsTableData.spec.ts +20 -3
- package/src/preact/mutations/getMutationsTableData.ts +37 -2
- package/src/preact/mutations/mutations-table.tsx +47 -27
- package/src/preact/mutations/mutations.stories.tsx +41 -9
- package/src/preact/mutations/mutations.tsx +22 -6
- package/src/preact/mutations/queryMutations.ts +28 -8
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +11077 -3062
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +3883 -6606
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +17624 -2203
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +1 -1
- package/src/query/queryMutationsOverTime.spec.ts +144 -4
- package/src/query/queryMutationsOverTime.ts +17 -1
- package/src/web-components/visualization/gs-mutations.stories.ts +62 -4
- package/src/web-components/visualization/gs-mutations.tsx +44 -0
- package/standalone-bundle/assets/{mutationOverTimeWorker-x1ipPFL0.js.map → mutationOverTimeWorker-DEybsZ5r.js.map} +1 -1
- package/standalone-bundle/dashboard-components.js +2515 -2464
- package/standalone-bundle/dashboard-components.js.map +1 -1
package/custom-elements.json
CHANGED
|
@@ -2120,7 +2120,7 @@
|
|
|
2120
2120
|
"type": {
|
|
2121
2121
|
"text": "Meta<Required<MutationsProps>>"
|
|
2122
2122
|
},
|
|
2123
|
-
"default": "{ title: 'Visualization/Mutations', component: 'gs-mutations', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'grid', 'insertions'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, pageSize: { control: 'object' }, }, args: { lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' }, sequenceType: 'nucleotide', views: ['grid', 'table', 'insertions'], width: '100%', height: '700px', pageSize: 10, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
2123
|
+
"default": "{ title: 'Visualization/Mutations', component: 'gs-mutations', argTypes: { lapisFilter: { control: 'object' }, baselineLapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['table', 'grid', 'insertions'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, pageSize: { control: 'object' }, }, args: { lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' }, baselineLapisFilter: { country: 'Switzerland', dateTo: '2022-01-01' }, sequenceType: 'nucleotide', views: ['grid', 'table', 'insertions'], width: '100%', height: '700px', pageSize: 10, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
2124
2124
|
},
|
|
2125
2125
|
{
|
|
2126
2126
|
"kind": "variable",
|
|
@@ -2128,7 +2128,7 @@
|
|
|
2128
2128
|
"type": {
|
|
2129
2129
|
"text": "StoryObj<Required<MutationsProps>>"
|
|
2130
2130
|
},
|
|
2131
|
-
"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, }, }, ], }, }, }"
|
|
2131
|
+
"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: 'baselineNucleotideMutations', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { country: 'Switzerland', dateTo: '2022-01-01', minProportion: 0, }, }, response: { status: 200, body: baselineNucleotideMutations, }, }, { matcher: { name: 'overallVariantCount', url: AGGREGATED_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01', fields: [], }, }, response: { status: 200, body: overallVariantCount, }, }, { matcher: { name: 'nucleotideInsertions', url: NUCLEOTIDE_INSERTIONS_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' }, }, response: { status: 200, body: nucleotideInsertions, }, }, ], }, }, }"
|
|
2132
2132
|
},
|
|
2133
2133
|
{
|
|
2134
2134
|
"kind": "variable",
|
|
@@ -2138,6 +2138,14 @@
|
|
|
2138
2138
|
},
|
|
2139
2139
|
"default": "{ ...Default, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutations'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Table' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Table' })); }, }"
|
|
2140
2140
|
},
|
|
2141
|
+
{
|
|
2142
|
+
"kind": "variable",
|
|
2143
|
+
"name": "OnTableTabWithoutJaccardSimilarity",
|
|
2144
|
+
"type": {
|
|
2145
|
+
"text": "StoryObj<Required<MutationsProps>>"
|
|
2146
|
+
},
|
|
2147
|
+
"default": "{ ...Default, args: { ...Default.args, baselineLapisFilter: undefined, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-mutations'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Table' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Table' })); }, }"
|
|
2148
|
+
},
|
|
2141
2149
|
{
|
|
2142
2150
|
"kind": "variable",
|
|
2143
2151
|
"name": "OnInsertionsTab",
|
|
@@ -2172,6 +2180,14 @@
|
|
|
2172
2180
|
"module": "src/web-components/visualization/gs-mutations.stories.ts"
|
|
2173
2181
|
}
|
|
2174
2182
|
},
|
|
2183
|
+
{
|
|
2184
|
+
"kind": "js",
|
|
2185
|
+
"name": "OnTableTabWithoutJaccardSimilarity",
|
|
2186
|
+
"declaration": {
|
|
2187
|
+
"name": "OnTableTabWithoutJaccardSimilarity",
|
|
2188
|
+
"module": "src/web-components/visualization/gs-mutations.stories.ts"
|
|
2189
|
+
}
|
|
2190
|
+
},
|
|
2175
2191
|
{
|
|
2176
2192
|
"kind": "js",
|
|
2177
2193
|
"name": "OnInsertionsTab",
|
|
@@ -2188,7 +2204,7 @@
|
|
|
2188
2204
|
"declarations": [
|
|
2189
2205
|
{
|
|
2190
2206
|
"kind": "class",
|
|
2191
|
-
"description": "## Context\n\nThis component displays mutations (substitutions, deletions and insertions) for a dataset selected by a LAPIS filter.\n\n## Views\n\n### Table View\n\nThe table view shows all substitutions and deletions for the dataset.\nIt shows the type (substitution or deletion), the total count of the mutation\nand the proportion of the mutation in the dataset.\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 dataset.",
|
|
2207
|
+
"description": "## Context\n\nThis component displays mutations (substitutions, deletions and insertions) for a dataset selected by a LAPIS filter.\n\n## Views\n\n### Table View\n\nThe table view shows all substitutions and deletions for the dataset.\nIt shows the type (substitution or deletion), the total count of the mutation\nand the proportion of the mutation in the dataset.\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#### Jaccard Similarity\n\nIf the `baselineLapisFilter` attribute is set,\nthe [Jaccard similarity](https://en.wikipedia.org/wiki/Jaccard_index) is computed for each mutation.\nIt is computed as `variantWithMutationCount / (variantCount + mutationCount - variantWithMutationCount)`,\n- `variantCount` is the number of sequences of the variant (i.e. the number of sequences that match the `lapisFilter`),\n- `mutationCount` is the number of sequences with the mutation\n (i.e. the number of sequences matching the `baselineLapisFilter` that have the mutation),\n- `variantWithMutationCount` is the number of sequences that belong to the variant and have the mutation\n (i.e. the `count` value that is shown in the table).\n\nTypically, this is useful when you query mutations of a certain \"variant\"\n(i.e. a certain lineage or a certain set of mutations).\nThen the `baselineLapisFilter` should be the `lapisFilter` but without the lineage or mutations.\n\nFor example:\nYou are interested in a certain lineage in a certain country: `lapisFilter={country: 'Switzerland', linage: 'XY.1.2.3'}`.\nThen the \"baseline\" should be the same filter but without the lineage: `baselineLapisFilter={country: 'Switzerland'}`.\n\nComputing the Jaccard similarity is not always meaningful, because you might not have a \"variant\"\n(e.g. when you only query for a certain country).\nIn this case you can simply omit the `baselineLapisFilter`.\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 dataset.",
|
|
2192
2208
|
"name": "MutationsComponent",
|
|
2193
2209
|
"members": [
|
|
2194
2210
|
{
|
|
@@ -2201,6 +2217,16 @@
|
|
|
2201
2217
|
"description": "LAPIS filter to select the displayed data. If not provided, all data is displayed.",
|
|
2202
2218
|
"attribute": "lapisFilter"
|
|
2203
2219
|
},
|
|
2220
|
+
{
|
|
2221
|
+
"kind": "field",
|
|
2222
|
+
"name": "baselineLapisFilter",
|
|
2223
|
+
"type": {
|
|
2224
|
+
"text": "(Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n })\n | undefined"
|
|
2225
|
+
},
|
|
2226
|
+
"default": "undefined",
|
|
2227
|
+
"description": "LAPIS filter to select the mutation counts that are used to compute the Jaccard similarity.\nIf not provided, the Jaccard similarity is not computed.\nFor details, see the [Jaccard Similarity](#jaccard-similarity) section in the component description.",
|
|
2228
|
+
"attribute": "baselineLapisFilter"
|
|
2229
|
+
},
|
|
2204
2230
|
{
|
|
2205
2231
|
"kind": "field",
|
|
2206
2232
|
"name": "sequenceType",
|
|
@@ -2262,6 +2288,15 @@
|
|
|
2262
2288
|
"description": "LAPIS filter to select the displayed data. If not provided, all data is displayed.",
|
|
2263
2289
|
"fieldName": "lapisFilter"
|
|
2264
2290
|
},
|
|
2291
|
+
{
|
|
2292
|
+
"name": "baselineLapisFilter",
|
|
2293
|
+
"type": {
|
|
2294
|
+
"text": "(Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n })\n | undefined"
|
|
2295
|
+
},
|
|
2296
|
+
"default": "undefined",
|
|
2297
|
+
"description": "LAPIS filter to select the mutation counts that are used to compute the Jaccard similarity.\nIf not provided, the Jaccard similarity is not computed.\nFor details, see the [Jaccard Similarity](#jaccard-similarity) section in the component description.",
|
|
2298
|
+
"fieldName": "baselineLapisFilter"
|
|
2299
|
+
},
|
|
2265
2300
|
{
|
|
2266
2301
|
"name": "sequenceType",
|
|
2267
2302
|
"type": {
|