@genspectrum/dashboard-components 0.6.2 → 0.6.3
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 +220 -0
- package/dist/dashboard-components.js +602 -178
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +63 -0
- package/dist/style.css +7 -4
- package/package.json +3 -1
- package/src/constants.ts +1 -1
- package/src/lapisApi/lapisTypes.ts +1 -0
- package/src/operator/FillMissingOperator.spec.ts +3 -1
- package/src/operator/FillMissingOperator.ts +4 -2
- package/src/preact/mutationComparison/queryMutationData.ts +12 -4
- package/src/preact/mutationsOverTime/__mockData__/aggregated_date.json +642 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_01.json +1747 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_02.json +1774 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_03.json +1819 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_04.json +1864 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_05.json +1927 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_06.json +1864 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_07.json +9 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +86 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +62 -0
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +92 -0
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +206 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +170 -0
- package/src/preact/numberSequencesOverTime/getNumberOfSequencesOverTimeTableData.ts +1 -1
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +1 -0
- package/src/preact/shared/table/formatProportion.ts +2 -2
- package/src/query/queryAggregatedDataOverTime.ts +8 -33
- package/src/query/queryMutationsOverTime.spec.ts +352 -0
- package/src/query/queryMutationsOverTime.ts +164 -0
- package/src/query/queryNumberOfSequencesOverTime.ts +0 -1
- package/src/query/queryRelativeGrowthAdvantage.ts +3 -3
- package/src/utils/Map2d.ts +75 -0
- package/src/utils/map2d.spec.ts +94 -0
- package/src/utils/mutations.ts +5 -1
- package/src/utils/temporal.ts +64 -5
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +225 -0
- package/src/web-components/visualization/gs-mutations-over-time.tsx +107 -0
- package/src/web-components/visualization/index.ts +1 -0
package/custom-elements.json
CHANGED
|
@@ -1777,6 +1777,218 @@
|
|
|
1777
1777
|
}
|
|
1778
1778
|
]
|
|
1779
1779
|
},
|
|
1780
|
+
{
|
|
1781
|
+
"kind": "javascript-module",
|
|
1782
|
+
"path": "src/web-components/visualization/gs-mutations-over-time.stories.ts",
|
|
1783
|
+
"declarations": [
|
|
1784
|
+
{
|
|
1785
|
+
"kind": "variable",
|
|
1786
|
+
"name": "meta",
|
|
1787
|
+
"type": {
|
|
1788
|
+
"text": "Meta<Required<MutationsOverTimeProps>>"
|
|
1789
|
+
},
|
|
1790
|
+
"default": "{ title: 'Visualization/Mutations over time', component: 'gs-mutations-over-time', argTypes: { lapisFilter: { control: 'object' }, sequenceType: { options: ['nucleotide', 'amino acid'], control: { type: 'radio' }, }, views: { options: ['grid'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, lapisDateField: { control: 'text' }, }, args: { lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10' }, sequenceType: 'nucleotide', views: ['grid'], width: '100%', height: '700px', granularity: 'month', lapisDateField: 'date', }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
"kind": "variable",
|
|
1794
|
+
"name": "Default",
|
|
1795
|
+
"type": {
|
|
1796
|
+
"text": "StoryObj<Required<MutationsOverTimeProps>>"
|
|
1797
|
+
},
|
|
1798
|
+
"default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregated_dates', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-15', dateTo: '2024-07-10', fields: ['date'], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_date, }, }, { matcher: { name: 'nucleotideMutations_01', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-01', dateTo: '2024-01-31', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_01, }, }, { matcher: { name: 'nucleotideMutations_02', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-02-01', dateTo: '2024-02-29', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_02, }, }, { matcher: { name: 'nucleotideMutations_03', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-03-01', dateTo: '2024-03-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_03, }, }, }, { matcher: { name: 'nucleotideMutations_04', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-04-01', dateTo: '2024-04-30', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_04, }, }, }, { matcher: { name: 'nucleotideMutations_05', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-05-01', dateTo: '2024-05-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_05, }, }, }, { matcher: { name: 'nucleotideMutations_06', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-06-01', dateTo: '2024-06-30', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_06, }, }, }, { matcher: { name: 'nucleotideMutations_07', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-07-01', dateTo: '2024-07-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_07, }, }, }, ], }, }, }"
|
|
1799
|
+
}
|
|
1800
|
+
],
|
|
1801
|
+
"exports": [
|
|
1802
|
+
{
|
|
1803
|
+
"kind": "js",
|
|
1804
|
+
"name": "default",
|
|
1805
|
+
"declaration": {
|
|
1806
|
+
"name": "meta",
|
|
1807
|
+
"module": "src/web-components/visualization/gs-mutations-over-time.stories.ts"
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
"kind": "js",
|
|
1812
|
+
"name": "Default",
|
|
1813
|
+
"declaration": {
|
|
1814
|
+
"name": "Default",
|
|
1815
|
+
"module": "src/web-components/visualization/gs-mutations-over-time.stories.ts"
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
]
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
"kind": "javascript-module",
|
|
1822
|
+
"path": "src/web-components/visualization/gs-mutations-over-time.tsx",
|
|
1823
|
+
"declarations": [
|
|
1824
|
+
{
|
|
1825
|
+
"kind": "class",
|
|
1826
|
+
"description": "## Context\n\nThis component displays mutations (substitutions and deletions) over time for a dataset selected by a LAPIS filter.\nThe shown date range is determined by the date field in the LAPIS filter.\nIf the date field is not set, the date range is determined by all available dates in the dataset.\n\n## Views\n\n### Grid View\n\nThe grid view shows the proportion for each mutation over date ranges.",
|
|
1827
|
+
"name": "MutationsOverTimeComponent",
|
|
1828
|
+
"members": [
|
|
1829
|
+
{
|
|
1830
|
+
"kind": "field",
|
|
1831
|
+
"name": "lapisFilter",
|
|
1832
|
+
"type": {
|
|
1833
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1834
|
+
},
|
|
1835
|
+
"default": "{}",
|
|
1836
|
+
"description": "Required.\n\nLAPIS filter to select the displayed data.",
|
|
1837
|
+
"attribute": "lapisFilter"
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
"kind": "field",
|
|
1841
|
+
"name": "sequenceType",
|
|
1842
|
+
"type": {
|
|
1843
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
1844
|
+
},
|
|
1845
|
+
"default": "'nucleotide'",
|
|
1846
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
1847
|
+
"attribute": "sequenceType"
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
"kind": "field",
|
|
1851
|
+
"name": "views",
|
|
1852
|
+
"type": {
|
|
1853
|
+
"text": "'grid'[]"
|
|
1854
|
+
},
|
|
1855
|
+
"default": "['grid']",
|
|
1856
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1857
|
+
"attribute": "views"
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"kind": "field",
|
|
1861
|
+
"name": "width",
|
|
1862
|
+
"type": {
|
|
1863
|
+
"text": "string"
|
|
1864
|
+
},
|
|
1865
|
+
"default": "'100%'",
|
|
1866
|
+
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1867
|
+
"attribute": "width"
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
"kind": "field",
|
|
1871
|
+
"name": "height",
|
|
1872
|
+
"type": {
|
|
1873
|
+
"text": "string"
|
|
1874
|
+
},
|
|
1875
|
+
"default": "'700px'",
|
|
1876
|
+
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1877
|
+
"attribute": "height"
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
"kind": "field",
|
|
1881
|
+
"name": "granularity",
|
|
1882
|
+
"type": {
|
|
1883
|
+
"text": "'day' | 'week' | 'month' | 'year'"
|
|
1884
|
+
},
|
|
1885
|
+
"default": "'week'",
|
|
1886
|
+
"description": "The granularity of the time axis.",
|
|
1887
|
+
"attribute": "granularity"
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
"kind": "field",
|
|
1891
|
+
"name": "lapisDateField",
|
|
1892
|
+
"type": {
|
|
1893
|
+
"text": "string"
|
|
1894
|
+
},
|
|
1895
|
+
"default": "'date'",
|
|
1896
|
+
"description": "Required.\n\nThe LAPIS field that the data should be aggregated by.\nThe values will be used for the columns of the grid.\nMust be a field of type `date` in LAPIS.",
|
|
1897
|
+
"attribute": "lapisDateField"
|
|
1898
|
+
}
|
|
1899
|
+
],
|
|
1900
|
+
"attributes": [
|
|
1901
|
+
{
|
|
1902
|
+
"name": "lapisFilter",
|
|
1903
|
+
"type": {
|
|
1904
|
+
"text": "Record<string, string | number | null | boolean>"
|
|
1905
|
+
},
|
|
1906
|
+
"default": "{}",
|
|
1907
|
+
"description": "Required.\n\nLAPIS filter to select the displayed data.",
|
|
1908
|
+
"fieldName": "lapisFilter"
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
"name": "sequenceType",
|
|
1912
|
+
"type": {
|
|
1913
|
+
"text": "'nucleotide' | 'amino acid'"
|
|
1914
|
+
},
|
|
1915
|
+
"default": "'nucleotide'",
|
|
1916
|
+
"description": "The type of the sequence for which the mutations should be shown.",
|
|
1917
|
+
"fieldName": "sequenceType"
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
"name": "views",
|
|
1921
|
+
"type": {
|
|
1922
|
+
"text": "'grid'[]"
|
|
1923
|
+
},
|
|
1924
|
+
"default": "['grid']",
|
|
1925
|
+
"description": "A list of tabs with views that this component should provide.",
|
|
1926
|
+
"fieldName": "views"
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
"name": "width",
|
|
1930
|
+
"type": {
|
|
1931
|
+
"text": "string"
|
|
1932
|
+
},
|
|
1933
|
+
"default": "'100%'",
|
|
1934
|
+
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1935
|
+
"fieldName": "width"
|
|
1936
|
+
},
|
|
1937
|
+
{
|
|
1938
|
+
"name": "height",
|
|
1939
|
+
"type": {
|
|
1940
|
+
"text": "string"
|
|
1941
|
+
},
|
|
1942
|
+
"default": "'700px'",
|
|
1943
|
+
"description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
|
|
1944
|
+
"fieldName": "height"
|
|
1945
|
+
},
|
|
1946
|
+
{
|
|
1947
|
+
"name": "granularity",
|
|
1948
|
+
"type": {
|
|
1949
|
+
"text": "'day' | 'week' | 'month' | 'year'"
|
|
1950
|
+
},
|
|
1951
|
+
"default": "'week'",
|
|
1952
|
+
"description": "The granularity of the time axis.",
|
|
1953
|
+
"fieldName": "granularity"
|
|
1954
|
+
},
|
|
1955
|
+
{
|
|
1956
|
+
"name": "lapisDateField",
|
|
1957
|
+
"type": {
|
|
1958
|
+
"text": "string"
|
|
1959
|
+
},
|
|
1960
|
+
"default": "'date'",
|
|
1961
|
+
"description": "Required.\n\nThe LAPIS field that the data should be aggregated by.\nThe values will be used for the columns of the grid.\nMust be a field of type `date` in LAPIS.",
|
|
1962
|
+
"fieldName": "lapisDateField"
|
|
1963
|
+
}
|
|
1964
|
+
],
|
|
1965
|
+
"superclass": {
|
|
1966
|
+
"name": "PreactLitAdapterWithGridJsStyles",
|
|
1967
|
+
"module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
|
|
1968
|
+
},
|
|
1969
|
+
"tagName": "gs-mutations-over-time",
|
|
1970
|
+
"customElement": true
|
|
1971
|
+
}
|
|
1972
|
+
],
|
|
1973
|
+
"exports": [
|
|
1974
|
+
{
|
|
1975
|
+
"kind": "js",
|
|
1976
|
+
"name": "MutationsOverTimeComponent",
|
|
1977
|
+
"declaration": {
|
|
1978
|
+
"name": "MutationsOverTimeComponent",
|
|
1979
|
+
"module": "src/web-components/visualization/gs-mutations-over-time.tsx"
|
|
1980
|
+
}
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
"kind": "custom-element-definition",
|
|
1984
|
+
"name": "gs-mutations-over-time",
|
|
1985
|
+
"declaration": {
|
|
1986
|
+
"name": "MutationsOverTimeComponent",
|
|
1987
|
+
"module": "src/web-components/visualization/gs-mutations-over-time.tsx"
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
]
|
|
1991
|
+
},
|
|
1780
1992
|
{
|
|
1781
1993
|
"kind": "javascript-module",
|
|
1782
1994
|
"path": "src/web-components/visualization/gs-mutations.stories.ts",
|
|
@@ -2970,6 +3182,14 @@
|
|
|
2970
3182
|
"name": "NumberSequencesOverTimeComponent",
|
|
2971
3183
|
"module": "./gs-number-sequences-over-time"
|
|
2972
3184
|
}
|
|
3185
|
+
},
|
|
3186
|
+
{
|
|
3187
|
+
"kind": "js",
|
|
3188
|
+
"name": "MutationsOverTimeComponent",
|
|
3189
|
+
"declaration": {
|
|
3190
|
+
"name": "MutationsOverTimeComponent",
|
|
3191
|
+
"module": "./gs-mutations-over-time"
|
|
3192
|
+
}
|
|
2973
3193
|
}
|
|
2974
3194
|
]
|
|
2975
3195
|
},
|