@genspectrum/dashboard-components 1.14.0 → 1.14.2
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/components.d.ts +8 -8
- package/dist/components.js +28 -2
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +8 -8
- package/package.json +1 -2
- package/src/preact/components/features-over-time-grid.tsx +10 -2
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +1 -1
- package/src/preact/wastewater/mutationsOverTime/computeWastewaterMutationsOverTimeDataPerLocation.spec.ts +55 -0
- package/src/preact/wastewater/mutationsOverTime/computeWastewaterMutationsOverTimeDataPerLocation.ts +26 -0
- package/standalone-bundle/dashboard-components.js +3665 -3653
- package/standalone-bundle/dashboard-components.js.map +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -1807,7 +1807,7 @@ declare global {
|
|
|
1807
1807
|
|
|
1808
1808
|
declare global {
|
|
1809
1809
|
interface HTMLElementTagNameMap {
|
|
1810
|
-
'gs-
|
|
1810
|
+
'gs-mutation-comparison': MutationComparisonComponent;
|
|
1811
1811
|
}
|
|
1812
1812
|
}
|
|
1813
1813
|
|
|
@@ -1815,7 +1815,7 @@ declare global {
|
|
|
1815
1815
|
declare global {
|
|
1816
1816
|
namespace JSX {
|
|
1817
1817
|
interface IntrinsicElements {
|
|
1818
|
-
'gs-
|
|
1818
|
+
'gs-mutation-comparison': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1819
1819
|
}
|
|
1820
1820
|
}
|
|
1821
1821
|
}
|
|
@@ -1823,7 +1823,7 @@ declare global {
|
|
|
1823
1823
|
|
|
1824
1824
|
declare global {
|
|
1825
1825
|
interface HTMLElementTagNameMap {
|
|
1826
|
-
'gs-
|
|
1826
|
+
'gs-mutations': MutationsComponent;
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
1829
|
|
|
@@ -1831,7 +1831,7 @@ declare global {
|
|
|
1831
1831
|
declare global {
|
|
1832
1832
|
namespace JSX {
|
|
1833
1833
|
interface IntrinsicElements {
|
|
1834
|
-
'gs-
|
|
1834
|
+
'gs-mutations': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
@@ -1839,7 +1839,7 @@ declare global {
|
|
|
1839
1839
|
|
|
1840
1840
|
declare global {
|
|
1841
1841
|
interface HTMLElementTagNameMap {
|
|
1842
|
-
'gs-
|
|
1842
|
+
'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
|
|
1843
1843
|
}
|
|
1844
1844
|
}
|
|
1845
1845
|
|
|
@@ -1847,7 +1847,7 @@ declare global {
|
|
|
1847
1847
|
declare global {
|
|
1848
1848
|
namespace JSX {
|
|
1849
1849
|
interface IntrinsicElements {
|
|
1850
|
-
'gs-
|
|
1850
|
+
'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
1853
1853
|
}
|
|
@@ -1855,7 +1855,7 @@ declare global {
|
|
|
1855
1855
|
|
|
1856
1856
|
declare global {
|
|
1857
1857
|
interface HTMLElementTagNameMap {
|
|
1858
|
-
'gs-
|
|
1858
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
1859
1859
|
}
|
|
1860
1860
|
}
|
|
1861
1861
|
|
|
@@ -1863,7 +1863,7 @@ declare global {
|
|
|
1863
1863
|
declare global {
|
|
1864
1864
|
namespace JSX {
|
|
1865
1865
|
interface IntrinsicElements {
|
|
1866
|
-
'gs-
|
|
1866
|
+
'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
package/dist/components.js
CHANGED
|
@@ -5300,7 +5300,7 @@ const PrevalenceOverTimeBubbleChart = ({
|
|
|
5300
5300
|
displayName: variantData.displayName
|
|
5301
5301
|
};
|
|
5302
5302
|
});
|
|
5303
|
-
if (nonNullDateRangeData.length === 0) {
|
|
5303
|
+
if (nonNullDateRangeData.length === 0 || nonNullDateRangeData[0].content.length === 0) {
|
|
5304
5304
|
return NO_DATA$1;
|
|
5305
5305
|
}
|
|
5306
5306
|
const firstDate = nonNullDateRangeData[0].content[0].dateRange;
|
|
@@ -8162,11 +8162,17 @@ function FeaturesOverTimeGrid({
|
|
|
8162
8162
|
id: `date-${index}`,
|
|
8163
8163
|
header: () => /* @__PURE__ */ u$1("div", { className: "@container min-w-[0.05rem]", children: /* @__PURE__ */ u$1("p", { ...styleGridHeader(index, dates.length), children: date.dateString }) }),
|
|
8164
8164
|
cell: ({ getValue, row, column, table: table2 }) => {
|
|
8165
|
-
const
|
|
8165
|
+
const valueRaw = getValue();
|
|
8166
|
+
const value = valueRaw ?? null;
|
|
8166
8167
|
const rowIndex = row.index;
|
|
8167
8168
|
const columnIndex = column.getIndex();
|
|
8168
8169
|
const numberOfRows = table2.getRowModel().rows.length;
|
|
8169
8170
|
const numberOfColumns = table2.getAllColumns().length;
|
|
8171
|
+
if (valueRaw === void 0) {
|
|
8172
|
+
console.error(
|
|
8173
|
+
`Found undefined value for ${row.original.feature} - ${date.dateString}. This shouldn't happen.`
|
|
8174
|
+
);
|
|
8175
|
+
}
|
|
8170
8176
|
const tooltip2 = featureRenderer.renderTooltip(row.original.feature, date, value);
|
|
8171
8177
|
return /* @__PURE__ */ u$1("div", { className: "text-center", children: /* @__PURE__ */ u$1(
|
|
8172
8178
|
ProportionCell,
|
|
@@ -10491,13 +10497,21 @@ async function computeWastewaterMutationsOverTimeDataPerLocation(lapis, lapisFil
|
|
|
10491
10497
|
}
|
|
10492
10498
|
function groupMutationDataByLocation(data, sequenceType) {
|
|
10493
10499
|
const locationMap = /* @__PURE__ */ new Map();
|
|
10500
|
+
const locationMutations = /* @__PURE__ */ new Map();
|
|
10501
|
+
const locationDates = /* @__PURE__ */ new Map();
|
|
10494
10502
|
for (const row of data) {
|
|
10495
10503
|
if (!locationMap.has(row.location)) {
|
|
10496
10504
|
locationMap.set(row.location, new BaseMutationOverTimeDataMap());
|
|
10505
|
+
locationMutations.set(row.location, /* @__PURE__ */ new Set());
|
|
10506
|
+
locationDates.set(row.location, /* @__PURE__ */ new Set());
|
|
10497
10507
|
}
|
|
10498
10508
|
const map2 = locationMap.get(row.location);
|
|
10509
|
+
const mutations = locationMutations.get(row.location);
|
|
10510
|
+
const dates = locationDates.get(row.location);
|
|
10499
10511
|
const mutationFrequencies = sequenceType === "nucleotide" ? row.nucleotideMutationFrequency : row.aminoAcidMutationFrequency;
|
|
10500
10512
|
for (const mutation of mutationFrequencies) {
|
|
10513
|
+
dates.add(row.date.dateString);
|
|
10514
|
+
mutations.add(mutation.mutation.code);
|
|
10501
10515
|
map2.set(
|
|
10502
10516
|
mutation.mutation,
|
|
10503
10517
|
row.date,
|
|
@@ -10505,6 +10519,18 @@ function groupMutationDataByLocation(data, sequenceType) {
|
|
|
10505
10519
|
);
|
|
10506
10520
|
}
|
|
10507
10521
|
}
|
|
10522
|
+
for (const [location, map2] of locationMap.entries()) {
|
|
10523
|
+
const allMutations = Array.from(locationMutations.get(location));
|
|
10524
|
+
const allDates = Array.from(locationDates.get(location)).map((dateStr) => map2.keysSecondAxis.get(dateStr));
|
|
10525
|
+
for (const mutationCode of allMutations) {
|
|
10526
|
+
const mutation = map2.keysFirstAxis.get(mutationCode);
|
|
10527
|
+
for (const date of allDates) {
|
|
10528
|
+
if (map2.get(mutation, date) === void 0) {
|
|
10529
|
+
map2.set(mutation, date, null);
|
|
10530
|
+
}
|
|
10531
|
+
}
|
|
10532
|
+
}
|
|
10533
|
+
}
|
|
10508
10534
|
return [...locationMap.entries()].map(([location, data2]) => ({
|
|
10509
10535
|
location,
|
|
10510
10536
|
data: new SortedMap2d(
|