@genspectrum/dashboard-components 0.6.13 → 0.6.15
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/README.md +29 -0
- package/custom-elements.json +23 -17
- package/dist/dashboard-components.js +8237 -37898
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +26 -8
- package/dist/style.css +3 -3
- package/package.json +9 -8
- package/src/index.ts +8 -0
- package/src/lapisApi/lapisApi.ts +15 -7
- package/src/operator/FetchAggregatedOperator.ts +2 -7
- package/src/preact/components/color-scale-selector-dropdown.stories.tsx +1 -1
- package/src/preact/components/error-boundary.stories.tsx +21 -4
- package/src/preact/components/error-display.stories.tsx +20 -2
- package/src/preact/components/error-display.tsx +64 -10
- package/src/preact/components/info.stories.tsx +5 -5
- package/src/preact/components/info.tsx +2 -4
- package/src/preact/components/percent-intput.tsx +7 -2
- package/src/preact/components/proportion-selector.tsx +12 -2
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +2 -3
- package/src/preact/dateRangeSelector/date-range-selector.tsx +4 -4
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +2 -3
- package/src/preact/lineageFilter/lineage-filter.tsx +2 -2
- package/src/preact/locationFilter/fetchAutocompletionList.ts +1 -14
- package/src/preact/locationFilter/location-filter.stories.tsx +2 -3
- package/src/preact/locationFilter/location-filter.tsx +2 -2
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +2 -3
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_01.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_02.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_03.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_04.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_05.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_06.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_07.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations_total.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json +13 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +56 -8
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +4 -2
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +135 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +3 -3
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +1 -1
- package/src/preact/shared/floating-ui/hooks.ts +1 -1
- package/src/preact/textInput/text-input.stories.tsx +2 -3
- package/src/preact/textInput/text-input.tsx +2 -2
- package/src/query/queryMutationsOverTime.spec.ts +210 -64
- package/src/query/queryMutationsOverTime.ts +10 -2
- package/src/web-components/app.stories.ts +0 -2
- package/src/web-components/errorHandling.mdx +8 -0
- package/src/web-components/input/gs-date-range-selector.stories.ts +2 -3
- package/src/web-components/input/gs-date-range-selector.tsx +24 -4
- package/src/web-components/input/gs-lineage-filter.stories.ts +2 -3
- package/src/web-components/input/gs-lineage-filter.tsx +15 -1
- package/src/web-components/input/gs-location-filter.stories.ts +2 -3
- package/src/web-components/input/gs-location-filter.tsx +13 -1
- package/src/web-components/input/gs-mutation-filter.stories.ts +2 -3
- package/src/web-components/input/gs-mutation-filter.tsx +1 -0
- package/src/web-components/input/gs-text-input.stories.ts +2 -3
- package/src/web-components/input/gs-text-input.tsx +13 -1
- package/src/web-components/visualization/gs-aggregate.tsx +17 -1
- package/src/web-components/visualization/gs-mutation-comparison.tsx +9 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +271 -0
- package/src/web-components/visualization/gs-mutations-over-time.tsx +7 -0
- package/src/web-components/visualization/gs-mutations.tsx +11 -5
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +15 -0
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -9
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +26 -8
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +43 -5
- package/standalone-bundle/dashboard-components.js +30920 -0
- package/standalone-bundle/dashboard-components.js.map +1 -0
|
@@ -12,8 +12,8 @@ import { useQuery } from '../useQuery';
|
|
|
12
12
|
|
|
13
13
|
export interface LineageFilterInnerProps {
|
|
14
14
|
lapisField: string;
|
|
15
|
-
placeholderText
|
|
16
|
-
initialValue
|
|
15
|
+
placeholderText: string;
|
|
16
|
+
initialValue: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface LineageFilterProps extends LineageFilterInnerProps {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { LapisError } from '../../lapisApi/lapisApi';
|
|
2
1
|
import { FetchAggregatedOperator } from '../../operator/FetchAggregatedOperator';
|
|
3
|
-
import { UserFacingError } from '../components/error-display';
|
|
4
2
|
|
|
5
3
|
export async function fetchAutocompletionList(fields: string[], lapis: string, signal?: AbortSignal) {
|
|
6
4
|
const toAncestorInHierarchyOverwriteValues = Array(fields.length - 1)
|
|
@@ -10,18 +8,7 @@ export async function fetchAutocompletionList(fields: string[], lapis: string, s
|
|
|
10
8
|
|
|
11
9
|
const fetchAggregatedOperator = new FetchAggregatedOperator<Record<string, string | null>>({}, fields);
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
data = (await fetchAggregatedOperator.evaluate(lapis, signal)).content;
|
|
16
|
-
} catch (error) {
|
|
17
|
-
if (error instanceof LapisError) {
|
|
18
|
-
throw new UserFacingError(
|
|
19
|
-
`Failed to fetch autocomplete list from LAPIS: ${error.problemDetail.status} ${error.problemDetail.title ?? ''}`,
|
|
20
|
-
error.problemDetail.detail ?? error.message,
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
throw error;
|
|
24
|
-
}
|
|
11
|
+
const data = (await fetchAggregatedOperator.evaluate(lapis, signal)).content;
|
|
25
12
|
|
|
26
13
|
const locationValues = data
|
|
27
14
|
.map((entry) => fields.reduce((acc, field) => ({ ...acc, [field]: entry[field] }), {}))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
1
|
import { type Meta, type StoryObj } from '@storybook/preact';
|
|
3
2
|
|
|
4
3
|
import data from './__mockData__/aggregated.json';
|
|
5
4
|
import { LocationFilter, type LocationFilterProps } from './location-filter';
|
|
5
|
+
import { previewHandles } from '../../../.storybook/preview';
|
|
6
6
|
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
|
|
7
7
|
import { LapisUrlContext } from '../LapisUrlContext';
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ const meta: Meta<LocationFilterProps> = {
|
|
|
28
28
|
],
|
|
29
29
|
},
|
|
30
30
|
actions: {
|
|
31
|
-
handles: ['gs-location-changed'],
|
|
31
|
+
handles: ['gs-location-changed', ...previewHandles],
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
args: {
|
|
@@ -59,7 +59,6 @@ const meta: Meta<LocationFilterProps> = {
|
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
|
-
decorators: [withActions],
|
|
63
62
|
};
|
|
64
63
|
|
|
65
64
|
export default meta;
|
|
@@ -11,8 +11,8 @@ import { ResizeContainer } from '../components/resize-container';
|
|
|
11
11
|
import { useQuery } from '../useQuery';
|
|
12
12
|
|
|
13
13
|
export interface LocationFilterInnerProps {
|
|
14
|
-
initialValue
|
|
15
|
-
placeholderText
|
|
14
|
+
initialValue: string;
|
|
15
|
+
placeholderText: string;
|
|
16
16
|
fields: string[];
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
1
|
import { type Meta, type PreactRenderer, type StoryObj } from '@storybook/preact';
|
|
3
2
|
import { expect, fireEvent, fn, userEvent, waitFor, within } from '@storybook/test';
|
|
4
3
|
import { type StepFunction } from '@storybook/types';
|
|
5
4
|
|
|
6
5
|
import { MutationFilter, type MutationFilterProps } from './mutation-filter';
|
|
6
|
+
import { previewHandles } from '../../../.storybook/preview';
|
|
7
7
|
import { LAPIS_URL } from '../../constants';
|
|
8
8
|
import referenceGenome from '../../lapisApi/__mockData__/referenceGenome.json';
|
|
9
9
|
import { LapisUrlContext } from '../LapisUrlContext';
|
|
@@ -14,7 +14,7 @@ const meta: Meta<MutationFilterProps> = {
|
|
|
14
14
|
component: MutationFilter,
|
|
15
15
|
parameters: {
|
|
16
16
|
actions: {
|
|
17
|
-
handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur'],
|
|
17
|
+
handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur', ...previewHandles],
|
|
18
18
|
},
|
|
19
19
|
fetchMock: {},
|
|
20
20
|
},
|
|
@@ -26,7 +26,6 @@ const meta: Meta<MutationFilterProps> = {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
-
decorators: [withActions],
|
|
30
29
|
};
|
|
31
30
|
|
|
32
31
|
export default meta;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 25800
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 16673
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 7931
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 2947
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 2424
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 2890
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 0
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 456
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 533
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 1107
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 1020
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 880
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 832
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 635
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 503198
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 5213
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 5311
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 5264
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 4954
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"info": {
|
|
8
|
+
"dataVersion": "1722452937",
|
|
9
|
+
"requestId": "aede768e-d9d1-4273-9a74-992986554995",
|
|
10
|
+
"requestInfo": "sars_cov-2_nextstrain_open on lapis.cov-spectrum.org at 2024-08-02T06:57:09.319474043",
|
|
11
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -15,10 +15,12 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
15
15
|
data.set(new Substitution('someSegment', 'A', 'T', 123), yearMonthDay('2021-01-01'), {
|
|
16
16
|
count: 1,
|
|
17
17
|
proportion: 0.1,
|
|
18
|
+
totalCount: 10,
|
|
18
19
|
});
|
|
19
20
|
data.set(new Substitution('someOtherSegment', 'A', 'T', 123), yearMonthDay('2021-01-01'), {
|
|
20
21
|
count: 2,
|
|
21
22
|
proportion: 0.2,
|
|
23
|
+
totalCount: 10,
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
filterDisplayedSegments(
|
|
@@ -41,10 +43,12 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
41
43
|
data.set(new Substitution('someSegment', 'A', 'T', 123), yearMonthDay('2021-01-01'), {
|
|
42
44
|
count: 1,
|
|
43
45
|
proportion: 0.1,
|
|
46
|
+
totalCount: 10,
|
|
44
47
|
});
|
|
45
48
|
data.set(new Deletion('someOtherSegment', 'A', 123), yearMonthDay('2021-01-01'), {
|
|
46
49
|
count: 2,
|
|
47
50
|
proportion: 0.2,
|
|
51
|
+
totalCount: 10,
|
|
48
52
|
});
|
|
49
53
|
|
|
50
54
|
filterMutationTypes(
|
|
@@ -76,7 +80,13 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
76
80
|
|
|
77
81
|
filterProportion(data, getOverallMutationData(belowFilter), proportionInterval);
|
|
78
82
|
|
|
79
|
-
expect(
|
|
83
|
+
expect(
|
|
84
|
+
data.getAsArray({
|
|
85
|
+
count: 0,
|
|
86
|
+
proportion: 0,
|
|
87
|
+
totalCount: 10,
|
|
88
|
+
}),
|
|
89
|
+
).to.toHaveLength(0);
|
|
80
90
|
});
|
|
81
91
|
|
|
82
92
|
it('should remove mutations where overall proportion is above filter', () => {
|
|
@@ -84,7 +94,13 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
84
94
|
|
|
85
95
|
filterProportion(data, getOverallMutationData(aboveFilter), proportionInterval);
|
|
86
96
|
|
|
87
|
-
expect(
|
|
97
|
+
expect(
|
|
98
|
+
data.getAsArray({
|
|
99
|
+
count: 0,
|
|
100
|
+
proportion: 0,
|
|
101
|
+
totalCount: 10,
|
|
102
|
+
}),
|
|
103
|
+
).to.toHaveLength(0);
|
|
88
104
|
});
|
|
89
105
|
|
|
90
106
|
it('should remove mutations where overall proportion is missing', () => {
|
|
@@ -92,7 +108,13 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
92
108
|
|
|
93
109
|
filterProportion(data, getOverallMutationData(aboveFilter, someOtherMutation), proportionInterval);
|
|
94
110
|
|
|
95
|
-
expect(
|
|
111
|
+
expect(
|
|
112
|
+
data.getAsArray({
|
|
113
|
+
count: 0,
|
|
114
|
+
proportion: 0,
|
|
115
|
+
totalCount: 10,
|
|
116
|
+
}),
|
|
117
|
+
).to.toHaveLength(0);
|
|
96
118
|
});
|
|
97
119
|
|
|
98
120
|
it('should not remove mutation where overall proportion is at lower border of filter', () => {
|
|
@@ -100,7 +122,13 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
100
122
|
|
|
101
123
|
filterProportion(data, getOverallMutationData(inFilter), proportionInterval);
|
|
102
124
|
|
|
103
|
-
expect(
|
|
125
|
+
expect(
|
|
126
|
+
data.getRow(someSubstitution, {
|
|
127
|
+
count: 0,
|
|
128
|
+
proportion: 0,
|
|
129
|
+
totalCount: 10,
|
|
130
|
+
}),
|
|
131
|
+
).to.toHaveLength(2);
|
|
104
132
|
});
|
|
105
133
|
|
|
106
134
|
it('should not remove mutation where overall proportion is within filter', () => {
|
|
@@ -108,7 +136,13 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
108
136
|
|
|
109
137
|
filterProportion(data, getOverallMutationData(inFilter), proportionInterval);
|
|
110
138
|
|
|
111
|
-
expect(
|
|
139
|
+
expect(
|
|
140
|
+
data.getRow(someSubstitution, {
|
|
141
|
+
count: 0,
|
|
142
|
+
proportion: 0,
|
|
143
|
+
totalCount: 10,
|
|
144
|
+
}),
|
|
145
|
+
).to.toHaveLength(2);
|
|
112
146
|
});
|
|
113
147
|
|
|
114
148
|
it('should not remove mutation where overall proportion is at upper border of filter', () => {
|
|
@@ -116,13 +150,27 @@ describe('getFilteredMutationOverTimeData', () => {
|
|
|
116
150
|
|
|
117
151
|
filterProportion(data, getOverallMutationData(inFilter), proportionInterval);
|
|
118
152
|
|
|
119
|
-
expect(
|
|
153
|
+
expect(
|
|
154
|
+
data.getRow(someSubstitution, {
|
|
155
|
+
count: 0,
|
|
156
|
+
proportion: 0,
|
|
157
|
+
totalCount: 10,
|
|
158
|
+
}),
|
|
159
|
+
).to.toHaveLength(2);
|
|
120
160
|
});
|
|
121
161
|
|
|
122
162
|
function getMutationOverTimeData() {
|
|
123
163
|
const data = new Map2dBase<Substitution | Deletion, Temporal, MutationOverTimeMutationValue>();
|
|
124
|
-
data.set(someSubstitution, yearMonthDay('2021-01-01'), {
|
|
125
|
-
|
|
164
|
+
data.set(someSubstitution, yearMonthDay('2021-01-01'), {
|
|
165
|
+
count: 1,
|
|
166
|
+
proportion: 0.1,
|
|
167
|
+
totalCount: 10,
|
|
168
|
+
});
|
|
169
|
+
data.set(someSubstitution, yearMonthDay('2021-02-02'), {
|
|
170
|
+
count: 99,
|
|
171
|
+
proportion: 0.99,
|
|
172
|
+
totalCount: 10,
|
|
173
|
+
});
|
|
126
174
|
return data;
|
|
127
175
|
}
|
|
128
176
|
|
|
@@ -56,7 +56,7 @@ const MutationsOverTimeGrid: FunctionComponent<MutationsOverTimeGridProps> = ({
|
|
|
56
56
|
<MutationCell mutation={mutation} />
|
|
57
57
|
</div>
|
|
58
58
|
{dates.map((date, columnIndex) => {
|
|
59
|
-
const value = data.get(mutation, date) ?? { proportion: 0, count: 0 };
|
|
59
|
+
const value = data.get(mutation, date) ?? { proportion: 0, count: 0, totalCount: 0 };
|
|
60
60
|
const tooltipPosition = getTooltipPosition(
|
|
61
61
|
rowIndex,
|
|
62
62
|
shownMutations.length,
|
|
@@ -136,7 +136,9 @@ const ProportionCell: FunctionComponent<{
|
|
|
136
136
|
<p>({timeIntervalDisplay(date)})</p>
|
|
137
137
|
<p>{mutation.code}</p>
|
|
138
138
|
<p>Proportion: {formatProportion(value.proportion)}</p>
|
|
139
|
-
<p>
|
|
139
|
+
<p>
|
|
140
|
+
Count: {value.count} / {value.totalCount} total
|
|
141
|
+
</p>
|
|
140
142
|
</div>
|
|
141
143
|
);
|
|
142
144
|
|