@genspectrum/dashboard-components 1.12.0 → 1.14.0
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 +0 -7
- package/custom-elements.json +399 -27
- package/dist/components.d.ts +144 -33
- package/dist/components.js +2126 -1402
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +177 -26
- package/package.json +1 -5
- package/src/lapisApi/lapisApi.ts +21 -1
- package/src/lapisApi/lapisTypes.ts +36 -0
- package/src/preact/components/annotated-mutation.tsx +2 -2
- package/src/preact/{mutationsOverTime/mutations-over-time-grid.tsx → components/features-over-time-grid.tsx} +45 -52
- package/src/preact/genomeViewer/genome-data-viewer.tsx +2 -2
- package/src/preact/mutationsOverTime/MutationOverTimeData.ts +6 -4
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay/aminoAcidMutations.json +5482 -0
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay/aminoAcidMutationsOverTime.json +5496 -0
- package/src/preact/mutationsOverTime/__mockData__/byWeek/mutationsOverTime.json +7100 -0
- package/src/preact/mutationsOverTime/__mockData__/byWeek/nucleotideMutations.json +10122 -0
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData/mutationsOverTime.json +12646 -0
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData/nucleotideMutations.json +12632 -0
- package/src/preact/mutationsOverTime/__mockData__/request1800s/mutationsOverTime.json +16 -0
- package/src/preact/mutationsOverTime/__mockData__/request1800s/nucleotideMutations.json +11 -0
- package/src/preact/mutationsOverTime/__mockData__/withDisplayMutations/mutationsOverTime.json +52 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +3 -3
- package/src/preact/mutationsOverTime/mutations-over-time-grid-tooltip.tsx +3 -6
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +199 -12
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +30 -35
- package/src/preact/queriesOverTime/__mockData__/defaultMockData/queriesOverTime.json +32 -0
- package/src/preact/queriesOverTime/__mockData__/manyQueries.json +128 -0
- package/src/preact/queriesOverTime/__mockData__/request1800s.json +16 -0
- package/src/preact/queriesOverTime/__mockData__/withGaps.json +52 -0
- package/src/preact/queriesOverTime/getFilteredQueriesOverTimeData.ts +85 -0
- package/src/preact/queriesOverTime/queries-over-time-filter.tsx +25 -0
- package/src/preact/queriesOverTime/queries-over-time-grid-tooltip.stories.tsx +134 -0
- package/src/preact/queriesOverTime/queries-over-time-grid-tooltip.tsx +123 -0
- package/src/preact/queriesOverTime/queries-over-time.stories.tsx +481 -0
- package/src/preact/queriesOverTime/queries-over-time.tsx +304 -0
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +30 -3
- package/src/query/queryDatesInDataset.ts +89 -0
- package/src/query/queryMutationsOverTime.spec.ts +526 -548
- package/src/query/queryMutationsOverTime.ts +21 -232
- package/src/query/queryQueriesOverTime.spec.ts +432 -0
- package/src/query/queryQueriesOverTime.ts +125 -0
- package/src/utilEntrypoint.ts +4 -1
- package/src/utils/mutations.spec.ts +6 -0
- package/src/utils/mutations.ts +1 -1
- package/src/utils/temporalClass.ts +4 -0
- package/src/web-components/visualization/gs-mutations-over-time.spec-d.ts +2 -2
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +283 -17
- package/src/web-components/visualization/gs-mutations-over-time.tsx +1 -10
- package/src/web-components/visualization/gs-queries-over-time.spec-d.ts +38 -0
- package/src/web-components/visualization/gs-queries-over-time.stories.ts +288 -0
- package/src/web-components/visualization/gs-queries-over-time.tsx +154 -0
- package/src/web-components/visualization/index.ts +1 -0
- package/standalone-bundle/dashboard-components.js +10393 -9798
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/dist/assets/mutationOverTimeWorker-f8Kp0S6V.js.map +0 -1
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +0 -47170
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +0 -54026
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +0 -108385
- package/src/preact/mutationsOverTime/__mockData__/mockConversion.ts +0 -54
- package/src/preact/mutationsOverTime/__mockData__/noDataWhenNoMutationsAreInFilter.ts +0 -23
- package/src/preact/mutationsOverTime/__mockData__/noDataWhenThereAreNoDatesInFilter.ts +0 -23
- package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +0 -65527
- package/src/preact/mutationsOverTime/__mockData__/withDisplayMutations.ts +0 -352
- package/src/preact/mutationsOverTime/__mockData__/withGaps.ts +0 -298
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +0 -33
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.ts +0 -29
- package/src/preact/webWorkers/useWebWorker.ts +0 -74
- package/src/preact/webWorkers/workerFunction.ts +0 -30
- package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +0 -988
- package/standalone-bundle/assets/mutationOverTimeWorker-AhhjjklP.js.map +0 -1
package/dist/components.d.ts
CHANGED
|
@@ -828,13 +828,7 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
|
|
|
828
828
|
* If true, date ranges with no data will be hidden initially; if false, not.
|
|
829
829
|
* Can be switched with a button in the toolbar.
|
|
830
830
|
*/
|
|
831
|
-
hideGaps: boolean;
|
|
832
|
-
/**
|
|
833
|
-
* Whether to use the mutationsOverTime endpoint from LAPIS.
|
|
834
|
-
* If true, use the endpoint, if false, compute component data as before.
|
|
835
|
-
* Eventually, the new endpoint will become the default.
|
|
836
|
-
*/
|
|
837
|
-
useNewEndpoint?: boolean;
|
|
831
|
+
hideGaps: boolean | undefined;
|
|
838
832
|
/**
|
|
839
833
|
* The number of rows per page, which can be selected by the user.
|
|
840
834
|
*/
|
|
@@ -1183,6 +1177,107 @@ export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGri
|
|
|
1183
1177
|
render(): JSX_2.Element;
|
|
1184
1178
|
}
|
|
1185
1179
|
|
|
1180
|
+
/**
|
|
1181
|
+
* ## Context
|
|
1182
|
+
*
|
|
1183
|
+
* This component displays arbitrary LAPIS queries over time for a dataset.
|
|
1184
|
+
* Each query consists of a displayLabel (optional), countQuery (string for counting matches),
|
|
1185
|
+
* and coverageQuery (string for determining the coverage/denominator).
|
|
1186
|
+
* The shown date range is determined by the available dates in the dataset.
|
|
1187
|
+
*
|
|
1188
|
+
* ## Views
|
|
1189
|
+
*
|
|
1190
|
+
* ### Grid View
|
|
1191
|
+
*
|
|
1192
|
+
* The grid view shows the proportion for each query over date ranges.
|
|
1193
|
+
* Proportions are calculated as count/coverage for each time period.
|
|
1194
|
+
*
|
|
1195
|
+
* Users can filter the displayed rows by mean proportion via a slider in the toolbar.
|
|
1196
|
+
* The mean proportion of each row is calculated over the whole data range that the component displays.
|
|
1197
|
+
*
|
|
1198
|
+
* @fires {CustomEvent<undefined>} gs-component-finished-loading
|
|
1199
|
+
* Fired when the component has finished loading the required data from LAPIS.
|
|
1200
|
+
*/
|
|
1201
|
+
export declare class QueriesOverTimeComponent extends PreactLitAdapterWithGridJsStyles {
|
|
1202
|
+
/**
|
|
1203
|
+
* LAPIS filter to apply to all queries. This is used to determine the date range and total counts.
|
|
1204
|
+
*/
|
|
1205
|
+
lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
|
|
1206
|
+
nucleotideMutations?: string[];
|
|
1207
|
+
aminoAcidMutations?: string[];
|
|
1208
|
+
nucleotideInsertions?: string[];
|
|
1209
|
+
aminoAcidInsertions?: string[];
|
|
1210
|
+
};
|
|
1211
|
+
/**
|
|
1212
|
+
* Required.
|
|
1213
|
+
*
|
|
1214
|
+
* Array of queries to display. Each query has:
|
|
1215
|
+
* - displayLabel: string - The name to show in the grid row label
|
|
1216
|
+
* - countQuery: string - Query string to count matches
|
|
1217
|
+
* - coverageQuery: string - Query string to determine coverage/denominator
|
|
1218
|
+
*
|
|
1219
|
+
* Both queries (count and coverage) are 'advanced queries' as they are defined in LAPIS.
|
|
1220
|
+
*/
|
|
1221
|
+
queries: {
|
|
1222
|
+
displayLabel: string;
|
|
1223
|
+
countQuery: string;
|
|
1224
|
+
coverageQuery: string;
|
|
1225
|
+
}[];
|
|
1226
|
+
/**
|
|
1227
|
+
* A list of tabs with views that this component should provide.
|
|
1228
|
+
*/
|
|
1229
|
+
views: 'grid'[];
|
|
1230
|
+
/**
|
|
1231
|
+
* The width of the component.
|
|
1232
|
+
*
|
|
1233
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.
|
|
1234
|
+
*/
|
|
1235
|
+
width: string;
|
|
1236
|
+
/**
|
|
1237
|
+
* The height of the component.
|
|
1238
|
+
*
|
|
1239
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.
|
|
1240
|
+
*/
|
|
1241
|
+
height: string | undefined;
|
|
1242
|
+
/**
|
|
1243
|
+
* The granularity of the time axis.
|
|
1244
|
+
*/
|
|
1245
|
+
granularity: 'day' | 'week' | 'month' | 'year';
|
|
1246
|
+
/**
|
|
1247
|
+
* Required.
|
|
1248
|
+
*
|
|
1249
|
+
* The LAPIS field that the data should be aggregated by.
|
|
1250
|
+
* Must be a field of type `date` in LAPIS.
|
|
1251
|
+
*/
|
|
1252
|
+
lapisDateField: string;
|
|
1253
|
+
/**
|
|
1254
|
+
* The initial proportion interval for the grid view.
|
|
1255
|
+
* The values must be between 0 and 1, inclusive.
|
|
1256
|
+
*/
|
|
1257
|
+
initialMeanProportionInterval: {
|
|
1258
|
+
min: number;
|
|
1259
|
+
max: number;
|
|
1260
|
+
};
|
|
1261
|
+
/**
|
|
1262
|
+
* If true, date ranges with no data will be hidden initially; if false, not.
|
|
1263
|
+
* Can be switched with a button in the toolbar.
|
|
1264
|
+
*/
|
|
1265
|
+
hideGaps: boolean | undefined;
|
|
1266
|
+
/**
|
|
1267
|
+
* The number of rows per page, which can be selected by the user.
|
|
1268
|
+
*/
|
|
1269
|
+
pageSizes: number[] | number;
|
|
1270
|
+
/**
|
|
1271
|
+
* Custom columns to add to the grid.
|
|
1272
|
+
* Each column has a header and a map of query displayLabels to values.
|
|
1273
|
+
*/
|
|
1274
|
+
customColumns?: {
|
|
1275
|
+
header: string;
|
|
1276
|
+
values: Record<string, string | number>;
|
|
1277
|
+
}[];
|
|
1278
|
+
render(): JSX_2.Element;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1186
1281
|
declare type ReferenceGenome = default_2.infer<typeof referenceGenomeResponse>;
|
|
1187
1282
|
|
|
1188
1283
|
declare const referenceGenomeResponse: default_2.ZodObject<{
|
|
@@ -1712,7 +1807,7 @@ declare global {
|
|
|
1712
1807
|
|
|
1713
1808
|
declare global {
|
|
1714
1809
|
interface HTMLElementTagNameMap {
|
|
1715
|
-
'gs-
|
|
1810
|
+
'gs-mutations': MutationsComponent;
|
|
1716
1811
|
}
|
|
1717
1812
|
}
|
|
1718
1813
|
|
|
@@ -1720,7 +1815,7 @@ declare global {
|
|
|
1720
1815
|
declare global {
|
|
1721
1816
|
namespace JSX {
|
|
1722
1817
|
interface IntrinsicElements {
|
|
1723
|
-
'gs-
|
|
1818
|
+
'gs-mutations': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1724
1819
|
}
|
|
1725
1820
|
}
|
|
1726
1821
|
}
|
|
@@ -1728,7 +1823,7 @@ declare global {
|
|
|
1728
1823
|
|
|
1729
1824
|
declare global {
|
|
1730
1825
|
interface HTMLElementTagNameMap {
|
|
1731
|
-
'gs-
|
|
1826
|
+
'gs-mutation-comparison': MutationComparisonComponent;
|
|
1732
1827
|
}
|
|
1733
1828
|
}
|
|
1734
1829
|
|
|
@@ -1736,7 +1831,7 @@ declare global {
|
|
|
1736
1831
|
declare global {
|
|
1737
1832
|
namespace JSX {
|
|
1738
1833
|
interface IntrinsicElements {
|
|
1739
|
-
'gs-
|
|
1834
|
+
'gs-mutation-comparison': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1740
1835
|
}
|
|
1741
1836
|
}
|
|
1742
1837
|
}
|
|
@@ -1744,7 +1839,7 @@ declare global {
|
|
|
1744
1839
|
|
|
1745
1840
|
declare global {
|
|
1746
1841
|
interface HTMLElementTagNameMap {
|
|
1747
|
-
'gs-
|
|
1842
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
1748
1843
|
}
|
|
1749
1844
|
}
|
|
1750
1845
|
|
|
@@ -1752,7 +1847,7 @@ declare global {
|
|
|
1752
1847
|
declare global {
|
|
1753
1848
|
namespace JSX {
|
|
1754
1849
|
interface IntrinsicElements {
|
|
1755
|
-
'gs-
|
|
1850
|
+
'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1756
1851
|
}
|
|
1757
1852
|
}
|
|
1758
1853
|
}
|
|
@@ -1760,7 +1855,7 @@ declare global {
|
|
|
1760
1855
|
|
|
1761
1856
|
declare global {
|
|
1762
1857
|
interface HTMLElementTagNameMap {
|
|
1763
|
-
'gs-
|
|
1858
|
+
'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
|
|
1764
1859
|
}
|
|
1765
1860
|
}
|
|
1766
1861
|
|
|
@@ -1768,7 +1863,7 @@ declare global {
|
|
|
1768
1863
|
declare global {
|
|
1769
1864
|
namespace JSX {
|
|
1770
1865
|
interface IntrinsicElements {
|
|
1771
|
-
'gs-
|
|
1866
|
+
'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1772
1867
|
}
|
|
1773
1868
|
}
|
|
1774
1869
|
}
|
|
@@ -1808,7 +1903,7 @@ declare global {
|
|
|
1808
1903
|
|
|
1809
1904
|
declare global {
|
|
1810
1905
|
interface HTMLElementTagNameMap {
|
|
1811
|
-
'gs-
|
|
1906
|
+
'gs-mutations-over-time': MutationsOverTimeComponent;
|
|
1812
1907
|
}
|
|
1813
1908
|
}
|
|
1814
1909
|
|
|
@@ -1816,7 +1911,23 @@ declare global {
|
|
|
1816
1911
|
declare global {
|
|
1817
1912
|
namespace JSX {
|
|
1818
1913
|
interface IntrinsicElements {
|
|
1819
|
-
'gs-
|
|
1914
|
+
'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
|
|
1920
|
+
declare global {
|
|
1921
|
+
interface HTMLElementTagNameMap {
|
|
1922
|
+
'gs-queries-over-time': QueriesOverTimeComponent;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
|
|
1927
|
+
declare global {
|
|
1928
|
+
namespace JSX {
|
|
1929
|
+
interface IntrinsicElements {
|
|
1930
|
+
'gs-queries-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1820
1931
|
}
|
|
1821
1932
|
}
|
|
1822
1933
|
}
|
|
@@ -1840,7 +1951,7 @@ declare global {
|
|
|
1840
1951
|
|
|
1841
1952
|
declare global {
|
|
1842
1953
|
interface HTMLElementTagNameMap {
|
|
1843
|
-
'gs-
|
|
1954
|
+
'gs-statistics': StatisticsComponent;
|
|
1844
1955
|
}
|
|
1845
1956
|
}
|
|
1846
1957
|
|
|
@@ -1848,7 +1959,7 @@ declare global {
|
|
|
1848
1959
|
declare global {
|
|
1849
1960
|
namespace JSX {
|
|
1850
1961
|
interface IntrinsicElements {
|
|
1851
|
-
'gs-
|
|
1962
|
+
'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1852
1963
|
}
|
|
1853
1964
|
}
|
|
1854
1965
|
}
|
|
@@ -1876,10 +1987,10 @@ declare global {
|
|
|
1876
1987
|
|
|
1877
1988
|
declare global {
|
|
1878
1989
|
interface HTMLElementTagNameMap {
|
|
1879
|
-
'gs-
|
|
1990
|
+
'gs-location-filter': LocationFilterComponent;
|
|
1880
1991
|
}
|
|
1881
1992
|
interface HTMLElementEventMap {
|
|
1882
|
-
[gsEventNames.
|
|
1993
|
+
[gsEventNames.locationChanged]: LocationChangedEvent;
|
|
1883
1994
|
}
|
|
1884
1995
|
}
|
|
1885
1996
|
|
|
@@ -1887,7 +1998,7 @@ declare global {
|
|
|
1887
1998
|
declare global {
|
|
1888
1999
|
namespace JSX {
|
|
1889
2000
|
interface IntrinsicElements {
|
|
1890
|
-
'gs-
|
|
2001
|
+
'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1891
2002
|
}
|
|
1892
2003
|
}
|
|
1893
2004
|
}
|
|
@@ -1895,10 +2006,10 @@ declare global {
|
|
|
1895
2006
|
|
|
1896
2007
|
declare global {
|
|
1897
2008
|
interface HTMLElementTagNameMap {
|
|
1898
|
-
'gs-
|
|
2009
|
+
'gs-text-filter': TextFilterComponent;
|
|
1899
2010
|
}
|
|
1900
2011
|
interface HTMLElementEventMap {
|
|
1901
|
-
[gsEventNames.
|
|
2012
|
+
[gsEventNames.textFilterChanged]: TextFilterChangedEvent;
|
|
1902
2013
|
}
|
|
1903
2014
|
}
|
|
1904
2015
|
|
|
@@ -1906,7 +2017,7 @@ declare global {
|
|
|
1906
2017
|
declare global {
|
|
1907
2018
|
namespace JSX {
|
|
1908
2019
|
interface IntrinsicElements {
|
|
1909
|
-
'gs-
|
|
2020
|
+
'gs-text-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1910
2021
|
}
|
|
1911
2022
|
}
|
|
1912
2023
|
}
|
|
@@ -1933,11 +2044,11 @@ declare global {
|
|
|
1933
2044
|
|
|
1934
2045
|
declare global {
|
|
1935
2046
|
interface HTMLElementTagNameMap {
|
|
1936
|
-
'gs-
|
|
2047
|
+
'gs-lineage-filter': LineageFilterComponent;
|
|
1937
2048
|
}
|
|
1938
2049
|
interface HTMLElementEventMap {
|
|
1939
|
-
[gsEventNames.
|
|
1940
|
-
[gsEventNames.
|
|
2050
|
+
[gsEventNames.lineageFilterChanged]: LineageFilterChangedEvent;
|
|
2051
|
+
[gsEventNames.lineageFilterMultiChanged]: LineageMultiFilterChangedEvent;
|
|
1941
2052
|
}
|
|
1942
2053
|
}
|
|
1943
2054
|
|
|
@@ -1945,7 +2056,7 @@ declare global {
|
|
|
1945
2056
|
declare global {
|
|
1946
2057
|
namespace JSX {
|
|
1947
2058
|
interface IntrinsicElements {
|
|
1948
|
-
'gs-
|
|
2059
|
+
'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1949
2060
|
}
|
|
1950
2061
|
}
|
|
1951
2062
|
}
|
|
@@ -1953,11 +2064,11 @@ declare global {
|
|
|
1953
2064
|
|
|
1954
2065
|
declare global {
|
|
1955
2066
|
interface HTMLElementTagNameMap {
|
|
1956
|
-
'gs-
|
|
2067
|
+
'gs-number-range-filter': NumberRangeFilterComponent;
|
|
1957
2068
|
}
|
|
1958
2069
|
interface HTMLElementEventMap {
|
|
1959
|
-
[gsEventNames.
|
|
1960
|
-
[gsEventNames.
|
|
2070
|
+
[gsEventNames.numberRangeFilterChanged]: NumberRangeFilterChangedEvent;
|
|
2071
|
+
[gsEventNames.numberRangeValueChanged]: NumberRangeValueChangedEvent;
|
|
1961
2072
|
}
|
|
1962
2073
|
}
|
|
1963
2074
|
|
|
@@ -1965,7 +2076,7 @@ declare global {
|
|
|
1965
2076
|
declare global {
|
|
1966
2077
|
namespace JSX {
|
|
1967
2078
|
interface IntrinsicElements {
|
|
1968
|
-
'gs-
|
|
2079
|
+
'gs-number-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1969
2080
|
}
|
|
1970
2081
|
}
|
|
1971
2082
|
}
|