@genspectrum/dashboard-components 0.7.0 → 0.7.1
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/dist/dashboard-components.js +200 -203
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +14 -14
- package/package.json +1 -1
- package/src/preact/aggregatedData/aggregate.tsx +41 -33
- package/src/preact/mutationComparison/mutation-comparison.tsx +32 -34
- package/src/preact/mutations/mutations.tsx +63 -56
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +33 -25
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +46 -64
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +29 -36
- package/standalone-bundle/dashboard-components.js +9689 -9706
- package/standalone-bundle/dashboard-components.js.map +1 -1
|
@@ -1930,16 +1930,13 @@ function useQuery(fetchDataCallback, dependencies) {
|
|
|
1930
1930
|
}, [JSON.stringify(dependencies)]);
|
|
1931
1931
|
return { data, error, isLoading };
|
|
1932
1932
|
}
|
|
1933
|
-
const MutationComparison = (
|
|
1933
|
+
const MutationComparison = (componentProps) => {
|
|
1934
|
+
const { width, height } = componentProps;
|
|
1934
1935
|
const size = { height, width };
|
|
1935
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationComparisonInner, { ...
|
|
1936
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationComparisonInner, { ...componentProps }) }) });
|
|
1936
1937
|
};
|
|
1937
|
-
const MutationComparisonInner = ({
|
|
1938
|
-
lapisFilters,
|
|
1939
|
-
sequenceType,
|
|
1940
|
-
views,
|
|
1941
|
-
pageSize
|
|
1942
|
-
}) => {
|
|
1938
|
+
const MutationComparisonInner = (componentProps) => {
|
|
1939
|
+
const { lapisFilters, sequenceType } = componentProps;
|
|
1943
1940
|
const lapis = x(LapisUrlContext);
|
|
1944
1941
|
const { data, error, isLoading } = useQuery(async () => {
|
|
1945
1942
|
return queryMutationData(lapisFilters, sequenceType, lapis);
|
|
@@ -1953,28 +1950,15 @@ const MutationComparisonInner = ({
|
|
|
1953
1950
|
if (data === null) {
|
|
1954
1951
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
1955
1952
|
}
|
|
1956
|
-
return /* @__PURE__ */ u$1(
|
|
1957
|
-
MutationComparisonTabs,
|
|
1958
|
-
{
|
|
1959
|
-
data: data.mutationData,
|
|
1960
|
-
sequenceType,
|
|
1961
|
-
views,
|
|
1962
|
-
pageSize
|
|
1963
|
-
}
|
|
1964
|
-
);
|
|
1953
|
+
return /* @__PURE__ */ u$1(MutationComparisonTabs, { data: data.mutationData, originalComponentProps: componentProps });
|
|
1965
1954
|
};
|
|
1966
|
-
const MutationComparisonTabs = ({
|
|
1967
|
-
data,
|
|
1968
|
-
views,
|
|
1969
|
-
sequenceType,
|
|
1970
|
-
pageSize
|
|
1971
|
-
}) => {
|
|
1955
|
+
const MutationComparisonTabs = ({ data, originalComponentProps }) => {
|
|
1972
1956
|
const [proportionInterval, setProportionInterval] = h({ min: 0.5, max: 1 });
|
|
1973
1957
|
const [displayedMutationTypes, setDisplayedMutationTypes] = h([
|
|
1974
1958
|
{ label: "Substitutions", checked: true, type: "substitution" },
|
|
1975
1959
|
{ label: "Deletions", checked: true, type: "deletion" }
|
|
1976
1960
|
]);
|
|
1977
|
-
const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(sequenceType);
|
|
1961
|
+
const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(originalComponentProps.sequenceType);
|
|
1978
1962
|
const filteredData = T(
|
|
1979
1963
|
() => filterMutationData(data, displayedSegments, displayedMutationTypes),
|
|
1980
1964
|
[data, displayedSegments, displayedMutationTypes]
|
|
@@ -1989,7 +1973,7 @@ const MutationComparisonTabs = ({
|
|
|
1989
1973
|
{
|
|
1990
1974
|
data: { content: filteredData },
|
|
1991
1975
|
proportionInterval,
|
|
1992
|
-
pageSize
|
|
1976
|
+
pageSize: originalComponentProps.pageSize
|
|
1993
1977
|
}
|
|
1994
1978
|
)
|
|
1995
1979
|
};
|
|
@@ -2006,7 +1990,7 @@ const MutationComparisonTabs = ({
|
|
|
2006
1990
|
};
|
|
2007
1991
|
}
|
|
2008
1992
|
};
|
|
2009
|
-
const tabs = views.map((view) => getTab(view));
|
|
1993
|
+
const tabs = originalComponentProps.views.map((view) => getTab(view));
|
|
2010
1994
|
return /* @__PURE__ */ u$1(
|
|
2011
1995
|
Tabs,
|
|
2012
1996
|
{
|
|
@@ -2020,7 +2004,8 @@ const MutationComparisonTabs = ({
|
|
|
2020
2004
|
setDisplayedMutationTypes,
|
|
2021
2005
|
filteredData,
|
|
2022
2006
|
proportionInterval,
|
|
2023
|
-
setProportionInterval
|
|
2007
|
+
setProportionInterval,
|
|
2008
|
+
originalComponentProps
|
|
2024
2009
|
}
|
|
2025
2010
|
)
|
|
2026
2011
|
}
|
|
@@ -2033,7 +2018,8 @@ const Toolbar$5 = ({
|
|
|
2033
2018
|
setDisplayedMutationTypes,
|
|
2034
2019
|
filteredData,
|
|
2035
2020
|
proportionInterval,
|
|
2036
|
-
setProportionInterval
|
|
2021
|
+
setProportionInterval,
|
|
2022
|
+
originalComponentProps
|
|
2037
2023
|
}) => {
|
|
2038
2024
|
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
2039
2025
|
/* @__PURE__ */ u$1(
|
|
@@ -2060,10 +2046,18 @@ const Toolbar$5 = ({
|
|
|
2060
2046
|
filename: "mutation_comparison.csv"
|
|
2061
2047
|
}
|
|
2062
2048
|
),
|
|
2063
|
-
/* @__PURE__ */ u$1(
|
|
2049
|
+
/* @__PURE__ */ u$1(MutationComparisonInfo, { originalComponentProps }),
|
|
2064
2050
|
/* @__PURE__ */ u$1(Fullscreen, {})
|
|
2065
2051
|
] });
|
|
2066
2052
|
};
|
|
2053
|
+
const MutationComparisonInfo = ({ originalComponentProps }) => {
|
|
2054
|
+
const lapis = x(LapisUrlContext);
|
|
2055
|
+
return /* @__PURE__ */ u$1(Info, { children: [
|
|
2056
|
+
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Info for mutation comparison" }),
|
|
2057
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: "TODO: https://github.com/GenSpectrum/dashboard-components/issues/465" }),
|
|
2058
|
+
/* @__PURE__ */ u$1(InfoComponentCode, { componentName: "mutation-comparison", params: originalComponentProps, lapisUrl: lapis })
|
|
2059
|
+
] });
|
|
2060
|
+
};
|
|
2067
2061
|
const gridJsStyle = '.gridjs-head button, .gridjs-footer button {\n cursor: pointer;\n background-color: transparent;\n background-image: none;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n}\n\n.gridjs-temp {\n position: relative;\n}\n\n.gridjs-head {\n width: 100%;\n margin-bottom: 5px;\n padding: 5px 1px;\n}\n.gridjs-head::after {\n content: "";\n display: block;\n clear: both;\n}\n.gridjs-head:empty {\n padding: 0;\n border: none;\n}\n\n.gridjs-container {\n overflow: hidden;\n display: inline-block;\n padding: 2px;\n color: #000;\n position: relative;\n z-index: 0;\n}\n\n.gridjs-footer {\n display: block;\n position: relative;\n width: 100%;\n z-index: 5;\n padding: 12px 24px;\n border-top: 1px solid #e5e7eb;\n background-color: #fff;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.26);\n border-radius: 0 0 8px 8px;\n border-bottom-width: 1px;\n border-color: #e5e7eb;\n}\n.gridjs-footer:empty {\n padding: 0;\n border: none;\n}\n\ninput.gridjs-input {\n outline: none;\n background-color: #fff;\n border: 1px solid #d2d6dc;\n border-radius: 5px;\n padding: 10px 13px;\n font-size: 14px;\n line-height: 1.45;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\ninput.gridjs-input:focus {\n box-shadow: 0 0 0 3px rgba(149, 189, 243, 0.5);\n border-color: #9bc2f7;\n}\n\n.gridjs-pagination {\n color: #3d4044;\n}\n.gridjs-pagination::after {\n content: "";\n display: block;\n clear: both;\n}\n.gridjs-pagination .gridjs-summary {\n float: left;\n margin-top: 5px;\n}\n.gridjs-pagination .gridjs-pages {\n float: right;\n}\n.gridjs-pagination .gridjs-pages button {\n padding: 5px 14px;\n border: 1px solid #d2d6dc;\n background-color: #fff;\n border-right: none;\n outline: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.gridjs-pagination .gridjs-pages button:focus {\n box-shadow: 0 0 0 2px rgba(149, 189, 243, 0.5);\n position: relative;\n margin-right: -1px;\n border-right: 1px solid #d2d6dc;\n}\n.gridjs-pagination .gridjs-pages button:hover {\n background-color: #f7f7f7;\n color: rgb(60, 66, 87);\n outline: none;\n}\n.gridjs-pagination .gridjs-pages button:disabled,\n.gridjs-pagination .gridjs-pages button[disabled],\n.gridjs-pagination .gridjs-pages button:hover:disabled {\n cursor: default;\n background-color: #fff;\n color: #6b7280;\n}\n.gridjs-pagination .gridjs-pages button.gridjs-spread {\n cursor: default;\n box-shadow: none;\n background-color: #fff;\n}\n.gridjs-pagination .gridjs-pages button.gridjs-currentPage {\n background-color: #f7f7f7;\n font-weight: bold;\n}\n.gridjs-pagination .gridjs-pages button:last-child {\n border-bottom-right-radius: 6px;\n border-top-right-radius: 6px;\n border-right: 1px solid #d2d6dc;\n}\n.gridjs-pagination .gridjs-pages button:first-child {\n border-bottom-left-radius: 6px;\n border-top-left-radius: 6px;\n}\n.gridjs-pagination .gridjs-pages button:last-child:focus {\n margin-right: 0;\n}\n\nbutton.gridjs-sort {\n float: right;\n height: 24px;\n width: 13px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position-x: center;\n cursor: pointer;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n background-size: contain;\n}\nbutton.gridjs-sort-neutral {\n opacity: 0.3;\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSI0MDEuOTk4cHgiIGhlaWdodD0iNDAxLjk5OHB4IiB2aWV3Qm94PSIwIDAgNDAxLjk5OCA0MDEuOTk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MDEuOTk4IDQwMS45OTg7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnPgoJCTxwYXRoIGQ9Ik03My4wOTIsMTY0LjQ1MmgyNTUuODEzYzQuOTQ5LDAsOS4yMzMtMS44MDcsMTIuODQ4LTUuNDI0YzMuNjEzLTMuNjE2LDUuNDI3LTcuODk4LDUuNDI3LTEyLjg0NwoJCQljMC00Ljk0OS0xLjgxMy05LjIyOS01LjQyNy0xMi44NUwyMTMuODQ2LDUuNDI0QzIxMC4yMzIsMS44MTIsMjA1Ljk1MSwwLDIwMC45OTksMHMtOS4yMzMsMS44MTItMTIuODUsNS40MjRMNjAuMjQyLDEzMy4zMzEKCQkJYy0zLjYxNywzLjYxNy01LjQyNCw3LjkwMS01LjQyNCwxMi44NWMwLDQuOTQ4LDEuODA3LDkuMjMxLDUuNDI0LDEyLjg0N0M2My44NjMsMTYyLjY0NSw2OC4xNDQsMTY0LjQ1Miw3My4wOTIsMTY0LjQ1MnoiLz4KCQk8cGF0aCBkPSJNMzI4LjkwNSwyMzcuNTQ5SDczLjA5MmMtNC45NTIsMC05LjIzMywxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MTctNS40MjQsNy44OTgtNS40MjQsMTIuODQ3CgkJCWMwLDQuOTQ5LDEuODA3LDkuMjMzLDUuNDI0LDEyLjg0OEwxODguMTQ5LDM5Ni41N2MzLjYyMSwzLjYxNyw3LjkwMiw1LjQyOCwxMi44NSw1LjQyOHM5LjIzMy0xLjgxMSwxMi44NDctNS40MjhsMTI3LjkwNy0xMjcuOTA2CgkJCWMzLjYxMy0zLjYxNCw1LjQyNy03Ljg5OCw1LjQyNy0xMi44NDhjMC00Ljk0OC0xLjgxMy05LjIyOS01LjQyNy0xMi44NDdDMzM4LjEzOSwyMzkuMzUzLDMzMy44NTQsMjM3LjU0OSwzMjguOTA1LDIzNy41NDl6Ii8+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: center;\n}\nbutton.gridjs-sort-asc {\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyOTIuMzYycHgiIGhlaWdodD0iMjkyLjM2MXB4IiB2aWV3Qm94PSIwIDAgMjkyLjM2MiAyOTIuMzYxIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyOTIuMzYyIDI5Mi4zNjE7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0yODYuOTM1LDE5Ny4yODdMMTU5LjAyOCw2OS4zODFjLTMuNjEzLTMuNjE3LTcuODk1LTUuNDI0LTEyLjg0Ny01LjQyNHMtOS4yMzMsMS44MDctMTIuODUsNS40MjRMNS40MjQsMTk3LjI4NwoJCUMxLjgwNywyMDAuOTA0LDAsMjA1LjE4NiwwLDIxMC4xMzRzMS44MDcsOS4yMzMsNS40MjQsMTIuODQ3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI1LDEyLjg1LDUuNDI1aDI1NS44MTMKCQljNC45NDksMCw5LjIzMy0xLjgwOCwxMi44NDgtNS40MjVjMy42MTMtMy42MTMsNS40MjctNy44OTgsNS40MjctMTIuODQ3UzI5MC41NDgsMjAwLjkwNCwyODYuOTM1LDE5Ny4yODd6Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: 35%;\n background-size: 10px;\n}\nbutton.gridjs-sort-desc {\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyOTIuMzYycHgiIGhlaWdodD0iMjkyLjM2MnB4IiB2aWV3Qm94PSIwIDAgMjkyLjM2MiAyOTIuMzYyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyOTIuMzYyIDI5Mi4zNjI7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0yODYuOTM1LDY5LjM3N2MtMy42MTQtMy42MTctNy44OTgtNS40MjQtMTIuODQ4LTUuNDI0SDE4LjI3NGMtNC45NTIsMC05LjIzMywxLjgwNy0xMi44NSw1LjQyNAoJCUMxLjgwNyw3Mi45OTgsMCw3Ny4yNzksMCw4Mi4yMjhjMCw0Ljk0OCwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDdsMTI3LjkwNywxMjcuOTA3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI4LDEyLjg1LDUuNDI4CgkJczkuMjMzLTEuODExLDEyLjg0Ny01LjQyOEwyODYuOTM1LDk1LjA3NGMzLjYxMy0zLjYxNyw1LjQyNy03Ljg5OCw1LjQyNy0xMi44NDdDMjkyLjM2Miw3Ny4yNzksMjkwLjU0OCw3Mi45OTgsMjg2LjkzNSw2OS4zNzd6Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: 65%;\n background-size: 10px;\n}\nbutton.gridjs-sort:focus {\n outline: none;\n}\n\ntable.gridjs-table {\n width: 100%;\n max-width: 100%;\n border-collapse: collapse;\n text-align: left;\n display: table;\n margin: 0;\n padding: 0;\n overflow: auto;\n table-layout: fixed;\n}\n\n.gridjs-tbody {\n background-color: #fff;\n}\n\ntd.gridjs-td {\n border: 1px solid #e5e7eb;\n padding: 12px 24px;\n background-color: #fff;\n box-sizing: content-box;\n}\ntd.gridjs-td:first-child {\n border-left: none;\n}\ntd.gridjs-td:last-child {\n border-right: none;\n}\ntd.gridjs-message {\n text-align: center;\n}\n\nth.gridjs-th {\n position: relative;\n color: #6b7280;\n background-color: #f9fafb;\n border: 1px solid #e5e7eb;\n border-top: none;\n padding: 14px 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n box-sizing: border-box;\n white-space: nowrap;\n outline: none;\n vertical-align: middle;\n}\nth.gridjs-th .gridjs-th-content {\n text-overflow: ellipsis;\n overflow: hidden;\n width: 100%;\n float: left;\n}\nth.gridjs-th-sort {\n cursor: pointer;\n}\nth.gridjs-th-sort .gridjs-th-content {\n width: calc(100% - 15px);\n}\nth.gridjs-th-sort:hover {\n background-color: #e5e7eb;\n}\nth.gridjs-th-sort:focus {\n background-color: #e5e7eb;\n}\nth.gridjs-th-fixed {\n position: sticky;\n box-shadow: 0 1px 0 0 #e5e7eb;\n}\n@supports (-moz-appearance: none) {\n th.gridjs-th-fixed {\n box-shadow: 0 0 0 1px #e5e7eb;\n }\n}\nth.gridjs-th:first-child {\n border-left: none;\n}\nth.gridjs-th:last-child {\n border-right: none;\n}\n\n.gridjs-tr {\n border: none;\n}\n.gridjs-tr-selected td {\n background-color: #ebf5ff;\n}\n.gridjs-tr:last-child td {\n border-bottom: 0;\n}\n\n.gridjs *,\n.gridjs :after,\n.gridjs :before {\n box-sizing: border-box;\n}\n\n.gridjs-wrapper {\n position: relative;\n z-index: 1;\n overflow: auto;\n width: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.26);\n border-radius: 8px 8px 0 0;\n display: block;\n border-top-width: 1px;\n border-color: #e5e7eb;\n}\n.gridjs-wrapper:nth-last-of-type(2) {\n border-radius: 8px;\n border-bottom-width: 1px;\n}\n\n.gridjs-search {\n float: left;\n}\n.gridjs-search-input {\n width: 250px;\n}\n\n.gridjs-loading-bar {\n z-index: 10;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: #fff;\n opacity: 0.5;\n}\n.gridjs-loading-bar::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(90deg, rgba(204, 204, 204, 0) 0, rgba(204, 204, 204, 0.2) 20%, rgba(204, 204, 204, 0.5) 60%, rgba(204, 204, 204, 0));\n animation: shimmer 2s infinite;\n content: "";\n}\n@keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.gridjs-td .gridjs-checkbox {\n display: block;\n margin: auto;\n cursor: pointer;\n}\n\n.gridjs-resizable {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 5px;\n}\n.gridjs-resizable:hover {\n cursor: ew-resize;\n background-color: #9bc2f7;\n}\n/*# sourceMappingURL=mermaid.css?inline.map */';
|
|
2068
2062
|
const minMaxPercentSliderCss = 'input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n pointer-events: all;\n width: 24px;\n height: 24px;\n background-color: #fff;\n border-radius: 50%;\n box-shadow: 0 0 0 1px #C6C6C6;\n cursor: pointer;\n}\n\ninput[type=range]::-moz-range-thumb {\n -webkit-appearance: none;\n pointer-events: all;\n width: 24px;\n height: 24px;\n background-color: #fff;\n border-radius: 50%;\n box-shadow: 0 0 0 1px #C6C6C6;\n cursor: pointer;\n}\n\ninput[type=range]::-webkit-slider-thumb:hover {\n background: #f7f7f7;\n}\n\ninput[type=range]::-webkit-slider-thumb:active {\n box-shadow: inset 0 0 3px #387bbe, 0 0 9px #387bbe;\n -webkit-box-shadow: inset 0 0 3px #387bbe, 0 0 9px #387bbe;\n}\n\ninput[type="range"] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n height: 2px;\n width: 100%;\n position: absolute;\n background-color: #C6C6C6;\n pointer-events: none;\n}';
|
|
2069
2063
|
const tailwindStyle = `*, ::before, ::after {
|
|
@@ -5445,17 +5439,14 @@ function filterMutationsData(data, displayedSegments, displayedMutationTypes) {
|
|
|
5445
5439
|
gridData: filteredSubstitutionsOrDeletions
|
|
5446
5440
|
};
|
|
5447
5441
|
}
|
|
5448
|
-
const Mutations = (
|
|
5442
|
+
const Mutations = (componentProps) => {
|
|
5443
|
+
const { width, height } = componentProps;
|
|
5449
5444
|
const size = { height, width };
|
|
5450
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsInner, { ...
|
|
5445
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsInner, { ...componentProps }) }) });
|
|
5451
5446
|
};
|
|
5452
|
-
const MutationsInner = ({
|
|
5453
|
-
lapisFilter,
|
|
5454
|
-
sequenceType,
|
|
5455
|
-
views,
|
|
5456
|
-
pageSize
|
|
5457
|
-
}) => {
|
|
5447
|
+
const MutationsInner = (componentProps) => {
|
|
5458
5448
|
const lapis = x(LapisUrlContext);
|
|
5449
|
+
const { lapisFilter, sequenceType } = componentProps;
|
|
5459
5450
|
const { data, error, isLoading } = useQuery(async () => {
|
|
5460
5451
|
return queryMutationsData(lapisFilter, sequenceType, lapis);
|
|
5461
5452
|
}, [lapisFilter, sequenceType, lapis]);
|
|
@@ -5468,11 +5459,11 @@ const MutationsInner = ({
|
|
|
5468
5459
|
if (data === null) {
|
|
5469
5460
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
5470
5461
|
}
|
|
5471
|
-
return /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data,
|
|
5462
|
+
return /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data, originalComponentProps: componentProps });
|
|
5472
5463
|
};
|
|
5473
|
-
const MutationsTabs = ({ mutationsData,
|
|
5464
|
+
const MutationsTabs = ({ mutationsData, originalComponentProps }) => {
|
|
5474
5465
|
const [proportionInterval, setProportionInterval] = h({ min: 0.05, max: 1 });
|
|
5475
|
-
const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(sequenceType);
|
|
5466
|
+
const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(originalComponentProps.sequenceType);
|
|
5476
5467
|
const [displayedMutationTypes, setDisplayedMutationTypes] = h([
|
|
5477
5468
|
{ label: "Substitutions", checked: true, type: "substitution" },
|
|
5478
5469
|
{ label: "Deletions", checked: true, type: "deletion" }
|
|
@@ -5488,7 +5479,7 @@ const MutationsTabs = ({ mutationsData, sequenceType, views, pageSize }) => {
|
|
|
5488
5479
|
{
|
|
5489
5480
|
data: filteredData.tableData,
|
|
5490
5481
|
proportionInterval,
|
|
5491
|
-
pageSize
|
|
5482
|
+
pageSize: originalComponentProps.pageSize
|
|
5492
5483
|
}
|
|
5493
5484
|
)
|
|
5494
5485
|
};
|
|
@@ -5499,20 +5490,20 @@ const MutationsTabs = ({ mutationsData, sequenceType, views, pageSize }) => {
|
|
|
5499
5490
|
MutationsGrid,
|
|
5500
5491
|
{
|
|
5501
5492
|
data: filteredData.gridData,
|
|
5502
|
-
sequenceType,
|
|
5493
|
+
sequenceType: originalComponentProps.sequenceType,
|
|
5503
5494
|
proportionInterval,
|
|
5504
|
-
pageSize
|
|
5495
|
+
pageSize: originalComponentProps.pageSize
|
|
5505
5496
|
}
|
|
5506
5497
|
)
|
|
5507
5498
|
};
|
|
5508
5499
|
case "insertions":
|
|
5509
5500
|
return {
|
|
5510
5501
|
title: "Insertions",
|
|
5511
|
-
content: /* @__PURE__ */ u$1(InsertionsTable, { data: filteredData.insertions, pageSize })
|
|
5502
|
+
content: /* @__PURE__ */ u$1(InsertionsTable, { data: filteredData.insertions, pageSize: originalComponentProps.pageSize })
|
|
5512
5503
|
};
|
|
5513
5504
|
}
|
|
5514
5505
|
};
|
|
5515
|
-
const tabs = views.map((view) => getTab(view));
|
|
5506
|
+
const tabs = originalComponentProps.views.map((view) => getTab(view));
|
|
5516
5507
|
const toolbar = (activeTab) => /* @__PURE__ */ u$1(
|
|
5517
5508
|
Toolbar$4,
|
|
5518
5509
|
{
|
|
@@ -5523,7 +5514,8 @@ const MutationsTabs = ({ mutationsData, sequenceType, views, pageSize }) => {
|
|
|
5523
5514
|
setDisplayedMutationTypes,
|
|
5524
5515
|
filteredData,
|
|
5525
5516
|
proportionInterval,
|
|
5526
|
-
setProportionInterval
|
|
5517
|
+
setProportionInterval,
|
|
5518
|
+
originalComponentProps
|
|
5527
5519
|
}
|
|
5528
5520
|
);
|
|
5529
5521
|
return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar });
|
|
@@ -5536,7 +5528,8 @@ const Toolbar$4 = ({
|
|
|
5536
5528
|
setDisplayedMutationTypes,
|
|
5537
5529
|
filteredData,
|
|
5538
5530
|
proportionInterval,
|
|
5539
|
-
setProportionInterval
|
|
5531
|
+
setProportionInterval,
|
|
5532
|
+
originalComponentProps
|
|
5540
5533
|
}) => {
|
|
5541
5534
|
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
5542
5535
|
/* @__PURE__ */ u$1(SegmentSelector, { displayedSegments, setDisplayedSegments }),
|
|
@@ -5578,39 +5571,43 @@ const Toolbar$4 = ({
|
|
|
5578
5571
|
filename: "insertions.csv"
|
|
5579
5572
|
}
|
|
5580
5573
|
),
|
|
5581
|
-
/* @__PURE__ */ u$1(MutationsInfo, {}),
|
|
5574
|
+
/* @__PURE__ */ u$1(MutationsInfo, { originalComponentProps }),
|
|
5582
5575
|
/* @__PURE__ */ u$1(Fullscreen, {})
|
|
5583
5576
|
] });
|
|
5584
5577
|
};
|
|
5585
|
-
const MutationsInfo = () =>
|
|
5586
|
-
|
|
5587
|
-
/* @__PURE__ */ u$1(
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
/* @__PURE__ */ u$1(
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
/* @__PURE__ */ u$1("
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5578
|
+
const MutationsInfo = ({ originalComponentProps }) => {
|
|
5579
|
+
const lapis = x(LapisUrlContext);
|
|
5580
|
+
return /* @__PURE__ */ u$1(Info, { children: [
|
|
5581
|
+
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Mutations" }),
|
|
5582
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
5583
|
+
"This shows mutations of a variant. There are three types of mutations:",
|
|
5584
|
+
" ",
|
|
5585
|
+
/* @__PURE__ */ u$1(InfoLink, { href: "https://www.genome.gov/genetics-glossary/Substitution", children: "substitutions" }),
|
|
5586
|
+
",",
|
|
5587
|
+
" ",
|
|
5588
|
+
/* @__PURE__ */ u$1(InfoLink, { href: "https://www.genome.gov/genetics-glossary/Deletion", children: "deletions" }),
|
|
5589
|
+
" and",
|
|
5590
|
+
" ",
|
|
5591
|
+
/* @__PURE__ */ u$1(InfoLink, { href: "https://www.genome.gov/genetics-glossary/Insertion", children: "insertions" }),
|
|
5592
|
+
"."
|
|
5593
|
+
] }),
|
|
5594
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Proportion calculation" }),
|
|
5595
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: "The proportion of a mutation is calculated by dividing the number of sequences with the mutation by the total number of sequences with a non-ambiguous symbol at the position." }),
|
|
5596
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
5597
|
+
/* @__PURE__ */ u$1("b", { children: "Example:" }),
|
|
5598
|
+
" Assume we look at nucleotide mutations at position 5 where the reference has a T and assume there are 10 sequences in total:",
|
|
5599
|
+
/* @__PURE__ */ u$1("ul", { className: "list-disc list-inside ml-2", children: [
|
|
5600
|
+
/* @__PURE__ */ u$1("li", { children: "3 sequences have a C," }),
|
|
5601
|
+
/* @__PURE__ */ u$1("li", { children: "2 sequences have a T," }),
|
|
5602
|
+
/* @__PURE__ */ u$1("li", { children: "1 sequence has a G," }),
|
|
5603
|
+
/* @__PURE__ */ u$1("li", { children: "3 sequences have an N," }),
|
|
5604
|
+
/* @__PURE__ */ u$1("li", { children: "1 sequence has a Y (which means T or C)," })
|
|
5605
|
+
] }),
|
|
5606
|
+
"then the proportion of the T5C mutation is 50%. The 4 sequences that have an N or Y are excluded from the calculation."
|
|
5610
5607
|
] }),
|
|
5611
|
-
|
|
5612
|
-
] })
|
|
5613
|
-
|
|
5608
|
+
/* @__PURE__ */ u$1(InfoComponentCode, { componentName: "mutations", params: originalComponentProps, lapisUrl: lapis })
|
|
5609
|
+
] });
|
|
5610
|
+
};
|
|
5614
5611
|
var __defProp$a = Object.defineProperty;
|
|
5615
5612
|
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
5616
5613
|
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
@@ -7768,27 +7765,18 @@ function toYearMonthDay(d2) {
|
|
|
7768
7765
|
count: d2.count
|
|
7769
7766
|
};
|
|
7770
7767
|
}
|
|
7771
|
-
const RelativeGrowthAdvantage = ({
|
|
7772
|
-
width,
|
|
7773
|
-
height,
|
|
7774
|
-
...innerProps
|
|
7775
|
-
}) => {
|
|
7768
|
+
const RelativeGrowthAdvantage = (componentProps) => {
|
|
7769
|
+
const { width, height } = componentProps;
|
|
7776
7770
|
const size = { height, width };
|
|
7777
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...
|
|
7778
|
-
};
|
|
7779
|
-
const RelativeGrowthAdvantageInner = ({
|
|
7780
|
-
numeratorFilter,
|
|
7781
|
-
denominatorFilter,
|
|
7782
|
-
generationTime,
|
|
7783
|
-
views,
|
|
7784
|
-
lapisDateField,
|
|
7785
|
-
yAxisMaxConfig
|
|
7786
|
-
}) => {
|
|
7771
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...componentProps }) }) });
|
|
7772
|
+
};
|
|
7773
|
+
const RelativeGrowthAdvantageInner = (componentProps) => {
|
|
7787
7774
|
const lapis = x(LapisUrlContext);
|
|
7775
|
+
const { numeratorFilter, denominatorFilter, generationTime, lapisDateField } = componentProps;
|
|
7788
7776
|
const [yAxisScaleType, setYAxisScaleType] = h("linear");
|
|
7789
7777
|
const { data, error, isLoading } = useQuery(
|
|
7790
7778
|
() => queryRelativeGrowthAdvantage(numeratorFilter, denominatorFilter, generationTime, lapis, lapisDateField),
|
|
7791
|
-
[lapis, numeratorFilter, denominatorFilter, generationTime,
|
|
7779
|
+
[lapis, numeratorFilter, denominatorFilter, generationTime, lapisDateField]
|
|
7792
7780
|
);
|
|
7793
7781
|
if (isLoading) {
|
|
7794
7782
|
return /* @__PURE__ */ u$1(LoadingDisplay, {});
|
|
@@ -7805,9 +7793,7 @@ const RelativeGrowthAdvantageInner = ({
|
|
|
7805
7793
|
data,
|
|
7806
7794
|
yAxisScaleType,
|
|
7807
7795
|
setYAxisScaleType,
|
|
7808
|
-
|
|
7809
|
-
generationTime,
|
|
7810
|
-
yAxisMaxConfig
|
|
7796
|
+
originalComponentProps: componentProps
|
|
7811
7797
|
}
|
|
7812
7798
|
);
|
|
7813
7799
|
};
|
|
@@ -7815,9 +7801,7 @@ const RelativeGrowthAdvantageTabs = ({
|
|
|
7815
7801
|
data,
|
|
7816
7802
|
yAxisScaleType,
|
|
7817
7803
|
setYAxisScaleType,
|
|
7818
|
-
|
|
7819
|
-
generationTime,
|
|
7820
|
-
yAxisMaxConfig
|
|
7804
|
+
originalComponentProps
|
|
7821
7805
|
}) => {
|
|
7822
7806
|
const getTab = (view) => {
|
|
7823
7807
|
switch (view) {
|
|
@@ -7833,17 +7817,17 @@ const RelativeGrowthAdvantageTabs = ({
|
|
|
7833
7817
|
params: data.params
|
|
7834
7818
|
},
|
|
7835
7819
|
yAxisScaleType,
|
|
7836
|
-
yAxisMaxConfig
|
|
7820
|
+
yAxisMaxConfig: originalComponentProps.yAxisMaxConfig
|
|
7837
7821
|
}
|
|
7838
7822
|
)
|
|
7839
7823
|
};
|
|
7840
7824
|
}
|
|
7841
7825
|
};
|
|
7842
|
-
const tabs = views.map((view) => getTab(view));
|
|
7826
|
+
const tabs = originalComponentProps.views.map((view) => getTab(view));
|
|
7843
7827
|
const toolbar = () => /* @__PURE__ */ u$1(
|
|
7844
7828
|
RelativeGrowthAdvantageToolbar,
|
|
7845
7829
|
{
|
|
7846
|
-
|
|
7830
|
+
originalComponentProps,
|
|
7847
7831
|
yAxisScaleType,
|
|
7848
7832
|
setYAxisScaleType
|
|
7849
7833
|
}
|
|
@@ -7853,15 +7837,19 @@ const RelativeGrowthAdvantageTabs = ({
|
|
|
7853
7837
|
const RelativeGrowthAdvantageToolbar = ({
|
|
7854
7838
|
yAxisScaleType,
|
|
7855
7839
|
setYAxisScaleType,
|
|
7856
|
-
|
|
7840
|
+
originalComponentProps
|
|
7857
7841
|
}) => {
|
|
7858
7842
|
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
7859
7843
|
/* @__PURE__ */ u$1(ScalingSelector, { yAxisScaleType, setYAxisScaleType }),
|
|
7860
|
-
/* @__PURE__ */ u$1(RelativeGrowthAdvantageInfo, {
|
|
7844
|
+
/* @__PURE__ */ u$1(RelativeGrowthAdvantageInfo, { originalComponentProps }),
|
|
7861
7845
|
/* @__PURE__ */ u$1(Fullscreen, {})
|
|
7862
7846
|
] });
|
|
7863
7847
|
};
|
|
7864
|
-
const RelativeGrowthAdvantageInfo = ({
|
|
7848
|
+
const RelativeGrowthAdvantageInfo = ({
|
|
7849
|
+
originalComponentProps
|
|
7850
|
+
}) => {
|
|
7851
|
+
const lapis = x(LapisUrlContext);
|
|
7852
|
+
const generationTime = originalComponentProps.generationTime;
|
|
7865
7853
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
7866
7854
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Relative growth advantage" }),
|
|
7867
7855
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -7879,7 +7867,15 @@ const RelativeGrowthAdvantageInfo = ({ generationTime }) => {
|
|
|
7879
7867
|
'Chen, Chaoran, et al. "Quantification of the spread of SARS-CoV-2 variant B.1.1.7 in Switzerland." Epidemics (2021); doi:',
|
|
7880
7868
|
" ",
|
|
7881
7869
|
/* @__PURE__ */ u$1(InfoLink, { href: "https://www.sciencedirect.com/science/article/pii/S1755436521000335?via=ihub", children: "10.1016/j.epidem.2021.100480" })
|
|
7882
|
-
] })
|
|
7870
|
+
] }),
|
|
7871
|
+
/* @__PURE__ */ u$1(
|
|
7872
|
+
InfoComponentCode,
|
|
7873
|
+
{
|
|
7874
|
+
componentName: "relative-growth-advantage",
|
|
7875
|
+
params: originalComponentProps,
|
|
7876
|
+
lapisUrl: lapis
|
|
7877
|
+
}
|
|
7878
|
+
)
|
|
7883
7879
|
] });
|
|
7884
7880
|
};
|
|
7885
7881
|
var __defProp$8 = Object.defineProperty;
|
|
@@ -8002,18 +7998,13 @@ const AggregateTable = ({ data, fields, pageSize }) => {
|
|
|
8002
7998
|
];
|
|
8003
7999
|
return /* @__PURE__ */ u$1(Table, { data, columns: headers, pageSize });
|
|
8004
8000
|
};
|
|
8005
|
-
const Aggregate = (
|
|
8001
|
+
const Aggregate = (componentProps) => {
|
|
8002
|
+
const { width, height } = componentProps;
|
|
8006
8003
|
const size = { height, width };
|
|
8007
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(AggregateInner, { ...
|
|
8008
|
-
};
|
|
8009
|
-
const AggregateInner = ({
|
|
8010
|
-
fields,
|
|
8011
|
-
views,
|
|
8012
|
-
filter,
|
|
8013
|
-
initialSortField,
|
|
8014
|
-
initialSortDirection,
|
|
8015
|
-
pageSize
|
|
8016
|
-
}) => {
|
|
8004
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(AggregateInner, { ...componentProps }) }) });
|
|
8005
|
+
};
|
|
8006
|
+
const AggregateInner = (componentProps) => {
|
|
8007
|
+
const { fields, filter, initialSortField, initialSortDirection } = componentProps;
|
|
8017
8008
|
const lapis = x(LapisUrlContext);
|
|
8018
8009
|
const { data, error, isLoading } = useQuery(async () => {
|
|
8019
8010
|
return queryAggregateData(filter, fields, lapis, { field: initialSortField, direction: initialSortDirection });
|
|
@@ -8027,36 +8018,48 @@ const AggregateInner = ({
|
|
|
8027
8018
|
if (data === null) {
|
|
8028
8019
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
8029
8020
|
}
|
|
8030
|
-
return /* @__PURE__ */ u$1(AggregatedDataTabs, { data,
|
|
8021
|
+
return /* @__PURE__ */ u$1(AggregatedDataTabs, { data, originalComponentProps: componentProps });
|
|
8031
8022
|
};
|
|
8032
|
-
const AggregatedDataTabs = ({ data,
|
|
8023
|
+
const AggregatedDataTabs = ({ data, originalComponentProps }) => {
|
|
8033
8024
|
const getTab = (view) => {
|
|
8034
8025
|
switch (view) {
|
|
8035
8026
|
case "table":
|
|
8036
8027
|
return {
|
|
8037
8028
|
title: "Table",
|
|
8038
|
-
content: /* @__PURE__ */ u$1(
|
|
8029
|
+
content: /* @__PURE__ */ u$1(
|
|
8030
|
+
AggregateTable,
|
|
8031
|
+
{
|
|
8032
|
+
data,
|
|
8033
|
+
fields: originalComponentProps.fields,
|
|
8034
|
+
pageSize: originalComponentProps.pageSize
|
|
8035
|
+
}
|
|
8036
|
+
)
|
|
8039
8037
|
};
|
|
8040
8038
|
}
|
|
8041
8039
|
};
|
|
8042
|
-
const tabs = views.map((view) => getTab(view));
|
|
8043
|
-
return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar: /* @__PURE__ */ u$1(Toolbar$2, { data,
|
|
8040
|
+
const tabs = originalComponentProps.views.map((view) => getTab(view));
|
|
8041
|
+
return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar: /* @__PURE__ */ u$1(Toolbar$2, { data, originalComponentProps }) });
|
|
8044
8042
|
};
|
|
8045
|
-
const Toolbar$2 = ({ data,
|
|
8043
|
+
const Toolbar$2 = ({ data, originalComponentProps }) => {
|
|
8046
8044
|
return /* @__PURE__ */ u$1("div", { class: "flex flex-row", children: [
|
|
8047
8045
|
/* @__PURE__ */ u$1(CsvDownloadButton, { className: "mx-1 btn btn-xs", getData: () => data, filename: "aggregate.csv" }),
|
|
8048
|
-
/* @__PURE__ */ u$1(
|
|
8049
|
-
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Aggregated data" }),
|
|
8050
|
-
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8051
|
-
"This table shows the number and proportion of sequences stratified by the following fields:",
|
|
8052
|
-
" ",
|
|
8053
|
-
fields.join(", "),
|
|
8054
|
-
". The proportion is calculated with respect to the total count within the filtered dataset."
|
|
8055
|
-
] })
|
|
8056
|
-
] }),
|
|
8046
|
+
/* @__PURE__ */ u$1(AggregateInfo, { originalComponentProps }),
|
|
8057
8047
|
/* @__PURE__ */ u$1(Fullscreen, {})
|
|
8058
8048
|
] });
|
|
8059
8049
|
};
|
|
8050
|
+
const AggregateInfo = ({ originalComponentProps }) => {
|
|
8051
|
+
const lapis = x(LapisUrlContext);
|
|
8052
|
+
return /* @__PURE__ */ u$1(Info, { children: [
|
|
8053
|
+
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Aggregated data" }),
|
|
8054
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8055
|
+
"This table shows the number and proportion of sequences stratified by the following fields:",
|
|
8056
|
+
" ",
|
|
8057
|
+
originalComponentProps.fields.join(", "),
|
|
8058
|
+
". The proportion is calculated with respect to the total count within the filtered dataset."
|
|
8059
|
+
] }),
|
|
8060
|
+
/* @__PURE__ */ u$1(InfoComponentCode, { componentName: "aggregate", params: originalComponentProps, lapisUrl: lapis })
|
|
8061
|
+
] });
|
|
8062
|
+
};
|
|
8060
8063
|
var __defProp$7 = Object.defineProperty;
|
|
8061
8064
|
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
8062
8065
|
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
@@ -8278,18 +8281,13 @@ async function queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField
|
|
|
8278
8281
|
});
|
|
8279
8282
|
return Promise.all(queries);
|
|
8280
8283
|
}
|
|
8281
|
-
const NumberSequencesOverTime = (
|
|
8284
|
+
const NumberSequencesOverTime = (componentProps) => {
|
|
8285
|
+
const { width, height } = componentProps;
|
|
8282
8286
|
const size = { height, width };
|
|
8283
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...
|
|
8284
|
-
};
|
|
8285
|
-
const NumberSequencesOverTimeInner = ({
|
|
8286
|
-
lapisFilter,
|
|
8287
|
-
granularity,
|
|
8288
|
-
smoothingWindow,
|
|
8289
|
-
lapisDateField,
|
|
8290
|
-
views,
|
|
8291
|
-
pageSize
|
|
8292
|
-
}) => {
|
|
8287
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...componentProps }) }) });
|
|
8288
|
+
};
|
|
8289
|
+
const NumberSequencesOverTimeInner = (componentProps) => {
|
|
8290
|
+
const { lapisFilter, lapisDateField, granularity, smoothingWindow } = componentProps;
|
|
8293
8291
|
const lapis = x(LapisUrlContext);
|
|
8294
8292
|
const { data, error, isLoading } = useQuery(
|
|
8295
8293
|
() => queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField, granularity, smoothingWindow),
|
|
@@ -8304,24 +8302,9 @@ const NumberSequencesOverTimeInner = ({
|
|
|
8304
8302
|
if (data === null) {
|
|
8305
8303
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
8306
8304
|
}
|
|
8307
|
-
return /* @__PURE__ */ u$1(
|
|
8308
|
-
NumberSequencesOverTimeTabs,
|
|
8309
|
-
{
|
|
8310
|
-
views,
|
|
8311
|
-
data,
|
|
8312
|
-
granularity,
|
|
8313
|
-
smoothingWindow,
|
|
8314
|
-
pageSize
|
|
8315
|
-
}
|
|
8316
|
-
);
|
|
8305
|
+
return /* @__PURE__ */ u$1(NumberSequencesOverTimeTabs, { data, originalComponentProps: componentProps });
|
|
8317
8306
|
};
|
|
8318
|
-
const NumberSequencesOverTimeTabs = ({
|
|
8319
|
-
views,
|
|
8320
|
-
data,
|
|
8321
|
-
granularity,
|
|
8322
|
-
smoothingWindow,
|
|
8323
|
-
pageSize
|
|
8324
|
-
}) => {
|
|
8307
|
+
const NumberSequencesOverTimeTabs = ({ data, originalComponentProps }) => {
|
|
8325
8308
|
const [yAxisScaleType, setYAxisScaleType] = h("linear");
|
|
8326
8309
|
const getTab = (view) => {
|
|
8327
8310
|
switch (view) {
|
|
@@ -8338,7 +8321,14 @@ const NumberSequencesOverTimeTabs = ({
|
|
|
8338
8321
|
case "table":
|
|
8339
8322
|
return {
|
|
8340
8323
|
title: "Table",
|
|
8341
|
-
content: /* @__PURE__ */ u$1(
|
|
8324
|
+
content: /* @__PURE__ */ u$1(
|
|
8325
|
+
NumberSequencesOverTimeTable,
|
|
8326
|
+
{
|
|
8327
|
+
data,
|
|
8328
|
+
granularity: originalComponentProps.granularity,
|
|
8329
|
+
pageSize: originalComponentProps.pageSize
|
|
8330
|
+
}
|
|
8331
|
+
)
|
|
8342
8332
|
};
|
|
8343
8333
|
default:
|
|
8344
8334
|
throw new Error(`Unknown view: ${view}`);
|
|
@@ -8347,29 +8337,21 @@ const NumberSequencesOverTimeTabs = ({
|
|
|
8347
8337
|
return /* @__PURE__ */ u$1(
|
|
8348
8338
|
Tabs,
|
|
8349
8339
|
{
|
|
8350
|
-
tabs: views.map((view) => getTab(view)),
|
|
8340
|
+
tabs: originalComponentProps.views.map((view) => getTab(view)),
|
|
8351
8341
|
toolbar: (activeTab) => /* @__PURE__ */ u$1(
|
|
8352
8342
|
Toolbar$1,
|
|
8353
8343
|
{
|
|
8354
8344
|
activeTab,
|
|
8355
8345
|
data,
|
|
8356
|
-
granularity,
|
|
8357
|
-
smoothingWindow,
|
|
8358
8346
|
yAxisScaleType,
|
|
8359
|
-
setYAxisScaleType
|
|
8347
|
+
setYAxisScaleType,
|
|
8348
|
+
originalComponentProps
|
|
8360
8349
|
}
|
|
8361
8350
|
)
|
|
8362
8351
|
}
|
|
8363
8352
|
);
|
|
8364
8353
|
};
|
|
8365
|
-
const Toolbar$1 = ({
|
|
8366
|
-
activeTab,
|
|
8367
|
-
data,
|
|
8368
|
-
granularity,
|
|
8369
|
-
yAxisScaleType,
|
|
8370
|
-
setYAxisScaleType,
|
|
8371
|
-
smoothingWindow
|
|
8372
|
-
}) => {
|
|
8354
|
+
const Toolbar$1 = ({ activeTab, data, yAxisScaleType, setYAxisScaleType, originalComponentProps }) => {
|
|
8373
8355
|
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
8374
8356
|
activeTab !== "Table" && /* @__PURE__ */ u$1(
|
|
8375
8357
|
ScalingSelector,
|
|
@@ -8383,26 +8365,37 @@ const Toolbar$1 = ({
|
|
|
8383
8365
|
CsvDownloadButton,
|
|
8384
8366
|
{
|
|
8385
8367
|
className: "mx-1 btn btn-xs",
|
|
8386
|
-
getData: () => getNumberOfSequencesOverTimeTableData(data, granularity),
|
|
8368
|
+
getData: () => getNumberOfSequencesOverTimeTableData(data, originalComponentProps.granularity),
|
|
8387
8369
|
filename: "number_of_sequences_over_time.csv"
|
|
8388
8370
|
}
|
|
8389
8371
|
),
|
|
8390
|
-
/* @__PURE__ */ u$1(NumberSequencesOverTimeInfo, {
|
|
8372
|
+
/* @__PURE__ */ u$1(NumberSequencesOverTimeInfo, { originalComponentProps }),
|
|
8391
8373
|
/* @__PURE__ */ u$1(Fullscreen, {})
|
|
8392
8374
|
] });
|
|
8393
8375
|
};
|
|
8394
8376
|
const NumberSequencesOverTimeInfo = ({
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
/* @__PURE__ */ u$1(
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8377
|
+
originalComponentProps
|
|
8378
|
+
}) => {
|
|
8379
|
+
const lapis = x(LapisUrlContext);
|
|
8380
|
+
return /* @__PURE__ */ u$1(Info, { children: [
|
|
8381
|
+
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Number of sequences over time" }),
|
|
8382
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
8383
|
+
"This presents the number of available sequences of a variant per",
|
|
8384
|
+
" ",
|
|
8385
|
+
/* @__PURE__ */ u$1("b", { children: originalComponentProps.granularity }),
|
|
8386
|
+
originalComponentProps.smoothingWindow > 0 && `, smoothed using a ${originalComponentProps.smoothingWindow}-${originalComponentProps.granularity} sliding window`,
|
|
8387
|
+
"."
|
|
8388
|
+
] }),
|
|
8389
|
+
/* @__PURE__ */ u$1(
|
|
8390
|
+
InfoComponentCode,
|
|
8391
|
+
{
|
|
8392
|
+
componentName: "number-sequences-over-time",
|
|
8393
|
+
params: originalComponentProps,
|
|
8394
|
+
lapisUrl: lapis
|
|
8395
|
+
}
|
|
8396
|
+
)
|
|
8397
|
+
] });
|
|
8398
|
+
};
|
|
8406
8399
|
var __defProp$6 = Object.defineProperty;
|
|
8407
8400
|
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
8408
8401
|
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
@@ -8904,18 +8897,14 @@ function useWebWorker(messageToWorker, worker) {
|
|
|
8904
8897
|
}, [messageToWorker]);
|
|
8905
8898
|
return { data, error, isLoading };
|
|
8906
8899
|
}
|
|
8907
|
-
const MutationsOverTime = (
|
|
8900
|
+
const MutationsOverTime = (componentProps) => {
|
|
8901
|
+
const { width, height } = componentProps;
|
|
8908
8902
|
const size = { height, width };
|
|
8909
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsOverTimeInner, { ...
|
|
8903
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsOverTimeInner, { ...componentProps }) }) });
|
|
8910
8904
|
};
|
|
8911
|
-
const MutationsOverTimeInner = ({
|
|
8912
|
-
lapisFilter,
|
|
8913
|
-
sequenceType,
|
|
8914
|
-
views,
|
|
8915
|
-
granularity,
|
|
8916
|
-
lapisDateField
|
|
8917
|
-
}) => {
|
|
8905
|
+
const MutationsOverTimeInner = (componentProps) => {
|
|
8918
8906
|
const lapis = x(LapisUrlContext);
|
|
8907
|
+
const { lapisFilter, sequenceType, granularity, lapisDateField } = componentProps;
|
|
8919
8908
|
const { data, error, isLoading } = useWebWorker(
|
|
8920
8909
|
{
|
|
8921
8910
|
lapisFilter,
|
|
@@ -8942,20 +8931,18 @@ const MutationsOverTimeInner = ({
|
|
|
8942
8931
|
{
|
|
8943
8932
|
overallMutationData,
|
|
8944
8933
|
mutationOverTimeData,
|
|
8945
|
-
|
|
8946
|
-
views
|
|
8934
|
+
originalComponentProps: componentProps
|
|
8947
8935
|
}
|
|
8948
8936
|
);
|
|
8949
8937
|
};
|
|
8950
8938
|
const MutationsOverTimeTabs = ({
|
|
8951
8939
|
mutationOverTimeData,
|
|
8952
|
-
|
|
8953
|
-
views,
|
|
8940
|
+
originalComponentProps,
|
|
8954
8941
|
overallMutationData
|
|
8955
8942
|
}) => {
|
|
8956
8943
|
const [proportionInterval, setProportionInterval] = h({ min: 0.05, max: 0.9 });
|
|
8957
8944
|
const [colorScale, setColorScale] = h({ min: 0, max: 1, color: "indigo" });
|
|
8958
|
-
const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(sequenceType);
|
|
8945
|
+
const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(originalComponentProps.sequenceType);
|
|
8959
8946
|
const [displayedMutationTypes, setDisplayedMutationTypes] = h([
|
|
8960
8947
|
{ label: "Substitutions", checked: true, type: "substitution" },
|
|
8961
8948
|
{ label: "Deletions", checked: true, type: "deletion" }
|
|
@@ -8984,7 +8971,7 @@ const MutationsOverTimeTabs = ({
|
|
|
8984
8971
|
};
|
|
8985
8972
|
}
|
|
8986
8973
|
};
|
|
8987
|
-
const tabs = views.map((view) => getTab(view));
|
|
8974
|
+
const tabs = originalComponentProps.views.map((view) => getTab(view));
|
|
8988
8975
|
const toolbar = (activeTab) => /* @__PURE__ */ u$1(
|
|
8989
8976
|
Toolbar,
|
|
8990
8977
|
{
|
|
@@ -8997,7 +8984,8 @@ const MutationsOverTimeTabs = ({
|
|
|
8997
8984
|
setProportionInterval,
|
|
8998
8985
|
filteredData,
|
|
8999
8986
|
colorScale,
|
|
9000
|
-
setColorScale
|
|
8987
|
+
setColorScale,
|
|
8988
|
+
originalComponentProps
|
|
9001
8989
|
}
|
|
9002
8990
|
);
|
|
9003
8991
|
return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar });
|
|
@@ -9012,7 +9000,8 @@ const Toolbar = ({
|
|
|
9012
9000
|
setProportionInterval,
|
|
9013
9001
|
filteredData,
|
|
9014
9002
|
colorScale,
|
|
9015
|
-
setColorScale
|
|
9003
|
+
setColorScale,
|
|
9004
|
+
originalComponentProps
|
|
9016
9005
|
}) => {
|
|
9017
9006
|
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
9018
9007
|
activeTab === "Grid" && /* @__PURE__ */ u$1(ColorScaleSelectorDropdown, { colorScale, setColorScale }),
|
|
@@ -9041,10 +9030,18 @@ const Toolbar = ({
|
|
|
9041
9030
|
filename: "mutations_over_time.csv"
|
|
9042
9031
|
}
|
|
9043
9032
|
),
|
|
9044
|
-
/* @__PURE__ */ u$1(
|
|
9033
|
+
/* @__PURE__ */ u$1(MutationsOverTimeInfo, { originalComponentProps }),
|
|
9045
9034
|
/* @__PURE__ */ u$1(Fullscreen, {})
|
|
9046
9035
|
] });
|
|
9047
9036
|
};
|
|
9037
|
+
const MutationsOverTimeInfo = ({ originalComponentProps }) => {
|
|
9038
|
+
const lapis = x(LapisUrlContext);
|
|
9039
|
+
return /* @__PURE__ */ u$1(Info, { children: [
|
|
9040
|
+
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Info for mutations over time" }),
|
|
9041
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: "TODO: https://github.com/GenSpectrum/dashboard-components/issues/441" }),
|
|
9042
|
+
/* @__PURE__ */ u$1(InfoComponentCode, { componentName: "mutations-over-time", params: originalComponentProps, lapisUrl: lapis })
|
|
9043
|
+
] });
|
|
9044
|
+
};
|
|
9048
9045
|
function getDownloadData(filteredData) {
|
|
9049
9046
|
const dates = filteredData.getSecondAxisKeys().map((date) => toTemporalClass(date));
|
|
9050
9047
|
return filteredData.getFirstAxisKeys().map((mutation) => {
|