@genspectrum/dashboard-components 0.6.4 → 0.6.5
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 +1 -1
- package/dist/dashboard-components.js +44 -37
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +13 -7
- package/dist/style.css +3 -0
- package/package.json +1 -1
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations.json +1470 -0
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_tooManyMutations.json +16453 -0
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +41 -40
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +62 -8
- package/src/web-components/visualization/gs-mutations-over-time.tsx +11 -5
package/custom-elements.json
CHANGED
|
@@ -1823,7 +1823,7 @@
|
|
|
1823
1823
|
"declarations": [
|
|
1824
1824
|
{
|
|
1825
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.\n\nThe grid
|
|
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.\n\nThe grid limits the number of rows columns for browser performance reasons.\nToo much data might make the browser unresponsive.\n\nThe number of columns is limited to 200.\nIf this number are exceeded, an error message will be shown.\nIt is your responsibility to make sure that this does not happen.\nDepending on the selected date range in the `lapisFilter`, you can adapt the granularity accordingly\n(e.g. use months instead of days).\n\nThe number of rows is limited to 100.\nIf there are more, the component will only show 100 mutations and notify the user.",
|
|
1827
1827
|
"name": "MutationsOverTimeComponent",
|
|
1828
1828
|
"members": [
|
|
1829
1829
|
{
|
|
@@ -4464,6 +4464,9 @@ input.tab:checked + .tab-content,
|
|
|
4464
4464
|
padding-top: 1rem;
|
|
4465
4465
|
padding-bottom: 1rem;
|
|
4466
4466
|
}
|
|
4467
|
+
.pl-2 {
|
|
4468
|
+
padding-left: 0.5rem;
|
|
4469
|
+
}
|
|
4467
4470
|
.text-center {
|
|
4468
4471
|
text-align: center;
|
|
4469
4472
|
}
|
|
@@ -7925,47 +7928,51 @@ const Tooltip = ({ children, content }) => {
|
|
|
7925
7928
|
};
|
|
7926
7929
|
const MAX_NUMBER_OF_GRID_ROWS = 100;
|
|
7927
7930
|
const MutationsOverTimeGrid = ({ data }) => {
|
|
7928
|
-
const
|
|
7929
|
-
|
|
7930
|
-
throw new UserFacingError(
|
|
7931
|
-
"Too many mutations",
|
|
7932
|
-
`The dataset contains ${mutations.length} mutations. Please adapt the filters to reduce the number to below ${MAX_NUMBER_OF_GRID_ROWS}.`
|
|
7933
|
-
);
|
|
7934
|
-
}
|
|
7931
|
+
const allMutations = data.getFirstAxisKeys();
|
|
7932
|
+
const shownMutations = allMutations.slice(0, MAX_NUMBER_OF_GRID_ROWS);
|
|
7935
7933
|
const dates = data.getSecondAxisKeys().sort((a2, b3) => compareTemporal(a2, b3));
|
|
7936
|
-
return /* @__PURE__ */ u$1(
|
|
7937
|
-
"div",
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
const value = data.get(mutation, date) ?? { proportion: 0, count: 0 };
|
|
7956
|
-
return /* @__PURE__ */ u$1(
|
|
7934
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
7935
|
+
allMutations.length > MAX_NUMBER_OF_GRID_ROWS && /* @__PURE__ */ u$1("div", { className: "pl-2", children: [
|
|
7936
|
+
"Showing ",
|
|
7937
|
+
MAX_NUMBER_OF_GRID_ROWS,
|
|
7938
|
+
" of ",
|
|
7939
|
+
allMutations.length,
|
|
7940
|
+
" mutations. You can narrow the filter to reduce the number of mutations."
|
|
7941
|
+
] }),
|
|
7942
|
+
/* @__PURE__ */ u$1(
|
|
7943
|
+
"div",
|
|
7944
|
+
{
|
|
7945
|
+
style: {
|
|
7946
|
+
display: "grid",
|
|
7947
|
+
gridTemplateRows: `repeat(${shownMutations.length}, 24px)`,
|
|
7948
|
+
gridTemplateColumns: `8rem repeat(${dates.length}, minmax(1.5rem, 1fr))`
|
|
7949
|
+
},
|
|
7950
|
+
children: shownMutations.map((mutation, i2) => {
|
|
7951
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
7952
|
+
/* @__PURE__ */ u$1(
|
|
7957
7953
|
"div",
|
|
7958
7954
|
{
|
|
7959
|
-
style: { gridRowStart: i2 + 1, gridColumnStart:
|
|
7960
|
-
children: /* @__PURE__ */ u$1(
|
|
7955
|
+
style: { gridRowStart: i2 + 1, gridColumnStart: 1 },
|
|
7956
|
+
children: /* @__PURE__ */ u$1(MutationCell, { mutation })
|
|
7961
7957
|
},
|
|
7962
|
-
|
|
7963
|
-
)
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7958
|
+
`mutation-${mutation.toString()}`
|
|
7959
|
+
),
|
|
7960
|
+
dates.map((date, j2) => {
|
|
7961
|
+
const value = data.get(mutation, date) ?? { proportion: 0, count: 0 };
|
|
7962
|
+
return /* @__PURE__ */ u$1(
|
|
7963
|
+
"div",
|
|
7964
|
+
{
|
|
7965
|
+
style: { gridRowStart: i2 + 1, gridColumnStart: j2 + 2 },
|
|
7966
|
+
children: /* @__PURE__ */ u$1(ProportionCell, { value, date, mutation })
|
|
7967
|
+
},
|
|
7968
|
+
`${mutation.toString()}-${date.toString()}`
|
|
7969
|
+
);
|
|
7970
|
+
})
|
|
7971
|
+
] }, `fragment-${mutation.toString()}`);
|
|
7972
|
+
})
|
|
7973
|
+
}
|
|
7974
|
+
)
|
|
7975
|
+
] });
|
|
7969
7976
|
};
|
|
7970
7977
|
const ProportionCell = ({ value, mutation, date }) => {
|
|
7971
7978
|
const tooltipContent = /* @__PURE__ */ u$1("div", { children: [
|