@genspectrum/dashboard-components 0.15.0 → 0.16.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/custom-elements.json +200 -56
- package/dist/components.d.ts +35 -35
- package/dist/components.js +311 -192
- package/dist/components.js.map +1 -1
- package/dist/style.css +9 -0
- package/dist/util.d.ts +46 -46
- package/package.json +1 -1
- package/src/preact/ReferenceGenomeContext.ts +14 -1
- package/src/preact/aggregatedData/aggregate-bar-chart.tsx +26 -5
- package/src/preact/aggregatedData/aggregate.stories.tsx +0 -1
- package/src/preact/aggregatedData/aggregate.tsx +5 -1
- package/src/preact/components/ReferenceGenomesAwaiter.tsx +1 -6
- package/src/preact/components/resize-container.tsx +1 -1
- package/src/preact/mutationComparison/mutation-comparison-venn.tsx +4 -2
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +0 -1
- package/src/preact/mutationComparison/mutation-comparison.tsx +5 -1
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +17 -1
- package/src/preact/mutationFilter/mutation-filter.tsx +8 -0
- package/src/preact/mutations/mutations.stories.tsx +0 -1
- package/src/preact/mutations/mutations.tsx +1 -1
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +0 -2
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +1 -1
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-bar-chart.tsx +8 -3
- package/src/preact/numberSequencesOverTime/number-sequences-over-time-line-chart.tsx +8 -3
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -1
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +18 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +48 -35
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +83 -70
- package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +48 -37
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +0 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +6 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +31 -23
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +0 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +5 -1
- package/src/preact/sequencesByLocation/__mockData__/worldAtlas.json +1 -0
- package/src/preact/{map → sequencesByLocation}/sequences-by-location-map.tsx +6 -3
- package/src/preact/{map → sequencesByLocation}/sequences-by-location-table.tsx +1 -1
- package/src/preact/{map → sequencesByLocation}/sequences-by-location.stories.tsx +58 -1
- package/src/preact/{map → sequencesByLocation}/sequences-by-location.tsx +10 -1
- package/src/preact/shared/aspectRatio/AspectRatio.tsx +13 -0
- package/src/preact/shared/charts/getMaintainAspectRatio.ts +3 -0
- package/src/preact/statistic/statistics.stories.tsx +0 -1
- package/src/preact/statistic/statistics.tsx +4 -4
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +0 -1
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +1 -1
- package/src/query/computeMapLocationData.spec.ts +1 -1
- package/src/query/computeMapLocationData.ts +1 -1
- package/src/query/querySequencesByLocationData.ts +1 -1
- package/src/utilEntrypoint.ts +1 -1
- package/src/web-components/ResizeContainer.mdx +4 -1
- package/src/web-components/visualization/gs-aggregate.stories.ts +13 -6
- package/src/web-components/visualization/gs-aggregate.tsx +1 -1
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +8 -1
- package/src/web-components/visualization/gs-mutation-comparison.tsx +1 -1
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +9 -1
- package/src/web-components/visualization/gs-mutations-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-mutations.stories.ts +8 -1
- package/src/web-components/visualization/gs-mutations.tsx +1 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +11 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -2
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +1 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +8 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +1 -1
- package/src/web-components/visualization/gs-sequences-by-location.stories.ts +13 -7
- package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -3
- package/src/web-components/visualization/gs-statistics.stories.ts +0 -1
- package/src/web-components/visualization/gs-statistics.tsx +1 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +9 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +1 -1
- package/standalone-bundle/dashboard-components.js +4965 -4876
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
- package/src/preact/map/__mockData__/worldAtlas.json +0 -497127
- /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedGermany.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/aggregatedWorld.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/germanyMap.json +0 -0
- /package/src/preact/{map → sequencesByLocation}/__mockData__/howToGenerateWorldMap.md +0 -0
- /package/src/preact/{map → sequencesByLocation}/leafletStyleModifications.css +0 -0
- /package/src/preact/{map → sequencesByLocation}/loadMapSource.tsx +0 -0
package/dist/components.js
CHANGED
|
@@ -954,7 +954,8 @@ const GsChart = ({ configuration }) => {
|
|
|
954
954
|
Chart.register(...registerables, VennDiagramController, ArcSlice);
|
|
955
955
|
const MutationComparisonVenn = ({
|
|
956
956
|
data,
|
|
957
|
-
proportionInterval
|
|
957
|
+
proportionInterval,
|
|
958
|
+
maintainAspectRatio
|
|
958
959
|
}) => {
|
|
959
960
|
const [selectedDatasetIndex, setSelectedDatasetIndex] = h(null);
|
|
960
961
|
const sets = T$1(
|
|
@@ -978,7 +979,7 @@ const MutationComparisonVenn = ({
|
|
|
978
979
|
type: "venn",
|
|
979
980
|
data: sets,
|
|
980
981
|
options: {
|
|
981
|
-
maintainAspectRatio
|
|
982
|
+
maintainAspectRatio,
|
|
982
983
|
scales: {
|
|
983
984
|
x: {
|
|
984
985
|
ticks: {
|
|
@@ -1021,7 +1022,7 @@ const MutationComparisonVenn = ({
|
|
|
1021
1022
|
}
|
|
1022
1023
|
}
|
|
1023
1024
|
}),
|
|
1024
|
-
[sets]
|
|
1025
|
+
[maintainAspectRatio, sets]
|
|
1025
1026
|
);
|
|
1026
1027
|
if (data.content.length > 5) {
|
|
1027
1028
|
return /* @__PURE__ */ u$1("div", { children: "Too many datasets to display. Maximum are five. " });
|
|
@@ -2018,7 +2019,14 @@ const ProportionSelectorDropdown = ({
|
|
|
2018
2019
|
}
|
|
2019
2020
|
) }) });
|
|
2020
2021
|
};
|
|
2021
|
-
const
|
|
2022
|
+
const UNINITIALIZED_SEQUENCE = "__uninitialized__";
|
|
2023
|
+
const ReferenceGenomeContext = createContext$1({
|
|
2024
|
+
nucleotideSequences: [{ name: UNINITIALIZED_SEQUENCE, sequence: "" }],
|
|
2025
|
+
genes: []
|
|
2026
|
+
});
|
|
2027
|
+
function isNotInitialized(referenceGenome) {
|
|
2028
|
+
return referenceGenome.genes.length === 0 && referenceGenome.nucleotideSequences.length === 1 && referenceGenome.nucleotideSequences[0].name === UNINITIALIZED_SEQUENCE;
|
|
2029
|
+
}
|
|
2022
2030
|
const SegmentSelector = ({
|
|
2023
2031
|
displayedSegments,
|
|
2024
2032
|
setDisplayedSegments
|
|
@@ -2084,6 +2092,9 @@ const Tabs = ({ tabs, toolbar }) => {
|
|
|
2084
2092
|
/* @__PURE__ */ u$1("div", { className: `p-2 flex-grow overflow-scroll border-2 border-gray-100 rounded-b-md rounded-tr-md`, children: tabs.map((tab) => /* @__PURE__ */ u$1("div", { className: "h-full", hidden: activeTab !== tab.title, children: tab.content }, tab.title)) })
|
|
2085
2093
|
] });
|
|
2086
2094
|
};
|
|
2095
|
+
function getMaintainAspectRatio(height) {
|
|
2096
|
+
return height === void 0 || height === "";
|
|
2097
|
+
}
|
|
2087
2098
|
function useQuery(fetchDataCallback, dependencies) {
|
|
2088
2099
|
const [data, setData] = h(null);
|
|
2089
2100
|
const [error, setError] = h(null);
|
|
@@ -2114,7 +2125,7 @@ function useQuery(fetchDataCallback, dependencies) {
|
|
|
2114
2125
|
const mutationComparisonViewSchema = z$2.union([z$2.literal(views.table), z$2.literal(views.venn)]);
|
|
2115
2126
|
const mutationComparisonPropsSchema = z$2.object({
|
|
2116
2127
|
width: z$2.string(),
|
|
2117
|
-
height: z$2.string(),
|
|
2128
|
+
height: z$2.string().optional(),
|
|
2118
2129
|
lapisFilters: z$2.array(namedLapisFilterSchema).min(1),
|
|
2119
2130
|
sequenceType: sequenceTypeSchema,
|
|
2120
2131
|
views: z$2.array(mutationComparisonViewSchema),
|
|
@@ -2153,6 +2164,7 @@ const MutationComparisonTabs = ({ data, originalComponentProps }) => {
|
|
|
2153
2164
|
() => filterMutationData(data, displayedSegments, displayedMutationTypes),
|
|
2154
2165
|
[data, displayedSegments, displayedMutationTypes]
|
|
2155
2166
|
);
|
|
2167
|
+
const maintainAspectRatio = getMaintainAspectRatio(originalComponentProps.height);
|
|
2156
2168
|
const getTab = (view) => {
|
|
2157
2169
|
switch (view) {
|
|
2158
2170
|
case "table":
|
|
@@ -2174,7 +2186,8 @@ const MutationComparisonTabs = ({ data, originalComponentProps }) => {
|
|
|
2174
2186
|
MutationComparisonVenn,
|
|
2175
2187
|
{
|
|
2176
2188
|
data: { content: filteredData },
|
|
2177
|
-
proportionInterval
|
|
2189
|
+
proportionInterval,
|
|
2190
|
+
maintainAspectRatio
|
|
2178
2191
|
}
|
|
2179
2192
|
)
|
|
2180
2193
|
};
|
|
@@ -4955,6 +4968,9 @@ input.tab:checked + .tab-content,
|
|
|
4955
4968
|
.relative {
|
|
4956
4969
|
position: relative;
|
|
4957
4970
|
}
|
|
4971
|
+
.inset-0 {
|
|
4972
|
+
inset: 0px;
|
|
4973
|
+
}
|
|
4958
4974
|
.-right-3 {
|
|
4959
4975
|
right: -0.75rem;
|
|
4960
4976
|
}
|
|
@@ -5138,6 +5154,9 @@ input.tab:checked + .tab-content,
|
|
|
5138
5154
|
.min-w-32 {
|
|
5139
5155
|
min-width: 8rem;
|
|
5140
5156
|
}
|
|
5157
|
+
.min-w-\\[180px\\] {
|
|
5158
|
+
min-width: 180px;
|
|
5159
|
+
}
|
|
5141
5160
|
.min-w-\\[7\\.5rem\\] {
|
|
5142
5161
|
min-width: 7.5rem;
|
|
5143
5162
|
}
|
|
@@ -5221,6 +5240,9 @@ input.tab:checked + .tab-content,
|
|
|
5221
5240
|
.whitespace-nowrap {
|
|
5222
5241
|
white-space: nowrap;
|
|
5223
5242
|
}
|
|
5243
|
+
.text-wrap {
|
|
5244
|
+
text-wrap: wrap;
|
|
5245
|
+
}
|
|
5224
5246
|
.text-nowrap {
|
|
5225
5247
|
text-wrap: nowrap;
|
|
5226
5248
|
}
|
|
@@ -5600,7 +5622,7 @@ let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
5600
5622
|
this.sequenceType = "nucleotide";
|
|
5601
5623
|
this.views = ["table"];
|
|
5602
5624
|
this.width = "100%";
|
|
5603
|
-
this.height =
|
|
5625
|
+
this.height = void 0;
|
|
5604
5626
|
this.pageSize = false;
|
|
5605
5627
|
}
|
|
5606
5628
|
render() {
|
|
@@ -5983,7 +6005,7 @@ const mutationsPropsSchema = z$2.object({
|
|
|
5983
6005
|
views: mutationsViewSchema.array(),
|
|
5984
6006
|
pageSize: z$2.union([z$2.boolean(), z$2.number()]),
|
|
5985
6007
|
width: z$2.string(),
|
|
5986
|
-
height: z$2.string()
|
|
6008
|
+
height: z$2.string().optional()
|
|
5987
6009
|
});
|
|
5988
6010
|
const Mutations = (componentProps) => {
|
|
5989
6011
|
const { width, height } = componentProps;
|
|
@@ -6168,7 +6190,7 @@ let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
6168
6190
|
this.sequenceType = "nucleotide";
|
|
6169
6191
|
this.views = ["table", "grid"];
|
|
6170
6192
|
this.width = "100%";
|
|
6171
|
-
this.height =
|
|
6193
|
+
this.height = void 0;
|
|
6172
6194
|
this.pageSize = false;
|
|
6173
6195
|
}
|
|
6174
6196
|
render() {
|
|
@@ -6326,42 +6348,51 @@ function getYAxisScale(scaleType) {
|
|
|
6326
6348
|
}
|
|
6327
6349
|
}
|
|
6328
6350
|
Chart.register(...registerables, LogitScale, BarWithErrorBarsController, BarWithErrorBar);
|
|
6351
|
+
const NO_DATA$2 = "noData";
|
|
6329
6352
|
const PrevalenceOverTimeBarChart = ({
|
|
6330
6353
|
data,
|
|
6331
6354
|
yAxisScaleType,
|
|
6332
6355
|
confidenceIntervalMethod,
|
|
6333
|
-
yAxisMaxConfig
|
|
6356
|
+
yAxisMaxConfig,
|
|
6357
|
+
maintainAspectRatio
|
|
6334
6358
|
}) => {
|
|
6335
|
-
const
|
|
6359
|
+
const config = T$1(() => {
|
|
6360
|
+
const nullFirstData = data.filter((prevalenceOverTimeData) => prevalenceOverTimeData.content.length > 0).map((variantData) => {
|
|
6361
|
+
return {
|
|
6362
|
+
content: variantData.content.sort(sortNullToBeginningThenByDate),
|
|
6363
|
+
displayName: variantData.displayName
|
|
6364
|
+
};
|
|
6365
|
+
});
|
|
6366
|
+
if (nullFirstData.length === 0) {
|
|
6367
|
+
return NO_DATA$2;
|
|
6368
|
+
}
|
|
6369
|
+
const datasets2 = nullFirstData.map(
|
|
6370
|
+
(graphData, index) => getDataset$1(graphData, index, confidenceIntervalMethod)
|
|
6371
|
+
);
|
|
6372
|
+
const maxY = yAxisScaleType !== "logit" ? getYAxisMax(maxInData(nullFirstData), yAxisMaxConfig == null ? void 0 : yAxisMaxConfig[yAxisScaleType]) : void 0;
|
|
6336
6373
|
return {
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
});
|
|
6341
|
-
if (nullFirstData.length === 0) {
|
|
6342
|
-
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
6343
|
-
}
|
|
6344
|
-
const datasets2 = nullFirstData.map((graphData, index) => getDataset$1(graphData, index, confidenceIntervalMethod));
|
|
6345
|
-
const maxY = yAxisScaleType !== "logit" ? getYAxisMax(maxInData(nullFirstData), yAxisMaxConfig == null ? void 0 : yAxisMaxConfig[yAxisScaleType]) : void 0;
|
|
6346
|
-
const config = {
|
|
6347
|
-
type: BarWithErrorBarsController.id,
|
|
6348
|
-
data: {
|
|
6349
|
-
datasets: datasets2
|
|
6350
|
-
},
|
|
6351
|
-
options: {
|
|
6352
|
-
maintainAspectRatio: false,
|
|
6353
|
-
animation: false,
|
|
6354
|
-
scales: {
|
|
6355
|
-
y: { ...getYAxisScale(yAxisScaleType), max: maxY }
|
|
6374
|
+
type: BarWithErrorBarsController.id,
|
|
6375
|
+
data: {
|
|
6376
|
+
datasets: datasets2
|
|
6356
6377
|
},
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6378
|
+
options: {
|
|
6379
|
+
maintainAspectRatio,
|
|
6380
|
+
animation: false,
|
|
6381
|
+
scales: {
|
|
6382
|
+
y: { ...getYAxisScale(yAxisScaleType), max: maxY }
|
|
6360
6383
|
},
|
|
6361
|
-
|
|
6384
|
+
plugins: {
|
|
6385
|
+
legend: {
|
|
6386
|
+
display: false
|
|
6387
|
+
},
|
|
6388
|
+
tooltip: tooltip$2(confidenceIntervalMethod)
|
|
6389
|
+
}
|
|
6362
6390
|
}
|
|
6363
|
-
}
|
|
6364
|
-
};
|
|
6391
|
+
};
|
|
6392
|
+
}, [data, yAxisScaleType, confidenceIntervalMethod, yAxisMaxConfig, maintainAspectRatio]);
|
|
6393
|
+
if (config === NO_DATA$2) {
|
|
6394
|
+
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
6395
|
+
}
|
|
6365
6396
|
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
6366
6397
|
};
|
|
6367
6398
|
const getDataset$1 = (prevalenceOverTimeVariant, index, confidenceIntervalMethod) => {
|
|
@@ -7356,120 +7387,134 @@ function getMinMaxNumber(values) {
|
|
|
7356
7387
|
return [min, max];
|
|
7357
7388
|
}
|
|
7358
7389
|
Chart.register(...registerables, LogitScale);
|
|
7390
|
+
const NO_DATA$1 = "noData";
|
|
7359
7391
|
const PrevalenceOverTimeBubbleChart = ({
|
|
7360
7392
|
data,
|
|
7361
7393
|
yAxisScaleType,
|
|
7362
|
-
yAxisMaxConfig
|
|
7394
|
+
yAxisMaxConfig,
|
|
7395
|
+
maintainAspectRatio
|
|
7363
7396
|
}) => {
|
|
7364
|
-
const
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7397
|
+
const config = T$1(() => {
|
|
7398
|
+
const nonNullDateRangeData = data.filter((prevalenceOverTimeData) => prevalenceOverTimeData.content.length > 0).map((variantData) => {
|
|
7399
|
+
return {
|
|
7400
|
+
content: variantData.content.filter((dataPoint) => dataPoint.dateRange !== null),
|
|
7401
|
+
displayName: variantData.displayName
|
|
7402
|
+
};
|
|
7403
|
+
});
|
|
7404
|
+
if (nonNullDateRangeData.length === 0) {
|
|
7405
|
+
return NO_DATA$1;
|
|
7406
|
+
}
|
|
7407
|
+
const firstDate = nonNullDateRangeData[0].content[0].dateRange;
|
|
7408
|
+
const total = nonNullDateRangeData.map((graphData) => graphData.content.map((dataPoint) => dataPoint.total)).flat();
|
|
7409
|
+
const [minTotal, maxTotal] = getMinMaxNumber(total);
|
|
7410
|
+
const scaleBubble = (value) => {
|
|
7411
|
+
return (value - minTotal) / (maxTotal - minTotal) * 4.5 + 0.5;
|
|
7368
7412
|
};
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
data: graphData.content.filter((dataPoint) => dataPoint.dateRange !== null).map((dataPoint) => ({
|
|
7386
|
-
x: minusTemporal(dataPoint.dateRange, firstDate),
|
|
7387
|
-
y: dataPoint.prevalence,
|
|
7388
|
-
r: scaleBubble(dataPoint.total)
|
|
7389
|
-
})),
|
|
7390
|
-
borderWidth: 1,
|
|
7391
|
-
pointRadius: 0,
|
|
7392
|
-
backgroundColor: singleGraphColorRGBAById(index, 0.3),
|
|
7393
|
-
borderColor: singleGraphColorRGBAById(index)
|
|
7394
|
-
}))
|
|
7395
|
-
},
|
|
7396
|
-
options: {
|
|
7397
|
-
animation: false,
|
|
7398
|
-
maintainAspectRatio: false,
|
|
7399
|
-
scales: {
|
|
7400
|
-
x: {
|
|
7401
|
-
ticks: {
|
|
7402
|
-
callback: (value) => addUnit(firstDate, value).toString()
|
|
7403
|
-
}
|
|
7404
|
-
},
|
|
7405
|
-
y: { ...getYAxisScale(yAxisScaleType), max: maxY }
|
|
7413
|
+
const maxY = yAxisScaleType !== "logit" ? getYAxisMax(maxInData(nonNullDateRangeData), yAxisMaxConfig == null ? void 0 : yAxisMaxConfig[yAxisScaleType]) : void 0;
|
|
7414
|
+
return {
|
|
7415
|
+
type: "bubble",
|
|
7416
|
+
data: {
|
|
7417
|
+
datasets: nonNullDateRangeData.map((graphData, index) => ({
|
|
7418
|
+
label: graphData.displayName,
|
|
7419
|
+
data: graphData.content.filter((dataPoint) => dataPoint.dateRange !== null).map((dataPoint) => ({
|
|
7420
|
+
x: minusTemporal(dataPoint.dateRange, firstDate),
|
|
7421
|
+
y: dataPoint.prevalence,
|
|
7422
|
+
r: scaleBubble(dataPoint.total)
|
|
7423
|
+
})),
|
|
7424
|
+
borderWidth: 1,
|
|
7425
|
+
pointRadius: 0,
|
|
7426
|
+
backgroundColor: singleGraphColorRGBAById(index, 0.3),
|
|
7427
|
+
borderColor: singleGraphColorRGBAById(index)
|
|
7428
|
+
}))
|
|
7406
7429
|
},
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7430
|
+
options: {
|
|
7431
|
+
animation: false,
|
|
7432
|
+
maintainAspectRatio,
|
|
7433
|
+
scales: {
|
|
7434
|
+
x: {
|
|
7435
|
+
ticks: {
|
|
7436
|
+
callback: (value) => addUnit(firstDate, value).toString()
|
|
7437
|
+
}
|
|
7438
|
+
},
|
|
7439
|
+
y: { ...getYAxisScale(yAxisScaleType), max: maxY }
|
|
7410
7440
|
},
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7441
|
+
plugins: {
|
|
7442
|
+
legend: {
|
|
7443
|
+
display: false
|
|
7444
|
+
},
|
|
7445
|
+
tooltip: {
|
|
7446
|
+
mode: "index",
|
|
7447
|
+
intersect: false,
|
|
7448
|
+
callbacks: {
|
|
7449
|
+
title: (context) => {
|
|
7450
|
+
var _a;
|
|
7451
|
+
const dataset = nonNullDateRangeData[context[0].datasetIndex];
|
|
7452
|
+
const dataPoint = dataset.content[context[0].dataIndex];
|
|
7453
|
+
return (_a = dataPoint.dateRange) == null ? void 0 : _a.toString();
|
|
7454
|
+
},
|
|
7455
|
+
label: (context) => {
|
|
7456
|
+
const dataset = nonNullDateRangeData[context.datasetIndex];
|
|
7457
|
+
const dataPoint = dataset.content[context.dataIndex];
|
|
7458
|
+
const percentage = (dataPoint.prevalence * 100).toFixed(2);
|
|
7459
|
+
const count = dataPoint.count.toFixed(0);
|
|
7460
|
+
const total2 = dataPoint.total.toFixed(0);
|
|
7461
|
+
return `${dataset.displayName}: ${percentage}%, ${count}/${total2} samples`;
|
|
7462
|
+
}
|
|
7428
7463
|
}
|
|
7429
7464
|
}
|
|
7430
7465
|
}
|
|
7431
7466
|
}
|
|
7432
|
-
}
|
|
7433
|
-
};
|
|
7467
|
+
};
|
|
7468
|
+
}, [data, maintainAspectRatio, yAxisMaxConfig, yAxisScaleType]);
|
|
7469
|
+
if (config === NO_DATA$1) {
|
|
7470
|
+
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
7471
|
+
}
|
|
7434
7472
|
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
7435
7473
|
};
|
|
7436
7474
|
Chart.register(...registerables, LogitScale);
|
|
7475
|
+
const NO_DATA = "noData";
|
|
7437
7476
|
const PrevalenceOverTimeLineChart = ({
|
|
7438
7477
|
data,
|
|
7439
7478
|
yAxisScaleType,
|
|
7440
7479
|
confidenceIntervalMethod,
|
|
7441
|
-
yAxisMaxConfig
|
|
7480
|
+
yAxisMaxConfig,
|
|
7481
|
+
maintainAspectRatio
|
|
7442
7482
|
}) => {
|
|
7443
|
-
const
|
|
7483
|
+
const config = T$1(() => {
|
|
7484
|
+
const nonNullDateRangeData = data.filter((prevalenceOverTimeData) => prevalenceOverTimeData.content.length > 0).map((variantData) => {
|
|
7485
|
+
return {
|
|
7486
|
+
content: variantData.content.filter((dataPoint) => dataPoint.dateRange !== null),
|
|
7487
|
+
displayName: variantData.displayName
|
|
7488
|
+
};
|
|
7489
|
+
});
|
|
7490
|
+
if (nonNullDateRangeData.length === 0) {
|
|
7491
|
+
return NO_DATA;
|
|
7492
|
+
}
|
|
7493
|
+
const datasets2 = nonNullDateRangeData.map((graphData, index) => getDataset(graphData, index, confidenceIntervalMethod)).flat();
|
|
7494
|
+
const maxY = yAxisScaleType !== "logit" ? getYAxisMax(maxInData(nonNullDateRangeData), yAxisMaxConfig == null ? void 0 : yAxisMaxConfig[yAxisScaleType]) : void 0;
|
|
7444
7495
|
return {
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
});
|
|
7449
|
-
if (nonNullDateRangeData.length === 0) {
|
|
7450
|
-
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
7451
|
-
}
|
|
7452
|
-
const datasets2 = nonNullDateRangeData.map((graphData, index) => getDataset(graphData, index, confidenceIntervalMethod)).flat();
|
|
7453
|
-
const maxY = yAxisScaleType !== "logit" ? getYAxisMax(maxInData(nonNullDateRangeData), yAxisMaxConfig == null ? void 0 : yAxisMaxConfig[yAxisScaleType]) : void 0;
|
|
7454
|
-
const config = {
|
|
7455
|
-
type: "line",
|
|
7456
|
-
data: {
|
|
7457
|
-
datasets: datasets2
|
|
7458
|
-
},
|
|
7459
|
-
options: {
|
|
7460
|
-
animation: false,
|
|
7461
|
-
maintainAspectRatio: false,
|
|
7462
|
-
scales: {
|
|
7463
|
-
y: { ...getYAxisScale(yAxisScaleType), max: maxY }
|
|
7496
|
+
type: "line",
|
|
7497
|
+
data: {
|
|
7498
|
+
datasets: datasets2
|
|
7464
7499
|
},
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7500
|
+
options: {
|
|
7501
|
+
animation: false,
|
|
7502
|
+
maintainAspectRatio,
|
|
7503
|
+
scales: {
|
|
7504
|
+
y: { ...getYAxisScale(yAxisScaleType), max: maxY }
|
|
7468
7505
|
},
|
|
7469
|
-
|
|
7506
|
+
plugins: {
|
|
7507
|
+
legend: {
|
|
7508
|
+
display: false
|
|
7509
|
+
},
|
|
7510
|
+
tooltip: tooltip$1(confidenceIntervalMethod)
|
|
7511
|
+
}
|
|
7470
7512
|
}
|
|
7471
|
-
}
|
|
7472
|
-
};
|
|
7513
|
+
};
|
|
7514
|
+
}, [data, yAxisScaleType, confidenceIntervalMethod, yAxisMaxConfig, maintainAspectRatio]);
|
|
7515
|
+
if (config === NO_DATA) {
|
|
7516
|
+
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
7517
|
+
}
|
|
7473
7518
|
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
7474
7519
|
};
|
|
7475
7520
|
const getDataset = (prevalenceOverTimeVariant, dataIndex, confidenceIntervalMethod) => {
|
|
@@ -7855,7 +7900,7 @@ const prevalenceOverTimeViewSchema = z$2.union([
|
|
|
7855
7900
|
]);
|
|
7856
7901
|
const prevalenceOverTimePropsSchema = z$2.object({
|
|
7857
7902
|
width: z$2.string(),
|
|
7858
|
-
height: z$2.string(),
|
|
7903
|
+
height: z$2.string().optional(),
|
|
7859
7904
|
numeratorFilters: z$2.array(namedLapisFilterSchema).min(1),
|
|
7860
7905
|
denominatorFilter: lapisFilterSchema,
|
|
7861
7906
|
granularity: temporalGranularitySchema,
|
|
@@ -7912,6 +7957,7 @@ const PrevalenceOverTimeTabs = ({ data, ...componentProps }) => {
|
|
|
7912
7957
|
});
|
|
7913
7958
|
}, [confidenceIntervalMethods]);
|
|
7914
7959
|
const yAxisMaxConfig = { linear: yAxisMaxLinear, logarithmic: yAxisMaxLogarithmic };
|
|
7960
|
+
const maintainAspectRatio = getMaintainAspectRatio(componentProps.height);
|
|
7915
7961
|
const getTab = (view) => {
|
|
7916
7962
|
switch (view) {
|
|
7917
7963
|
case "bar":
|
|
@@ -7923,7 +7969,8 @@ const PrevalenceOverTimeTabs = ({ data, ...componentProps }) => {
|
|
|
7923
7969
|
data,
|
|
7924
7970
|
yAxisScaleType,
|
|
7925
7971
|
confidenceIntervalMethod,
|
|
7926
|
-
yAxisMaxConfig
|
|
7972
|
+
yAxisMaxConfig,
|
|
7973
|
+
maintainAspectRatio
|
|
7927
7974
|
}
|
|
7928
7975
|
)
|
|
7929
7976
|
};
|
|
@@ -7936,7 +7983,8 @@ const PrevalenceOverTimeTabs = ({ data, ...componentProps }) => {
|
|
|
7936
7983
|
data,
|
|
7937
7984
|
yAxisScaleType,
|
|
7938
7985
|
confidenceIntervalMethod,
|
|
7939
|
-
yAxisMaxConfig
|
|
7986
|
+
yAxisMaxConfig,
|
|
7987
|
+
maintainAspectRatio
|
|
7940
7988
|
}
|
|
7941
7989
|
)
|
|
7942
7990
|
};
|
|
@@ -7948,7 +7996,8 @@ const PrevalenceOverTimeTabs = ({ data, ...componentProps }) => {
|
|
|
7948
7996
|
{
|
|
7949
7997
|
data,
|
|
7950
7998
|
yAxisScaleType,
|
|
7951
|
-
yAxisMaxConfig
|
|
7999
|
+
yAxisMaxConfig,
|
|
8000
|
+
maintainAspectRatio
|
|
7952
8001
|
}
|
|
7953
8002
|
)
|
|
7954
8003
|
};
|
|
@@ -8053,7 +8102,7 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
8053
8102
|
this.views = ["bar", "line", "bubble", "table"];
|
|
8054
8103
|
this.confidenceIntervalMethods = ["none", "wilson"];
|
|
8055
8104
|
this.width = "100%";
|
|
8056
|
-
this.height =
|
|
8105
|
+
this.height = void 0;
|
|
8057
8106
|
this.lapisDateField = "";
|
|
8058
8107
|
this.pageSize = false;
|
|
8059
8108
|
this.yAxisMaxLinear = 1;
|
|
@@ -8119,28 +8168,35 @@ PrevalenceOverTimeComponent = __decorateClass$c([
|
|
|
8119
8168
|
t$3("gs-prevalence-over-time")
|
|
8120
8169
|
], PrevalenceOverTimeComponent);
|
|
8121
8170
|
Chart.register(...registerables, LogitScale);
|
|
8122
|
-
const RelativeGrowthAdvantageChart = ({
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8171
|
+
const RelativeGrowthAdvantageChart = ({
|
|
8172
|
+
data,
|
|
8173
|
+
yAxisScaleType,
|
|
8174
|
+
yAxisMaxConfig,
|
|
8175
|
+
maintainAspectRatio
|
|
8176
|
+
}) => {
|
|
8177
|
+
const config = T$1(() => {
|
|
8178
|
+
const maxY = yAxisScaleType !== "logit" ? getYAxisMax(Math.max(...data.proportion), yAxisMaxConfig == null ? void 0 : yAxisMaxConfig[yAxisScaleType]) : void 0;
|
|
8179
|
+
return {
|
|
8180
|
+
type: "line",
|
|
8181
|
+
data: {
|
|
8182
|
+
labels: data.t,
|
|
8183
|
+
datasets: datasets(data)
|
|
8135
8184
|
},
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8185
|
+
options: {
|
|
8186
|
+
maintainAspectRatio,
|
|
8187
|
+
animation: false,
|
|
8188
|
+
scales: {
|
|
8189
|
+
y: { ...getYAxisScale(yAxisScaleType), max: maxY }
|
|
8139
8190
|
},
|
|
8140
|
-
|
|
8191
|
+
plugins: {
|
|
8192
|
+
legend: {
|
|
8193
|
+
display: false
|
|
8194
|
+
},
|
|
8195
|
+
tooltip: tooltip()
|
|
8196
|
+
}
|
|
8141
8197
|
}
|
|
8142
|
-
}
|
|
8143
|
-
};
|
|
8198
|
+
};
|
|
8199
|
+
}, [data, yAxisScaleType, yAxisMaxConfig, maintainAspectRatio]);
|
|
8144
8200
|
return /* @__PURE__ */ u$1("div", { className: "flex h-full flex-col", children: [
|
|
8145
8201
|
/* @__PURE__ */ u$1(
|
|
8146
8202
|
RelativeGrowthAdvantageDisplay,
|
|
@@ -8348,7 +8404,7 @@ function toYearMonthDay(d2) {
|
|
|
8348
8404
|
const relativeGrowthAdvantageViewSchema = z$2.literal(views.line);
|
|
8349
8405
|
const relativeGrowthAdvantagePropsSchema = z$2.object({
|
|
8350
8406
|
width: z$2.string(),
|
|
8351
|
-
height: z$2.string(),
|
|
8407
|
+
height: z$2.string().optional(),
|
|
8352
8408
|
numeratorFilter: lapisFilterSchema,
|
|
8353
8409
|
denominatorFilter: lapisFilterSchema,
|
|
8354
8410
|
generationTime: z$2.number(),
|
|
@@ -8398,6 +8454,7 @@ const RelativeGrowthAdvantageTabs = ({
|
|
|
8398
8454
|
setYAxisScaleType,
|
|
8399
8455
|
originalComponentProps
|
|
8400
8456
|
}) => {
|
|
8457
|
+
const maintainAspectRatio = getMaintainAspectRatio(originalComponentProps.height);
|
|
8401
8458
|
const getTab = (view) => {
|
|
8402
8459
|
switch (view) {
|
|
8403
8460
|
case "line":
|
|
@@ -8415,7 +8472,8 @@ const RelativeGrowthAdvantageTabs = ({
|
|
|
8415
8472
|
yAxisMaxConfig: {
|
|
8416
8473
|
linear: originalComponentProps.yAxisMaxLinear,
|
|
8417
8474
|
logarithmic: originalComponentProps.yAxisMaxLogarithmic
|
|
8418
|
-
}
|
|
8475
|
+
},
|
|
8476
|
+
maintainAspectRatio
|
|
8419
8477
|
}
|
|
8420
8478
|
)
|
|
8421
8479
|
};
|
|
@@ -8494,7 +8552,7 @@ let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
|
|
|
8494
8552
|
this.generationTime = 7;
|
|
8495
8553
|
this.views = ["line"];
|
|
8496
8554
|
this.width = "100%";
|
|
8497
|
-
this.height =
|
|
8555
|
+
this.height = void 0;
|
|
8498
8556
|
this.lapisDateField = "";
|
|
8499
8557
|
this.yAxisMaxLinear = 1;
|
|
8500
8558
|
this.yAxisMaxLogarithmic = 1;
|
|
@@ -8604,7 +8662,12 @@ const AggregateTable = ({
|
|
|
8604
8662
|
return /* @__PURE__ */ u$1(Table, { data: sortedData, columns: headers, pageSize });
|
|
8605
8663
|
};
|
|
8606
8664
|
Chart.register(...registerables, BarController);
|
|
8607
|
-
const AggregateBarChart = ({
|
|
8665
|
+
const AggregateBarChart = ({
|
|
8666
|
+
data,
|
|
8667
|
+
fields,
|
|
8668
|
+
maxNumberOfBars,
|
|
8669
|
+
maintainAspectRatio
|
|
8670
|
+
}) => {
|
|
8608
8671
|
if (data.length === 0) {
|
|
8609
8672
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
8610
8673
|
}
|
|
@@ -8620,9 +8683,22 @@ const AggregateBarChart = ({ data, fields, maxNumberOfBars }) => {
|
|
|
8620
8683
|
`Cannot display a bar chart when the "fields" attribute of this component contains more than two values. Got the fields: ${fields.join(", ")}. This must be fixed by the administrator of this page.`
|
|
8621
8684
|
);
|
|
8622
8685
|
}
|
|
8623
|
-
return /* @__PURE__ */ u$1(
|
|
8686
|
+
return /* @__PURE__ */ u$1(
|
|
8687
|
+
AggregateBarChartInner,
|
|
8688
|
+
{
|
|
8689
|
+
data,
|
|
8690
|
+
fields,
|
|
8691
|
+
maxNumberOfBars,
|
|
8692
|
+
maintainAspectRatio
|
|
8693
|
+
}
|
|
8694
|
+
);
|
|
8624
8695
|
};
|
|
8625
|
-
const AggregateBarChartInner = ({
|
|
8696
|
+
const AggregateBarChartInner = ({
|
|
8697
|
+
data,
|
|
8698
|
+
fields,
|
|
8699
|
+
maxNumberOfBars,
|
|
8700
|
+
maintainAspectRatio
|
|
8701
|
+
}) => {
|
|
8626
8702
|
const config = T$1(() => {
|
|
8627
8703
|
const { datasets: datasets2, countsOfEachBar } = getDatasets$2(fields, maxNumberOfBars, data);
|
|
8628
8704
|
return {
|
|
@@ -8631,7 +8707,7 @@ const AggregateBarChartInner = ({ data, fields, maxNumberOfBars }) => {
|
|
|
8631
8707
|
datasets: datasets2
|
|
8632
8708
|
},
|
|
8633
8709
|
options: {
|
|
8634
|
-
maintainAspectRatio
|
|
8710
|
+
maintainAspectRatio,
|
|
8635
8711
|
animation: false,
|
|
8636
8712
|
indexAxis: "y",
|
|
8637
8713
|
scales: {
|
|
@@ -8639,7 +8715,10 @@ const AggregateBarChartInner = ({ data, fields, maxNumberOfBars }) => {
|
|
|
8639
8715
|
stacked: true
|
|
8640
8716
|
},
|
|
8641
8717
|
y: {
|
|
8642
|
-
stacked: true
|
|
8718
|
+
stacked: true,
|
|
8719
|
+
ticks: {
|
|
8720
|
+
autoSkip: false
|
|
8721
|
+
}
|
|
8643
8722
|
}
|
|
8644
8723
|
},
|
|
8645
8724
|
plugins: {
|
|
@@ -8661,7 +8740,7 @@ const AggregateBarChartInner = ({ data, fields, maxNumberOfBars }) => {
|
|
|
8661
8740
|
}
|
|
8662
8741
|
}
|
|
8663
8742
|
};
|
|
8664
|
-
}, [data, fields, maxNumberOfBars]);
|
|
8743
|
+
}, [data, fields, maintainAspectRatio, maxNumberOfBars]);
|
|
8665
8744
|
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
8666
8745
|
};
|
|
8667
8746
|
function getDatasets$2(fields, maxNumberOfBars, data) {
|
|
@@ -8731,7 +8810,7 @@ const aggregatePropsSchema = z$2.object({
|
|
|
8731
8810
|
initialSortDirection: z$2.union([z$2.literal("ascending"), z$2.literal("descending")]),
|
|
8732
8811
|
pageSize: z$2.union([z$2.boolean(), z$2.number()]),
|
|
8733
8812
|
width: z$2.string(),
|
|
8734
|
-
height: z$2.string(),
|
|
8813
|
+
height: z$2.string().optional(),
|
|
8735
8814
|
maxNumberOfBars: z$2.number()
|
|
8736
8815
|
});
|
|
8737
8816
|
const Aggregate = (componentProps) => {
|
|
@@ -8757,6 +8836,7 @@ const AggregateInner = (componentProps) => {
|
|
|
8757
8836
|
return /* @__PURE__ */ u$1(AggregatedDataTabs, { data, originalComponentProps: componentProps });
|
|
8758
8837
|
};
|
|
8759
8838
|
const AggregatedDataTabs = ({ data, originalComponentProps }) => {
|
|
8839
|
+
const maintainAspectRatio = getMaintainAspectRatio(originalComponentProps.height);
|
|
8760
8840
|
const getTab = (view) => {
|
|
8761
8841
|
switch (view) {
|
|
8762
8842
|
case views.table:
|
|
@@ -8781,7 +8861,8 @@ const AggregatedDataTabs = ({ data, originalComponentProps }) => {
|
|
|
8781
8861
|
{
|
|
8782
8862
|
data,
|
|
8783
8863
|
fields: originalComponentProps.fields,
|
|
8784
|
-
maxNumberOfBars: originalComponentProps.maxNumberOfBars
|
|
8864
|
+
maxNumberOfBars: originalComponentProps.maxNumberOfBars,
|
|
8865
|
+
maintainAspectRatio
|
|
8785
8866
|
}
|
|
8786
8867
|
)
|
|
8787
8868
|
};
|
|
@@ -8827,7 +8908,7 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
8827
8908
|
this.views = ["table"];
|
|
8828
8909
|
this.lapisFilter = {};
|
|
8829
8910
|
this.width = "100%";
|
|
8830
|
-
this.height =
|
|
8911
|
+
this.height = void 0;
|
|
8831
8912
|
this.initialSortField = "count";
|
|
8832
8913
|
this.initialSortDirection = "descending";
|
|
8833
8914
|
this.pageSize = false;
|
|
@@ -8911,7 +8992,11 @@ const getNumberOfSequencesOverTimeTableData = (data, dateRangeKey) => {
|
|
|
8911
8992
|
});
|
|
8912
8993
|
};
|
|
8913
8994
|
Chart.register(...registerables);
|
|
8914
|
-
const NumberSequencesOverTimeBarChart = ({
|
|
8995
|
+
const NumberSequencesOverTimeBarChart = ({
|
|
8996
|
+
data,
|
|
8997
|
+
yAxisScaleType,
|
|
8998
|
+
maintainAspectRatio
|
|
8999
|
+
}) => {
|
|
8915
9000
|
const config = T$1(
|
|
8916
9001
|
() => ({
|
|
8917
9002
|
type: "bar",
|
|
@@ -8919,7 +9004,7 @@ const NumberSequencesOverTimeBarChart = ({ data, yAxisScaleType }) => {
|
|
|
8919
9004
|
datasets: getDatasets$1(data)
|
|
8920
9005
|
},
|
|
8921
9006
|
options: {
|
|
8922
|
-
maintainAspectRatio
|
|
9007
|
+
maintainAspectRatio,
|
|
8923
9008
|
animation: false,
|
|
8924
9009
|
scales: {
|
|
8925
9010
|
y: {
|
|
@@ -8937,7 +9022,7 @@ const NumberSequencesOverTimeBarChart = ({ data, yAxisScaleType }) => {
|
|
|
8937
9022
|
}
|
|
8938
9023
|
}
|
|
8939
9024
|
}),
|
|
8940
|
-
[data, yAxisScaleType]
|
|
9025
|
+
[data, maintainAspectRatio, yAxisScaleType]
|
|
8941
9026
|
);
|
|
8942
9027
|
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
8943
9028
|
};
|
|
@@ -8957,7 +9042,11 @@ const getDatasets$1 = (data) => {
|
|
|
8957
9042
|
);
|
|
8958
9043
|
};
|
|
8959
9044
|
Chart.register(...registerables);
|
|
8960
|
-
const NumberSequencesOverTimeLineChart = ({
|
|
9045
|
+
const NumberSequencesOverTimeLineChart = ({
|
|
9046
|
+
data,
|
|
9047
|
+
yAxisScaleType,
|
|
9048
|
+
maintainAspectRatio
|
|
9049
|
+
}) => {
|
|
8961
9050
|
const config = T$1(
|
|
8962
9051
|
() => ({
|
|
8963
9052
|
type: "line",
|
|
@@ -8965,7 +9054,7 @@ const NumberSequencesOverTimeLineChart = ({ data, yAxisScaleType }) => {
|
|
|
8965
9054
|
datasets: getDatasets(data)
|
|
8966
9055
|
},
|
|
8967
9056
|
options: {
|
|
8968
|
-
maintainAspectRatio
|
|
9057
|
+
maintainAspectRatio,
|
|
8969
9058
|
animation: false,
|
|
8970
9059
|
scales: {
|
|
8971
9060
|
y: {
|
|
@@ -8983,7 +9072,7 @@ const NumberSequencesOverTimeLineChart = ({ data, yAxisScaleType }) => {
|
|
|
8983
9072
|
}
|
|
8984
9073
|
}
|
|
8985
9074
|
}),
|
|
8986
|
-
[data, yAxisScaleType]
|
|
9075
|
+
[data, maintainAspectRatio, yAxisScaleType]
|
|
8987
9076
|
);
|
|
8988
9077
|
return /* @__PURE__ */ u$1(GsChart, { configuration: config });
|
|
8989
9078
|
};
|
|
@@ -9042,7 +9131,7 @@ const numberSequencesOverTimeViewSchema = z$2.union([
|
|
|
9042
9131
|
]);
|
|
9043
9132
|
const numberSequencesOverTimePropsSchema = z$2.object({
|
|
9044
9133
|
width: z$2.string(),
|
|
9045
|
-
height: z$2.string(),
|
|
9134
|
+
height: z$2.string().optional(),
|
|
9046
9135
|
lapisFilters: z$2.array(namedLapisFilterSchema).min(1),
|
|
9047
9136
|
lapisDateField: z$2.string().min(1),
|
|
9048
9137
|
views: z$2.array(numberSequencesOverTimeViewSchema),
|
|
@@ -9075,17 +9164,32 @@ const NumberSequencesOverTimeInner = (componentProps) => {
|
|
|
9075
9164
|
};
|
|
9076
9165
|
const NumberSequencesOverTimeTabs = ({ data, originalComponentProps }) => {
|
|
9077
9166
|
const [yAxisScaleType, setYAxisScaleType] = h("linear");
|
|
9167
|
+
const maintainAspectRatio = getMaintainAspectRatio(originalComponentProps.height);
|
|
9078
9168
|
const getTab = (view) => {
|
|
9079
9169
|
switch (view) {
|
|
9080
9170
|
case "bar":
|
|
9081
9171
|
return {
|
|
9082
9172
|
title: "Bar",
|
|
9083
|
-
content: /* @__PURE__ */ u$1(
|
|
9173
|
+
content: /* @__PURE__ */ u$1(
|
|
9174
|
+
NumberSequencesOverTimeBarChart,
|
|
9175
|
+
{
|
|
9176
|
+
data,
|
|
9177
|
+
yAxisScaleType,
|
|
9178
|
+
maintainAspectRatio
|
|
9179
|
+
}
|
|
9180
|
+
)
|
|
9084
9181
|
};
|
|
9085
9182
|
case "line":
|
|
9086
9183
|
return {
|
|
9087
9184
|
title: "Line",
|
|
9088
|
-
content: /* @__PURE__ */ u$1(
|
|
9185
|
+
content: /* @__PURE__ */ u$1(
|
|
9186
|
+
NumberSequencesOverTimeLineChart,
|
|
9187
|
+
{
|
|
9188
|
+
data,
|
|
9189
|
+
yAxisScaleType,
|
|
9190
|
+
maintainAspectRatio
|
|
9191
|
+
}
|
|
9192
|
+
)
|
|
9089
9193
|
};
|
|
9090
9194
|
case "table":
|
|
9091
9195
|
return {
|
|
@@ -9182,7 +9286,7 @@ let NumberSequencesOverTimeComponent = class extends PreactLitAdapterWithGridJsS
|
|
|
9182
9286
|
this.lapisDateField = "";
|
|
9183
9287
|
this.views = ["bar", "line", "table"];
|
|
9184
9288
|
this.width = "100%";
|
|
9185
|
-
this.height =
|
|
9289
|
+
this.height = void 0;
|
|
9186
9290
|
this.granularity = "day";
|
|
9187
9291
|
this.smoothingWindow = 0;
|
|
9188
9292
|
this.pageSize = false;
|
|
@@ -9713,7 +9817,7 @@ const mutationOverTimeSchema = z$2.object({
|
|
|
9713
9817
|
granularity: temporalGranularitySchema,
|
|
9714
9818
|
lapisDateField: z$2.string().min(1),
|
|
9715
9819
|
width: z$2.string(),
|
|
9716
|
-
height: z$2.string()
|
|
9820
|
+
height: z$2.string().optional()
|
|
9717
9821
|
});
|
|
9718
9822
|
const MutationsOverTime = (componentProps) => {
|
|
9719
9823
|
const { width, height } = componentProps;
|
|
@@ -9904,7 +10008,7 @@ let MutationsOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
9904
10008
|
this.sequenceType = "nucleotide";
|
|
9905
10009
|
this.views = ["grid"];
|
|
9906
10010
|
this.width = "100%";
|
|
9907
|
-
this.height =
|
|
10011
|
+
this.height = void 0;
|
|
9908
10012
|
this.granularity = "week";
|
|
9909
10013
|
this.lapisDateField = "date";
|
|
9910
10014
|
}
|
|
@@ -10591,6 +10695,12 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
|
|
|
10591
10695
|
}\r
|
|
10592
10696
|
`;
|
|
10593
10697
|
const leafletStyleModifications = ".leaflet-container {\n background: transparent;\n}\n";
|
|
10698
|
+
function AspectRatio({ children, aspectRatio }) {
|
|
10699
|
+
if (aspectRatio === void 0) {
|
|
10700
|
+
return children;
|
|
10701
|
+
}
|
|
10702
|
+
return /* @__PURE__ */ u$1("div", { class: `w-full relative`, style: { paddingTop: `${aspectRatio}%` }, children: /* @__PURE__ */ u$1("div", { className: "absolute inset-0", children }) });
|
|
10703
|
+
}
|
|
10594
10704
|
const SequencesByLocationMap = ({
|
|
10595
10705
|
locations,
|
|
10596
10706
|
totalCount,
|
|
@@ -10602,7 +10712,8 @@ const SequencesByLocationMap = ({
|
|
|
10602
10712
|
zoom,
|
|
10603
10713
|
offsetX,
|
|
10604
10714
|
offsetY,
|
|
10605
|
-
hasTableView
|
|
10715
|
+
hasTableView,
|
|
10716
|
+
maintainAspectRatio
|
|
10606
10717
|
}) => {
|
|
10607
10718
|
const ref = A$1(null);
|
|
10608
10719
|
y(() => {
|
|
@@ -10633,8 +10744,8 @@ const SequencesByLocationMap = ({
|
|
|
10633
10744
|
leafletMap.remove();
|
|
10634
10745
|
};
|
|
10635
10746
|
}, [ref, locations, enableMapNavigation, lapisLocationField, zoom, offsetX, offsetY]);
|
|
10636
|
-
return /* @__PURE__ */ u$1(
|
|
10637
|
-
/* @__PURE__ */ u$1("div", {
|
|
10747
|
+
return /* @__PURE__ */ u$1(AspectRatio, { aspectRatio: maintainAspectRatio ? 50 : void 0, children: [
|
|
10748
|
+
/* @__PURE__ */ u$1("div", { className: "h-full", ref }),
|
|
10638
10749
|
/* @__PURE__ */ u$1("div", { className: "relative", children: /* @__PURE__ */ u$1(
|
|
10639
10750
|
DataMatchInformation,
|
|
10640
10751
|
{
|
|
@@ -10771,7 +10882,7 @@ const SequencesByLocationTable = ({
|
|
|
10771
10882
|
sort: true,
|
|
10772
10883
|
formatter: (cell) => formatProportion(cell)
|
|
10773
10884
|
},
|
|
10774
|
-
..."isShownOnMap" in tableData[0] ? [{ id: "isShownOnMap", name: "shown on map", sort: true, width: "20%" }] : []
|
|
10885
|
+
...tableData.length > 0 && "isShownOnMap" in tableData[0] ? [{ id: "isShownOnMap", name: "shown on map", sort: true, width: "20%" }] : []
|
|
10775
10886
|
];
|
|
10776
10887
|
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: headers, pageSize });
|
|
10777
10888
|
};
|
|
@@ -10902,7 +11013,7 @@ const sequencesByLocationPropsSchema = z$2.object({
|
|
|
10902
11013
|
mapSource: mapSourceSchema.optional(),
|
|
10903
11014
|
enableMapNavigation: z$2.boolean(),
|
|
10904
11015
|
width: z$2.string(),
|
|
10905
|
-
height: z$2.string(),
|
|
11016
|
+
height: z$2.string().optional(),
|
|
10906
11017
|
views: z$2.array(sequencesByLocationViewSchema),
|
|
10907
11018
|
zoom: z$2.number(),
|
|
10908
11019
|
offsetX: z$2.number(),
|
|
@@ -10931,12 +11042,16 @@ const SequencesByLocationMapInner = (props) => {
|
|
|
10931
11042
|
if (error) {
|
|
10932
11043
|
throw error;
|
|
10933
11044
|
}
|
|
11045
|
+
if (data.tableData.length === 0) {
|
|
11046
|
+
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
11047
|
+
}
|
|
10934
11048
|
return /* @__PURE__ */ u$1(SequencesByLocationMapTabs, { data, originalComponentProps: props });
|
|
10935
11049
|
};
|
|
10936
11050
|
const SequencesByLocationMapTabs = ({
|
|
10937
11051
|
originalComponentProps,
|
|
10938
11052
|
data
|
|
10939
11053
|
}) => {
|
|
11054
|
+
const maintainAspectRatio = getMaintainAspectRatio(originalComponentProps.height);
|
|
10940
11055
|
const getTab = (view) => {
|
|
10941
11056
|
switch (view) {
|
|
10942
11057
|
case views.map: {
|
|
@@ -10955,7 +11070,8 @@ const SequencesByLocationMapTabs = ({
|
|
|
10955
11070
|
zoom: originalComponentProps.zoom,
|
|
10956
11071
|
offsetX: originalComponentProps.offsetX,
|
|
10957
11072
|
offsetY: originalComponentProps.offsetY,
|
|
10958
|
-
hasTableView: originalComponentProps.views.includes(views.table)
|
|
11073
|
+
hasTableView: originalComponentProps.views.includes(views.table),
|
|
11074
|
+
maintainAspectRatio
|
|
10959
11075
|
}
|
|
10960
11076
|
)
|
|
10961
11077
|
};
|
|
@@ -11025,7 +11141,7 @@ let SequencesByLocationComponent = class extends PreactLitAdapterWithGridJsStyle
|
|
|
11025
11141
|
this.mapSource = void 0;
|
|
11026
11142
|
this.enableMapNavigation = false;
|
|
11027
11143
|
this.width = "100%";
|
|
11028
|
-
this.height =
|
|
11144
|
+
this.height = void 0;
|
|
11029
11145
|
this.views = ["map", "table"];
|
|
11030
11146
|
this.zoom = 1;
|
|
11031
11147
|
this.offsetX = 0;
|
|
@@ -11098,7 +11214,7 @@ async function queryGeneralStatistics(numeratorFilter, denominatorFilter, lapis,
|
|
|
11098
11214
|
}
|
|
11099
11215
|
const statisticsPropsSchema = z$2.object({
|
|
11100
11216
|
width: z$2.string(),
|
|
11101
|
-
height: z$2.string(),
|
|
11217
|
+
height: z$2.string().optional(),
|
|
11102
11218
|
numeratorFilter: lapisFilterSchema,
|
|
11103
11219
|
denominatorFilter: lapisFilterSchema
|
|
11104
11220
|
});
|
|
@@ -11126,16 +11242,16 @@ const StatisticsInner = (componentProps) => {
|
|
|
11126
11242
|
};
|
|
11127
11243
|
const MetricDataTabs = ({ data }) => {
|
|
11128
11244
|
const { count, proportion } = data;
|
|
11129
|
-
return /* @__PURE__ */ u$1("div", { className: "flex flex-col sm:flex-row rounded-md border-2 border-gray-100", children: [
|
|
11245
|
+
return /* @__PURE__ */ u$1("div", { className: "flex flex-col sm:flex-row rounded-md border-2 border-gray-100 min-w-[180px]", children: [
|
|
11130
11246
|
/* @__PURE__ */ u$1("div", { className: "stat", children: [
|
|
11131
11247
|
/* @__PURE__ */ u$1("div", { className: "stat-title", children: "Sequences" }),
|
|
11132
11248
|
/* @__PURE__ */ u$1("div", { className: "stat-value text-2xl sm:text-4xl", children: count.toLocaleString("en-us") }),
|
|
11133
|
-
/* @__PURE__ */ u$1("div", { className: "stat-desc", children: "The total number of sequenced samples" })
|
|
11249
|
+
/* @__PURE__ */ u$1("div", { className: "stat-desc text-wrap", children: "The total number of sequenced samples" })
|
|
11134
11250
|
] }),
|
|
11135
11251
|
/* @__PURE__ */ u$1("div", { className: "stat", children: [
|
|
11136
11252
|
/* @__PURE__ */ u$1("div", { className: "stat-title", children: "Overall proportion" }),
|
|
11137
11253
|
/* @__PURE__ */ u$1("div", { className: "stat-value text-2xl sm:text-4xl", children: formatProportion(proportion) }),
|
|
11138
|
-
/* @__PURE__ */ u$1("div", { className: "stat-desc", children: "The proportion among all sequenced samples" })
|
|
11254
|
+
/* @__PURE__ */ u$1("div", { className: "stat-desc text-wrap", children: "The proportion among all sequenced samples" })
|
|
11139
11255
|
] })
|
|
11140
11256
|
] });
|
|
11141
11257
|
};
|
|
@@ -11155,7 +11271,7 @@ let StatisticsComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
11155
11271
|
this.numeratorFilter = {};
|
|
11156
11272
|
this.denominatorFilter = {};
|
|
11157
11273
|
this.width = "100%";
|
|
11158
|
-
this.height =
|
|
11274
|
+
this.height = void 0;
|
|
11159
11275
|
}
|
|
11160
11276
|
render() {
|
|
11161
11277
|
return /* @__PURE__ */ u$1(
|
|
@@ -11274,7 +11390,7 @@ const wastewaterMutationOverTimeSchema = z$2.object({
|
|
|
11274
11390
|
lapisFilter: lapisFilterSchema,
|
|
11275
11391
|
sequenceType: sequenceTypeSchema,
|
|
11276
11392
|
width: z$2.string(),
|
|
11277
|
-
height: z$2.string(),
|
|
11393
|
+
height: z$2.string().optional(),
|
|
11278
11394
|
maxNumberOfGridRows: z$2.number()
|
|
11279
11395
|
});
|
|
11280
11396
|
const WastewaterMutationsOverTime = (componentProps) => {
|
|
@@ -11375,7 +11491,7 @@ let WastewaterMutationsOverTimeComponent = class extends PreactLitAdapterWithGri
|
|
|
11375
11491
|
this.lapisFilter = {};
|
|
11376
11492
|
this.sequenceType = "nucleotide";
|
|
11377
11493
|
this.width = "100%";
|
|
11378
|
-
this.height =
|
|
11494
|
+
this.height = void 0;
|
|
11379
11495
|
this.maxNumberOfGridRows = 100;
|
|
11380
11496
|
}
|
|
11381
11497
|
render() {
|
|
@@ -15131,9 +15247,6 @@ const ReferenceGenomesAwaiter = ({ children }) => {
|
|
|
15131
15247
|
}
|
|
15132
15248
|
return /* @__PURE__ */ u$1(Fragment, { children });
|
|
15133
15249
|
};
|
|
15134
|
-
function isNotInitialized(referenceGenome) {
|
|
15135
|
-
return referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0;
|
|
15136
|
-
}
|
|
15137
15250
|
const ExampleMutation = ({ sequenceType, mutationType }) => {
|
|
15138
15251
|
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15139
15252
|
return /* @__PURE__ */ u$1("b", { children: getExampleMutation(referenceGenome, sequenceType, mutationType) });
|
|
@@ -15567,6 +15680,12 @@ const MutationFilterInner = ({ initialValue }) => {
|
|
|
15567
15680
|
getInitialState(initialValue, referenceGenome)
|
|
15568
15681
|
);
|
|
15569
15682
|
const filterRef = A$1(null);
|
|
15683
|
+
if (referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0) {
|
|
15684
|
+
throw new UserFacingError(
|
|
15685
|
+
"No reference sequences available",
|
|
15686
|
+
"This organism has neither nucleotide nor amino acid sequences configured in its reference genome. You cannot filter by mutations."
|
|
15687
|
+
);
|
|
15688
|
+
}
|
|
15570
15689
|
const handleRemoveValue = (option) => {
|
|
15571
15690
|
const newSelectedFilters = {
|
|
15572
15691
|
...selectedFilters,
|