@genspectrum/dashboard-components 0.13.6 → 0.14.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/custom-elements.json +41 -79
- package/dist/{LineageFilterChangedEvent-GedKNGFI.js → LineageFilterChangedEvent-C9dXOxt6.js} +11 -3
- package/dist/LineageFilterChangedEvent-C9dXOxt6.js.map +1 -0
- package/dist/components.d.ts +63 -71
- package/dist/components.js +440 -312
- package/dist/components.js.map +1 -1
- package/dist/style.css +20 -5
- package/dist/util.d.ts +61 -51
- package/dist/util.js +1 -1
- package/package.json +1 -1
- package/src/preact/LapisUrlContext.ts +14 -1
- package/src/preact/aggregatedData/aggregate.stories.tsx +3 -3
- package/src/preact/aggregatedData/aggregate.tsx +3 -4
- package/src/preact/components/tabs.tsx +3 -5
- package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +34 -20
- package/src/preact/dateRangeSelector/computeInitialValues.ts +25 -21
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +104 -40
- package/src/preact/dateRangeSelector/date-range-selector.tsx +29 -20
- package/src/preact/dateRangeSelector/dateRangeOption.ts +11 -1
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +3 -3
- package/src/preact/lineageFilter/lineage-filter.tsx +3 -4
- package/src/preact/locationFilter/location-filter.stories.tsx +3 -3
- package/src/preact/locationFilter/location-filter.tsx +4 -4
- package/src/preact/map/sequences-by-location.stories.tsx +3 -3
- package/src/preact/map/sequences-by-location.tsx +3 -4
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +3 -3
- package/src/preact/mutationComparison/mutation-comparison.tsx +4 -4
- package/src/preact/mutationFilter/ExampleMutation.tsx +68 -0
- package/src/preact/mutationFilter/mutation-filter-info.tsx +179 -112
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +5 -5
- package/src/preact/mutationFilter/mutation-filter.tsx +10 -5
- package/src/preact/mutations/mutations.stories.tsx +3 -3
- package/src/preact/mutations/mutations.tsx +4 -4
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +26 -4
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +3 -3
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +4 -4
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +3 -3
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -4
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +3 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +4 -4
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +3 -3
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +4 -4
- package/src/preact/statistic/statistics.stories.tsx +3 -3
- package/src/preact/statistic/statistics.tsx +2 -3
- package/src/preact/textInput/text-input.stories.tsx +3 -3
- package/src/preact/textInput/text-input.tsx +3 -4
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +5 -9
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +5 -5
- package/src/web-components/PreactLitAdapter.tsx +3 -3
- package/src/web-components/{app.stories.ts → gs-app.stories.ts} +1 -1
- package/src/web-components/{app.ts → gs-app.ts} +5 -3
- package/src/web-components/index.ts +1 -1
- package/src/web-components/input/gs-date-range-selector.stories.ts +6 -13
- package/src/web-components/input/gs-date-range-selector.tsx +15 -38
- package/src/web-components/input/gs-lineage-filter.stories.ts +1 -1
- package/src/web-components/input/gs-location-filter.stories.ts +1 -1
- package/src/web-components/input/gs-mutation-filter.stories.ts +2 -2
- package/src/web-components/input/gs-text-input.stories.ts +1 -1
- package/src/web-components/visualization/gs-aggregate.stories.ts +1 -1
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +1 -1
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +1 -1
- package/src/web-components/visualization/gs-mutations.stories.ts +1 -1
- package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +1 -1
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +1 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +1 -1
- package/src/web-components/visualization/gs-sequences-by-location.stories.ts +1 -1
- package/src/web-components/visualization/gs-statistics.stories.ts +1 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +4 -1
- package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +6 -2
- package/standalone-bundle/dashboard-components.js +7016 -6951
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
- package/dist/LineageFilterChangedEvent-GedKNGFI.js.map +0 -1
package/dist/components.js
CHANGED
|
@@ -6,7 +6,7 @@ import { options, createContext as createContext$1, Fragment, render, Component,
|
|
|
6
6
|
import { Grid } from "gridjs";
|
|
7
7
|
import { Chart, registerables, Scale, BarController } from "chart.js";
|
|
8
8
|
import { VennDiagramController, ArcSlice, extractSets } from "chartjs-chart-venn";
|
|
9
|
-
import { v as views, n as namedLapisFilterSchema, s as sequenceTypeSchema, l as lapisFilterSchema, t as temporalGranularitySchema, b as dateRangeOptionSchema, c as toYYYYMMDD, D as DateRangeOptionChangedEvent,
|
|
9
|
+
import { v as views, n as namedLapisFilterSchema, s as sequenceTypeSchema, l as lapisFilterSchema, t as temporalGranularitySchema, b as dateRangeOptionSchema, c as dateRangeValueSchema, e as toYYYYMMDD, D as DateRangeOptionChangedEvent, f as lapisLocationFilterSchema, L as LocationChangedEvent, T as TextInputChangedEvent, m as mutationsFilterSchema, a as LineageFilterChangedEvent } from "./LineageFilterChangedEvent-C9dXOxt6.js";
|
|
10
10
|
import { autoUpdate, computePosition, offset, shift, flip } from "@floating-ui/dom";
|
|
11
11
|
import { ReactiveElement } from "@lit/reactive-element";
|
|
12
12
|
import { BarWithErrorBarsController, BarWithErrorBar } from "chartjs-chart-error-bars";
|
|
@@ -550,7 +550,7 @@ var __decorateClass$g = (decorators, target, key, kind) => {
|
|
|
550
550
|
return result;
|
|
551
551
|
};
|
|
552
552
|
const lapisUrlSchema = z$2.string().url();
|
|
553
|
-
let
|
|
553
|
+
let AppComponent = class extends LitElement {
|
|
554
554
|
constructor() {
|
|
555
555
|
super(...arguments);
|
|
556
556
|
this.lapis = "";
|
|
@@ -561,7 +561,9 @@ let App = class extends LitElement {
|
|
|
561
561
|
this.updateReferenceGenome = new Task(this, {
|
|
562
562
|
task: async () => {
|
|
563
563
|
const lapisUrl = lapisUrlSchema.parse(this.lapis);
|
|
564
|
-
this.referenceGenome = await fetchReferenceGenome(
|
|
564
|
+
this.referenceGenome = await fetchReferenceGenome(
|
|
565
|
+
lapisUrl.endsWith("/") ? lapisUrl.slice(0, -1) : lapisUrl
|
|
566
|
+
);
|
|
565
567
|
},
|
|
566
568
|
args: () => [this.lapis]
|
|
567
569
|
});
|
|
@@ -585,13 +587,13 @@ let App = class extends LitElement {
|
|
|
585
587
|
__decorateClass$g([
|
|
586
588
|
provide({ context: lapisContext }),
|
|
587
589
|
n$1()
|
|
588
|
-
],
|
|
590
|
+
], AppComponent.prototype, "lapis", 2);
|
|
589
591
|
__decorateClass$g([
|
|
590
592
|
provide({ context: referenceGenomeContext })
|
|
591
|
-
],
|
|
592
|
-
|
|
593
|
+
], AppComponent.prototype, "referenceGenome", 2);
|
|
594
|
+
AppComponent = __decorateClass$g([
|
|
593
595
|
t$3("gs-app")
|
|
594
|
-
],
|
|
596
|
+
], AppComponent);
|
|
595
597
|
function GsAppError(error) {
|
|
596
598
|
return html` <div class="m-2 w-full alert alert-error">Error: ${error}</div>`;
|
|
597
599
|
}
|
|
@@ -1255,6 +1257,14 @@ function filterBySegmentAndMutationType(data, displayedSegments, displayedMutati
|
|
|
1255
1257
|
return data.filter(byDisplayedSegments).filter(byDisplayedMutationTypes);
|
|
1256
1258
|
}
|
|
1257
1259
|
const LapisUrlContext = createContext$1("");
|
|
1260
|
+
const LapisUrlContextProvider = LapisUrlContext.Provider;
|
|
1261
|
+
const useLapisUrl = () => {
|
|
1262
|
+
const lapisUrl = x$1(LapisUrlContext);
|
|
1263
|
+
if (lapisUrl.endsWith("/")) {
|
|
1264
|
+
return lapisUrl.slice(0, -1);
|
|
1265
|
+
}
|
|
1266
|
+
return lapisUrl;
|
|
1267
|
+
};
|
|
1258
1268
|
const CsvDownloadButton = ({
|
|
1259
1269
|
label = "Download",
|
|
1260
1270
|
filename = "data.csv",
|
|
@@ -2041,13 +2051,13 @@ function useDisplayedSegments(sequenceType) {
|
|
|
2041
2051
|
return h(displayedSegments);
|
|
2042
2052
|
}
|
|
2043
2053
|
const Tabs = ({ tabs, toolbar }) => {
|
|
2044
|
-
var _a
|
|
2054
|
+
var _a;
|
|
2045
2055
|
const [activeTab, setActiveTab] = h((_a = tabs[0]) == null ? void 0 : _a.title);
|
|
2046
2056
|
const tabElements = /* @__PURE__ */ u$1("div", { className: "flex flex-row flex-wrap", children: tabs.map((tab) => {
|
|
2047
2057
|
return /* @__PURE__ */ u$1(
|
|
2048
2058
|
"button",
|
|
2049
2059
|
{
|
|
2050
|
-
className: `px-4 py-2 text-sm font-medium leading-5 transition-colors duration-150 ${activeTab === tab.title ? "border-b-2 border-gray-
|
|
2060
|
+
className: `px-4 py-2 text-sm font-medium leading-5 transition-colors duration-150 ${activeTab === tab.title ? "border-b-2 border-gray-500" : "border-b border-gray-300 text-gray-600 hover:bg-gray-100 hover:text-gray-700"}`,
|
|
2051
2061
|
onClick: () => {
|
|
2052
2062
|
setActiveTab(tab.title);
|
|
2053
2063
|
},
|
|
@@ -2062,13 +2072,7 @@ const Tabs = ({ tabs, toolbar }) => {
|
|
|
2062
2072
|
tabElements,
|
|
2063
2073
|
toolbar && /* @__PURE__ */ u$1("div", { className: "py-2 flex flex-wrap gap-y-1", children: toolbarElement })
|
|
2064
2074
|
] }),
|
|
2065
|
-
/* @__PURE__ */ u$1(
|
|
2066
|
-
"div",
|
|
2067
|
-
{
|
|
2068
|
-
className: `p-2 flex-grow overflow-scroll border-2 border-gray-100 rounded-b-md rounded-tr-md ${activeTab === ((_b = tabs[0]) == null ? void 0 : _b.title) ? "" : "rounded-tl-md"}`,
|
|
2069
|
-
children: tabs.map((tab) => /* @__PURE__ */ u$1("div", { className: "h-full", hidden: activeTab !== tab.title, children: tab.content }, tab.title))
|
|
2070
|
-
}
|
|
2071
|
-
)
|
|
2075
|
+
/* @__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)) })
|
|
2072
2076
|
] });
|
|
2073
2077
|
};
|
|
2074
2078
|
function useQuery(fetchDataCallback, dependencies) {
|
|
@@ -2114,7 +2118,7 @@ const MutationComparison = (componentProps) => {
|
|
|
2114
2118
|
};
|
|
2115
2119
|
const MutationComparisonInner = (componentProps) => {
|
|
2116
2120
|
const { lapisFilters, sequenceType } = componentProps;
|
|
2117
|
-
const lapis =
|
|
2121
|
+
const lapis = useLapisUrl();
|
|
2118
2122
|
const { data, error, isLoading } = useQuery(async () => {
|
|
2119
2123
|
return queryMutationData(lapisFilters, sequenceType, lapis);
|
|
2120
2124
|
}, [lapisFilters, sequenceType, lapis]);
|
|
@@ -2228,7 +2232,7 @@ const Toolbar$7 = ({
|
|
|
2228
2232
|
] });
|
|
2229
2233
|
};
|
|
2230
2234
|
const MutationComparisonInfo = ({ originalComponentProps }) => {
|
|
2231
|
-
const lapis =
|
|
2235
|
+
const lapis = useLapisUrl();
|
|
2232
2236
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
2233
2237
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Info for mutation comparison" }),
|
|
2234
2238
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -5196,6 +5200,9 @@ input.tab:checked + .tab-content,
|
|
|
5196
5200
|
.gap-y-1 {
|
|
5197
5201
|
row-gap: 0.25rem;
|
|
5198
5202
|
}
|
|
5203
|
+
.overflow-visible {
|
|
5204
|
+
overflow: visible;
|
|
5205
|
+
}
|
|
5199
5206
|
.overflow-scroll {
|
|
5200
5207
|
overflow: scroll;
|
|
5201
5208
|
}
|
|
@@ -5205,6 +5212,9 @@ input.tab:checked + .tab-content,
|
|
|
5205
5212
|
.whitespace-nowrap {
|
|
5206
5213
|
white-space: nowrap;
|
|
5207
5214
|
}
|
|
5215
|
+
.text-nowrap {
|
|
5216
|
+
text-wrap: nowrap;
|
|
5217
|
+
}
|
|
5208
5218
|
.break-words {
|
|
5209
5219
|
overflow-wrap: break-word;
|
|
5210
5220
|
}
|
|
@@ -5224,9 +5234,6 @@ input.tab:checked + .tab-content,
|
|
|
5224
5234
|
border-bottom-right-radius: 0.375rem;
|
|
5225
5235
|
border-bottom-left-radius: 0.375rem;
|
|
5226
5236
|
}
|
|
5227
|
-
.rounded-tl-md {
|
|
5228
|
-
border-top-left-radius: 0.375rem;
|
|
5229
|
-
}
|
|
5230
5237
|
.rounded-tr-md {
|
|
5231
5238
|
border-top-right-radius: 0.375rem;
|
|
5232
5239
|
}
|
|
@@ -5236,6 +5243,9 @@ input.tab:checked + .tab-content,
|
|
|
5236
5243
|
.border-2 {
|
|
5237
5244
|
border-width: 2px;
|
|
5238
5245
|
}
|
|
5246
|
+
.border-b {
|
|
5247
|
+
border-bottom-width: 1px;
|
|
5248
|
+
}
|
|
5239
5249
|
.border-b-2 {
|
|
5240
5250
|
border-bottom-width: 2px;
|
|
5241
5251
|
}
|
|
@@ -5251,9 +5261,9 @@ input.tab:checked + .tab-content,
|
|
|
5251
5261
|
--tw-border-opacity: 1;
|
|
5252
5262
|
border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
|
|
5253
5263
|
}
|
|
5254
|
-
.border-gray-
|
|
5264
|
+
.border-gray-500 {
|
|
5255
5265
|
--tw-border-opacity: 1;
|
|
5256
|
-
border-color: rgb(
|
|
5266
|
+
border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));
|
|
5257
5267
|
}
|
|
5258
5268
|
.border-slate-500 {
|
|
5259
5269
|
--tw-border-opacity: 1;
|
|
@@ -5354,6 +5364,9 @@ input.tab:checked + .tab-content,
|
|
|
5354
5364
|
.font-medium {
|
|
5355
5365
|
font-weight: 500;
|
|
5356
5366
|
}
|
|
5367
|
+
.font-semibold {
|
|
5368
|
+
font-weight: 600;
|
|
5369
|
+
}
|
|
5357
5370
|
.leading-5 {
|
|
5358
5371
|
line-height: 1.25rem;
|
|
5359
5372
|
}
|
|
@@ -5500,6 +5513,12 @@ input.tab:checked + .tab-content,
|
|
|
5500
5513
|
visibility: visible;
|
|
5501
5514
|
}
|
|
5502
5515
|
}
|
|
5516
|
+
@container (min-width: 6rem) {
|
|
5517
|
+
|
|
5518
|
+
.\\@\\[6rem\\]\\:visible {
|
|
5519
|
+
visibility: visible;
|
|
5520
|
+
}
|
|
5521
|
+
}
|
|
5503
5522
|
@media (min-width: 640px) {
|
|
5504
5523
|
|
|
5505
5524
|
.sm\\:max-w-5xl {
|
|
@@ -5537,7 +5556,7 @@ const _PreactLitAdapter = class _PreactLitAdapter extends ReactiveElement {
|
|
|
5537
5556
|
};
|
|
5538
5557
|
}
|
|
5539
5558
|
update(changedProperties) {
|
|
5540
|
-
const vdom = /* @__PURE__ */ u$1(
|
|
5559
|
+
const vdom = /* @__PURE__ */ u$1(LapisUrlContextProvider, { value: this.lapis, children: /* @__PURE__ */ u$1(ReferenceGenomeContext.Provider, { value: this.referenceGenome, children: this.render() }) });
|
|
5541
5560
|
super.update(changedProperties);
|
|
5542
5561
|
render(vdom, this.renderRoot);
|
|
5543
5562
|
}
|
|
@@ -5963,7 +5982,7 @@ const Mutations = (componentProps) => {
|
|
|
5963
5982
|
return /* @__PURE__ */ u$1(ErrorBoundary, { size, componentProps, schema: mutationsPropsSchema, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsInner, { ...componentProps }) }) });
|
|
5964
5983
|
};
|
|
5965
5984
|
const MutationsInner = (componentProps) => {
|
|
5966
|
-
const lapis =
|
|
5985
|
+
const lapis = useLapisUrl();
|
|
5967
5986
|
const { lapisFilter, baselineLapisFilter, sequenceType } = componentProps;
|
|
5968
5987
|
const { data, error, isLoading } = useQuery(async () => {
|
|
5969
5988
|
return queryMutationsData(lapisFilter, baselineLapisFilter, sequenceType, lapis);
|
|
@@ -6105,7 +6124,7 @@ const Toolbar$6 = ({
|
|
|
6105
6124
|
] });
|
|
6106
6125
|
};
|
|
6107
6126
|
const MutationsInfo = ({ originalComponentProps }) => {
|
|
6108
|
-
const lapis =
|
|
6127
|
+
const lapis = useLapisUrl();
|
|
6109
6128
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
6110
6129
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Mutations" }),
|
|
6111
6130
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -7846,7 +7865,7 @@ const PrevalenceOverTime = (componentProps) => {
|
|
|
7846
7865
|
};
|
|
7847
7866
|
const PrevalenceOverTimeInner = (componentProps) => {
|
|
7848
7867
|
const { numeratorFilters, denominatorFilter, granularity, smoothingWindow, lapisDateField } = componentProps;
|
|
7849
|
-
const lapis =
|
|
7868
|
+
const lapis = useLapisUrl();
|
|
7850
7869
|
const { data, error, isLoading } = useQuery(
|
|
7851
7870
|
() => queryPrevalenceOverTime(
|
|
7852
7871
|
numeratorFilters,
|
|
@@ -7980,7 +7999,7 @@ const Toolbar$5 = ({
|
|
|
7980
7999
|
};
|
|
7981
8000
|
const PrevalenceOverTimeInfo = (componentProps) => {
|
|
7982
8001
|
const { granularity, smoothingWindow, views: views2 } = componentProps;
|
|
7983
|
-
const lapis =
|
|
8002
|
+
const lapis = useLapisUrl();
|
|
7984
8003
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
7985
8004
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Prevalence over time" }),
|
|
7986
8005
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -8335,7 +8354,7 @@ const RelativeGrowthAdvantage = (componentProps) => {
|
|
|
8335
8354
|
return /* @__PURE__ */ u$1(ErrorBoundary, { size, schema: relativeGrowthAdvantagePropsSchema, componentProps, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...componentProps }) }) });
|
|
8336
8355
|
};
|
|
8337
8356
|
const RelativeGrowthAdvantageInner = (componentProps) => {
|
|
8338
|
-
const lapis =
|
|
8357
|
+
const lapis = useLapisUrl();
|
|
8339
8358
|
const { numeratorFilter, denominatorFilter, generationTime, lapisDateField } = componentProps;
|
|
8340
8359
|
const [yAxisScaleType, setYAxisScaleType] = h("linear");
|
|
8341
8360
|
const { data, error, isLoading } = useQuery(
|
|
@@ -8418,7 +8437,7 @@ const RelativeGrowthAdvantageToolbar = ({
|
|
|
8418
8437
|
const RelativeGrowthAdvantageInfo = ({
|
|
8419
8438
|
originalComponentProps
|
|
8420
8439
|
}) => {
|
|
8421
|
-
const lapis =
|
|
8440
|
+
const lapis = useLapisUrl();
|
|
8422
8441
|
const generationTime = originalComponentProps.generationTime;
|
|
8423
8442
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
8424
8443
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Relative growth advantage" }),
|
|
@@ -8713,7 +8732,7 @@ const Aggregate = (componentProps) => {
|
|
|
8713
8732
|
};
|
|
8714
8733
|
const AggregateInner = (componentProps) => {
|
|
8715
8734
|
const { fields, lapisFilter, initialSortField, initialSortDirection } = componentProps;
|
|
8716
|
-
const lapis =
|
|
8735
|
+
const lapis = useLapisUrl();
|
|
8717
8736
|
const { data, error, isLoading } = useQuery(async () => {
|
|
8718
8737
|
return queryAggregateData(lapisFilter, fields, lapis);
|
|
8719
8738
|
}, [lapisFilter, fields, lapis, initialSortField, initialSortDirection]);
|
|
@@ -8770,7 +8789,7 @@ const Toolbar$4 = ({ data, originalComponentProps }) => {
|
|
|
8770
8789
|
] });
|
|
8771
8790
|
};
|
|
8772
8791
|
const AggregateInfo = ({ originalComponentProps }) => {
|
|
8773
|
-
const lapis =
|
|
8792
|
+
const lapis = useLapisUrl();
|
|
8774
8793
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
8775
8794
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Aggregated data" }),
|
|
8776
8795
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -9029,7 +9048,7 @@ const NumberSequencesOverTime = (componentProps) => {
|
|
|
9029
9048
|
};
|
|
9030
9049
|
const NumberSequencesOverTimeInner = (componentProps) => {
|
|
9031
9050
|
const { lapisFilters, lapisDateField, granularity, smoothingWindow } = componentProps;
|
|
9032
|
-
const lapis =
|
|
9051
|
+
const lapis = useLapisUrl();
|
|
9033
9052
|
const { data, error, isLoading } = useQuery(
|
|
9034
9053
|
() => queryNumberOfSequencesOverTime(lapis, lapisFilters, lapisDateField, granularity, smoothingWindow),
|
|
9035
9054
|
[lapis, lapisFilters, lapisDateField, granularity, smoothingWindow]
|
|
@@ -9117,7 +9136,7 @@ const Toolbar$3 = ({ activeTab, data, yAxisScaleType, setYAxisScaleType, origina
|
|
|
9117
9136
|
const NumberSequencesOverTimeInfo = ({
|
|
9118
9137
|
originalComponentProps
|
|
9119
9138
|
}) => {
|
|
9120
|
-
const lapis =
|
|
9139
|
+
const lapis = useLapisUrl();
|
|
9121
9140
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
9122
9141
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Number of sequences over time" }),
|
|
9123
9142
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -9519,48 +9538,69 @@ const MutationsOverTimeGrid = ({
|
|
|
9519
9538
|
gridTemplateRows: `repeat(${shownMutations.length}, 24px)`,
|
|
9520
9539
|
gridTemplateColumns: `${MUTATION_CELL_WIDTH_REM}rem repeat(${dates.length}, minmax(0.05rem, 1fr))`
|
|
9521
9540
|
},
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
}
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
shownMutations.length,
|
|
9537
|
-
columnIndex,
|
|
9538
|
-
dates.length
|
|
9539
|
-
);
|
|
9540
|
-
return /* @__PURE__ */ u$1(
|
|
9541
|
+
className: "text-center",
|
|
9542
|
+
children: [
|
|
9543
|
+
dates.map((date, columnIndex) => /* @__PURE__ */ u$1(
|
|
9544
|
+
"div",
|
|
9545
|
+
{
|
|
9546
|
+
className: "@container font-semibold",
|
|
9547
|
+
style: { gridRowStart: 1, gridColumnStart: columnIndex + 2 },
|
|
9548
|
+
children: /* @__PURE__ */ u$1("p", { ...styleGridHeader(columnIndex, dates), children: date.dateString })
|
|
9549
|
+
},
|
|
9550
|
+
date.dateString
|
|
9551
|
+
)),
|
|
9552
|
+
shownMutations.map((mutation, rowIndex) => {
|
|
9553
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
9554
|
+
/* @__PURE__ */ u$1(
|
|
9541
9555
|
"div",
|
|
9542
9556
|
{
|
|
9543
|
-
style: { gridRowStart: rowIndex +
|
|
9544
|
-
children: /* @__PURE__ */ u$1(
|
|
9545
|
-
ProportionCell,
|
|
9546
|
-
{
|
|
9547
|
-
value,
|
|
9548
|
-
date,
|
|
9549
|
-
mutation,
|
|
9550
|
-
tooltipPosition,
|
|
9551
|
-
colorScale
|
|
9552
|
-
}
|
|
9553
|
-
)
|
|
9557
|
+
style: { gridRowStart: rowIndex + 2, gridColumnStart: 1 },
|
|
9558
|
+
children: /* @__PURE__ */ u$1(MutationCell, { mutation })
|
|
9554
9559
|
},
|
|
9555
|
-
|
|
9556
|
-
)
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
+
`mutation-${mutation.toString()}`
|
|
9561
|
+
),
|
|
9562
|
+
dates.map((date, columnIndex) => {
|
|
9563
|
+
const value = data.get(mutation, date) ?? null;
|
|
9564
|
+
const tooltipPosition = getTooltipPosition(
|
|
9565
|
+
rowIndex,
|
|
9566
|
+
shownMutations.length,
|
|
9567
|
+
columnIndex,
|
|
9568
|
+
dates.length
|
|
9569
|
+
);
|
|
9570
|
+
return /* @__PURE__ */ u$1(
|
|
9571
|
+
"div",
|
|
9572
|
+
{
|
|
9573
|
+
style: { gridRowStart: rowIndex + 2, gridColumnStart: columnIndex + 2 },
|
|
9574
|
+
children: /* @__PURE__ */ u$1(
|
|
9575
|
+
ProportionCell,
|
|
9576
|
+
{
|
|
9577
|
+
value,
|
|
9578
|
+
date,
|
|
9579
|
+
mutation,
|
|
9580
|
+
tooltipPosition,
|
|
9581
|
+
colorScale
|
|
9582
|
+
}
|
|
9583
|
+
)
|
|
9584
|
+
},
|
|
9585
|
+
`${mutation.toString()}-${date.toString()}`
|
|
9586
|
+
);
|
|
9587
|
+
})
|
|
9588
|
+
] }, `fragment-${mutation.toString()}`);
|
|
9589
|
+
})
|
|
9590
|
+
]
|
|
9560
9591
|
}
|
|
9561
9592
|
)
|
|
9562
9593
|
] });
|
|
9563
9594
|
};
|
|
9595
|
+
function styleGridHeader(columnIndex, dates) {
|
|
9596
|
+
if (columnIndex === 0) {
|
|
9597
|
+
return { className: "overflow-visible text-nowrap" };
|
|
9598
|
+
}
|
|
9599
|
+
if (columnIndex === dates.length - 1) {
|
|
9600
|
+
return { className: "overflow-visible text-nowrap", style: { direction: "rtl" } };
|
|
9601
|
+
}
|
|
9602
|
+
return { className: "invisible @[6rem]:visible" };
|
|
9603
|
+
}
|
|
9564
9604
|
function getTooltipPosition(rowIndex, rows, columnIndex, columns) {
|
|
9565
9605
|
const tooltipX = rowIndex < rows / 2 || rowIndex < 6 ? "bottom" : "top";
|
|
9566
9606
|
const tooltipY = columnIndex < columns / 2 ? "start" : "end";
|
|
@@ -9597,7 +9637,7 @@ const ProportionCell = ({ value, mutation, date, tooltipPosition, colorScale })
|
|
|
9597
9637
|
backgroundColor: getColorWithingScale(value == null ? void 0 : value.proportion, colorScale),
|
|
9598
9638
|
color: getTextColorForScale(value == null ? void 0 : value.proportion, colorScale)
|
|
9599
9639
|
},
|
|
9600
|
-
className: `w-full h-full
|
|
9640
|
+
className: `w-full h-full hover:font-bold text-xs group @container`,
|
|
9601
9641
|
children: /* @__PURE__ */ u$1("span", { className: "invisible @[2rem]:visible", children: value === null ? "" : formatProportion(value.proportion, 0) })
|
|
9602
9642
|
}
|
|
9603
9643
|
) }) });
|
|
@@ -9609,7 +9649,7 @@ const timeIntervalDisplay = (date) => {
|
|
|
9609
9649
|
return `${date.firstDay.toString()} - ${date.lastDay.toString()}`;
|
|
9610
9650
|
};
|
|
9611
9651
|
const MutationCell = ({ mutation }) => {
|
|
9612
|
-
return /* @__PURE__ */ u$1("div", {
|
|
9652
|
+
return /* @__PURE__ */ u$1("div", { children: mutation.code });
|
|
9613
9653
|
};
|
|
9614
9654
|
const ColorScaleSelectorDropdown = ({
|
|
9615
9655
|
colorScale,
|
|
@@ -9672,7 +9712,7 @@ const MutationsOverTime = (componentProps) => {
|
|
|
9672
9712
|
return /* @__PURE__ */ u$1(ErrorBoundary, { size, schema: mutationOverTimeSchema, componentProps, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsOverTimeInner, { ...componentProps }) }) });
|
|
9673
9713
|
};
|
|
9674
9714
|
const MutationsOverTimeInner = (componentProps) => {
|
|
9675
|
-
const lapis =
|
|
9715
|
+
const lapis = useLapisUrl();
|
|
9676
9716
|
const { lapisFilter, sequenceType, granularity, lapisDateField } = componentProps;
|
|
9677
9717
|
const messageToWorker = T$1(() => {
|
|
9678
9718
|
return {
|
|
@@ -9807,7 +9847,7 @@ const Toolbar$2 = ({
|
|
|
9807
9847
|
] });
|
|
9808
9848
|
};
|
|
9809
9849
|
const MutationsOverTimeInfo = ({ originalComponentProps }) => {
|
|
9810
|
-
const lapis =
|
|
9850
|
+
const lapis = useLapisUrl();
|
|
9811
9851
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
9812
9852
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Mutations over time" }),
|
|
9813
9853
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -10866,7 +10906,7 @@ const SequencesByLocation = (componentProps) => {
|
|
|
10866
10906
|
};
|
|
10867
10907
|
const SequencesByLocationMapInner = (props) => {
|
|
10868
10908
|
const { lapisFilter, lapisLocationField, mapSource } = props;
|
|
10869
|
-
const lapis =
|
|
10909
|
+
const lapis = useLapisUrl();
|
|
10870
10910
|
const {
|
|
10871
10911
|
data,
|
|
10872
10912
|
error,
|
|
@@ -10948,7 +10988,7 @@ const Toolbar$1 = ({ originalComponentProps, tableData }) => {
|
|
|
10948
10988
|
] });
|
|
10949
10989
|
};
|
|
10950
10990
|
const SequencesByLocationMapInfo = ({ originalComponentProps }) => {
|
|
10951
|
-
const lapis =
|
|
10991
|
+
const lapis = useLapisUrl();
|
|
10952
10992
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
10953
10993
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Prevalence by location" }),
|
|
10954
10994
|
/* @__PURE__ */ u$1(InfoParagraph, { children: "TODO: Add description https://github.com/GenSpectrum/dashboard-components/issues/598" }),
|
|
@@ -11059,7 +11099,7 @@ const Statistics = (componentProps) => {
|
|
|
11059
11099
|
};
|
|
11060
11100
|
const StatisticsInner = (componentProps) => {
|
|
11061
11101
|
const { numeratorFilter, denominatorFilter } = componentProps;
|
|
11062
|
-
const lapis =
|
|
11102
|
+
const lapis = useLapisUrl();
|
|
11063
11103
|
const { data, error, isLoading } = useQuery(async () => {
|
|
11064
11104
|
return queryGeneralStatistics(numeratorFilter, denominatorFilter, lapis);
|
|
11065
11105
|
}, [numeratorFilter, denominatorFilter, lapis]);
|
|
@@ -11225,7 +11265,7 @@ const wastewaterMutationOverTimeSchema = z$2.object({
|
|
|
11225
11265
|
sequenceType: sequenceTypeSchema,
|
|
11226
11266
|
width: z$2.string(),
|
|
11227
11267
|
height: z$2.string(),
|
|
11228
|
-
maxNumberOfGridRows: z$2.number()
|
|
11268
|
+
maxNumberOfGridRows: z$2.number()
|
|
11229
11269
|
});
|
|
11230
11270
|
const WastewaterMutationsOverTime = (componentProps) => {
|
|
11231
11271
|
const { width, height } = componentProps;
|
|
@@ -11233,7 +11273,7 @@ const WastewaterMutationsOverTime = (componentProps) => {
|
|
|
11233
11273
|
return /* @__PURE__ */ u$1(ErrorBoundary, { size, schema: wastewaterMutationOverTimeSchema, componentProps, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(WastewaterMutationsOverTimeInner, { ...componentProps }) }) });
|
|
11234
11274
|
};
|
|
11235
11275
|
const WastewaterMutationsOverTimeInner = (componentProps) => {
|
|
11236
|
-
const lapis =
|
|
11276
|
+
const lapis = useLapisUrl();
|
|
11237
11277
|
const {
|
|
11238
11278
|
data: mutationOverTimeDataPerLocation,
|
|
11239
11279
|
error,
|
|
@@ -11295,7 +11335,7 @@ const Toolbar = ({ colorScale, setColorScale, originalComponentProps }) => {
|
|
|
11295
11335
|
const WastewaterMutationsOverTimeInfo = ({
|
|
11296
11336
|
originalComponentProps
|
|
11297
11337
|
}) => {
|
|
11298
|
-
const lapis =
|
|
11338
|
+
const lapis = useLapisUrl();
|
|
11299
11339
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
11300
11340
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: "Info for mutations over time" }),
|
|
11301
11341
|
/* @__PURE__ */ u$1(InfoParagraph, { children: /* @__PURE__ */ u$1("slot", { name: "infoText" }) }),
|
|
@@ -11379,42 +11419,48 @@ const getDatesForSelectorValue = (initialSelectedDateRange, dateRangeOptions, ea
|
|
|
11379
11419
|
}
|
|
11380
11420
|
return defaultDates;
|
|
11381
11421
|
};
|
|
11382
|
-
function computeInitialValues(
|
|
11422
|
+
function computeInitialValues(value, earliestDate, dateRangeOptions) {
|
|
11383
11423
|
var _a;
|
|
11384
|
-
if (
|
|
11424
|
+
if (value === void 0) {
|
|
11425
|
+
const { dateFrom: dateFrom2, dateTo: dateTo2 } = getDatesForSelectorValue(void 0, dateRangeOptions, earliestDate);
|
|
11426
|
+
return {
|
|
11427
|
+
initialSelectedDateRange: void 0,
|
|
11428
|
+
initialSelectedDateFrom: dateFrom2,
|
|
11429
|
+
initialSelectedDateTo: dateTo2
|
|
11430
|
+
};
|
|
11431
|
+
}
|
|
11432
|
+
if (typeof value === "string") {
|
|
11385
11433
|
const selectableOptions = getSelectableOptions(dateRangeOptions);
|
|
11386
|
-
const initialSelectedDateRange = (_a = selectableOptions.find((option) => option.value ===
|
|
11387
|
-
if (
|
|
11434
|
+
const initialSelectedDateRange = (_a = selectableOptions.find((option) => option.value === value)) == null ? void 0 : _a.value;
|
|
11435
|
+
if (initialSelectedDateRange === void 0) {
|
|
11388
11436
|
if (selectableOptions.length === 0) {
|
|
11389
|
-
throw new UserFacingError(
|
|
11390
|
-
"Invalid initialValue",
|
|
11391
|
-
"There are no selectable options, but initialValue is set."
|
|
11392
|
-
);
|
|
11437
|
+
throw new UserFacingError("Invalid value", "There are no selectable options, but value is set.");
|
|
11393
11438
|
}
|
|
11394
11439
|
throw new UserFacingError(
|
|
11395
|
-
"Invalid
|
|
11396
|
-
`Invalid
|
|
11440
|
+
"Invalid value",
|
|
11441
|
+
`Invalid value "${value}", It must be one of ${selectableOptions.map((option) => `'${option.value}'`).join(", ")}`
|
|
11397
11442
|
);
|
|
11398
11443
|
}
|
|
11399
|
-
const { dateFrom, dateTo } = getDatesForSelectorValue(initialSelectedDateRange, dateRangeOptions, earliestDate);
|
|
11444
|
+
const { dateFrom: dateFrom2, dateTo: dateTo2 } = getDatesForSelectorValue(initialSelectedDateRange, dateRangeOptions, earliestDate);
|
|
11400
11445
|
return {
|
|
11401
11446
|
initialSelectedDateRange,
|
|
11402
|
-
initialSelectedDateFrom:
|
|
11403
|
-
initialSelectedDateTo:
|
|
11447
|
+
initialSelectedDateFrom: dateFrom2,
|
|
11448
|
+
initialSelectedDateTo: dateTo2
|
|
11404
11449
|
};
|
|
11405
11450
|
}
|
|
11406
|
-
const
|
|
11407
|
-
|
|
11451
|
+
const { dateFrom, dateTo } = value;
|
|
11452
|
+
const initialSelectedDateFrom = isUndefinedOrEmpty(dateFrom) ? new Date(earliestDate) : new Date(dateFrom);
|
|
11453
|
+
let initialSelectedDateTo = isUndefinedOrEmpty(dateTo) ? /* @__PURE__ */ new Date() : new Date(dateTo);
|
|
11408
11454
|
if (isNaN(initialSelectedDateFrom.getTime())) {
|
|
11409
11455
|
throw new UserFacingError(
|
|
11410
|
-
"Invalid
|
|
11411
|
-
`Invalid
|
|
11456
|
+
"Invalid value.dateFrom",
|
|
11457
|
+
`Invalid value.dateFrom "${dateFrom}", It must be of the format YYYY-MM-DD`
|
|
11412
11458
|
);
|
|
11413
11459
|
}
|
|
11414
11460
|
if (isNaN(initialSelectedDateTo.getTime())) {
|
|
11415
11461
|
throw new UserFacingError(
|
|
11416
|
-
"Invalid
|
|
11417
|
-
`Invalid
|
|
11462
|
+
"Invalid value.dateTo",
|
|
11463
|
+
`Invalid value.dateTo "${dateTo}", It must be of the format YYYY-MM-DD`
|
|
11418
11464
|
);
|
|
11419
11465
|
}
|
|
11420
11466
|
if (initialSelectedDateFrom > initialSelectedDateTo) {
|
|
@@ -11433,9 +11479,7 @@ const customOption = "Custom";
|
|
|
11433
11479
|
const dateRangeSelectorInnerPropsSchema = z$2.object({
|
|
11434
11480
|
dateRangeOptions: z$2.array(dateRangeOptionSchema),
|
|
11435
11481
|
earliestDate: z$2.string().date(),
|
|
11436
|
-
|
|
11437
|
-
initialDateFrom: z$2.string().date().optional(),
|
|
11438
|
-
initialDateTo: z$2.string().date().optional(),
|
|
11482
|
+
value: dateRangeValueSchema.optional(),
|
|
11439
11483
|
lapisDateField: z$2.string().min(1)
|
|
11440
11484
|
});
|
|
11441
11485
|
const dateRangeSelectorPropsSchema = dateRangeSelectorInnerPropsSchema.extend({
|
|
@@ -11449,17 +11493,12 @@ const DateRangeSelector = (props) => {
|
|
|
11449
11493
|
const DateRangeSelectorInner = ({
|
|
11450
11494
|
dateRangeOptions,
|
|
11451
11495
|
earliestDate = "1900-01-01",
|
|
11452
|
-
|
|
11453
|
-
lapisDateField
|
|
11454
|
-
initialDateFrom,
|
|
11455
|
-
initialDateTo
|
|
11496
|
+
value,
|
|
11497
|
+
lapisDateField
|
|
11456
11498
|
}) => {
|
|
11457
|
-
const initialValues =
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
initialDateTo,
|
|
11461
|
-
earliestDate,
|
|
11462
|
-
dateRangeOptions
|
|
11499
|
+
const initialValues = T$1(
|
|
11500
|
+
() => computeInitialValues(value, earliestDate, dateRangeOptions),
|
|
11501
|
+
[value, earliestDate, dateRangeOptions]
|
|
11463
11502
|
);
|
|
11464
11503
|
const fromDatePickerRef = A$1(null);
|
|
11465
11504
|
const toDatePickerRef = A$1(null);
|
|
@@ -11474,6 +11513,11 @@ const DateRangeSelectorInner = ({
|
|
|
11474
11513
|
dateTo: initialValues.initialSelectedDateTo
|
|
11475
11514
|
});
|
|
11476
11515
|
y(() => {
|
|
11516
|
+
setSelectedDateRange(initialValues.initialSelectedDateRange);
|
|
11517
|
+
setSelectedDates({
|
|
11518
|
+
dateFrom: initialValues.initialSelectedDateFrom,
|
|
11519
|
+
dateTo: initialValues.initialSelectedDateTo
|
|
11520
|
+
});
|
|
11477
11521
|
const commonConfig = {
|
|
11478
11522
|
allowInput: true,
|
|
11479
11523
|
dateFormat: "Y-m-d"
|
|
@@ -11482,7 +11526,7 @@ const DateRangeSelectorInner = ({
|
|
|
11482
11526
|
setDateFromPicker(
|
|
11483
11527
|
flatpickr(fromDatePickerRef.current, {
|
|
11484
11528
|
...commonConfig,
|
|
11485
|
-
defaultDate:
|
|
11529
|
+
defaultDate: initialValues.initialSelectedDateFrom
|
|
11486
11530
|
})
|
|
11487
11531
|
);
|
|
11488
11532
|
}
|
|
@@ -11490,18 +11534,24 @@ const DateRangeSelectorInner = ({
|
|
|
11490
11534
|
setDateToPicker(
|
|
11491
11535
|
flatpickr(toDatePickerRef.current, {
|
|
11492
11536
|
...commonConfig,
|
|
11493
|
-
defaultDate:
|
|
11537
|
+
defaultDate: initialValues.initialSelectedDateTo
|
|
11494
11538
|
})
|
|
11495
11539
|
);
|
|
11496
11540
|
}
|
|
11497
11541
|
return () => {
|
|
11498
|
-
|
|
11499
|
-
|
|
11542
|
+
setDateFromPicker((prev) => {
|
|
11543
|
+
prev == null ? void 0 : prev.destroy();
|
|
11544
|
+
return null;
|
|
11545
|
+
});
|
|
11546
|
+
setDateToPicker((prev) => {
|
|
11547
|
+
prev == null ? void 0 : prev.destroy();
|
|
11548
|
+
return null;
|
|
11549
|
+
});
|
|
11500
11550
|
};
|
|
11501
|
-
}, [fromDatePickerRef, toDatePickerRef]);
|
|
11502
|
-
const onSelectChange = (
|
|
11503
|
-
setSelectedDateRange(
|
|
11504
|
-
const dateRange = getDatesForSelectorValue(
|
|
11551
|
+
}, [fromDatePickerRef, toDatePickerRef, initialValues]);
|
|
11552
|
+
const onSelectChange = (value2) => {
|
|
11553
|
+
setSelectedDateRange(value2);
|
|
11554
|
+
const dateRange = getDatesForSelectorValue(value2, dateRangeOptions, earliestDate);
|
|
11505
11555
|
dateToPicker == null ? void 0 : dateToPicker.set("minDate", dateRange.dateFrom);
|
|
11506
11556
|
dateFromPicker == null ? void 0 : dateFromPicker.set("maxDate", dateRange.dateTo);
|
|
11507
11557
|
dateFromPicker == null ? void 0 : dateFromPicker.setDate(dateRange.dateFrom);
|
|
@@ -11511,7 +11561,7 @@ const DateRangeSelectorInner = ({
|
|
|
11511
11561
|
dateTo: dateRange.dateTo
|
|
11512
11562
|
});
|
|
11513
11563
|
fireFilterChangedEvent();
|
|
11514
|
-
fireOptionChangedEvent(
|
|
11564
|
+
fireOptionChangedEvent(value2);
|
|
11515
11565
|
};
|
|
11516
11566
|
const onChangeDateFrom = () => {
|
|
11517
11567
|
if (selectedDates.dateFrom.toDateString() === (dateFromPicker == null ? void 0 : dateFromPicker.selectedDates[0].toDateString())) {
|
|
@@ -11576,8 +11626,8 @@ const DateRangeSelectorInner = ({
|
|
|
11576
11626
|
onChange: (event) => {
|
|
11577
11627
|
event.preventDefault();
|
|
11578
11628
|
const select = event.target;
|
|
11579
|
-
const
|
|
11580
|
-
onSelectChange(
|
|
11629
|
+
const value2 = select.value;
|
|
11630
|
+
onSelectChange(value2);
|
|
11581
11631
|
}
|
|
11582
11632
|
}
|
|
11583
11633
|
),
|
|
@@ -11622,9 +11672,7 @@ let DateRangeSelectorComponent = class extends PreactLitAdapter {
|
|
|
11622
11672
|
super(...arguments);
|
|
11623
11673
|
this.dateRangeOptions = [];
|
|
11624
11674
|
this.earliestDate = "1900-01-01";
|
|
11625
|
-
this.
|
|
11626
|
-
this.initialDateFrom = void 0;
|
|
11627
|
-
this.initialDateTo = void 0;
|
|
11675
|
+
this.value = void 0;
|
|
11628
11676
|
this.width = "100%";
|
|
11629
11677
|
this.lapisDateField = "";
|
|
11630
11678
|
}
|
|
@@ -11634,9 +11682,7 @@ let DateRangeSelectorComponent = class extends PreactLitAdapter {
|
|
|
11634
11682
|
{
|
|
11635
11683
|
dateRangeOptions: this.dateRangeOptions,
|
|
11636
11684
|
earliestDate: this.earliestDate,
|
|
11637
|
-
|
|
11638
|
-
initialDateFrom: this.initialDateFrom,
|
|
11639
|
-
initialDateTo: this.initialDateTo,
|
|
11685
|
+
value: this.value,
|
|
11640
11686
|
lapisDateField: this.lapisDateField,
|
|
11641
11687
|
width: this.width
|
|
11642
11688
|
}
|
|
@@ -11650,14 +11696,8 @@ __decorateClass$4([
|
|
|
11650
11696
|
n$1({ type: String })
|
|
11651
11697
|
], DateRangeSelectorComponent.prototype, "earliestDate", 2);
|
|
11652
11698
|
__decorateClass$4([
|
|
11653
|
-
n$1()
|
|
11654
|
-
], DateRangeSelectorComponent.prototype, "
|
|
11655
|
-
__decorateClass$4([
|
|
11656
|
-
n$1()
|
|
11657
|
-
], DateRangeSelectorComponent.prototype, "initialDateFrom", 2);
|
|
11658
|
-
__decorateClass$4([
|
|
11659
|
-
n$1()
|
|
11660
|
-
], DateRangeSelectorComponent.prototype, "initialDateTo", 2);
|
|
11699
|
+
n$1({ type: Object })
|
|
11700
|
+
], DateRangeSelectorComponent.prototype, "value", 2);
|
|
11661
11701
|
__decorateClass$4([
|
|
11662
11702
|
n$1({ type: String })
|
|
11663
11703
|
], DateRangeSelectorComponent.prototype, "width", 2);
|
|
@@ -14793,7 +14833,7 @@ const LocationFilter = (props) => {
|
|
|
14793
14833
|
return /* @__PURE__ */ u$1(ErrorBoundary, { size, layout: "horizontal", componentProps: props, schema: locationFilterPropsSchema, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(LocationFilterInner, { ...innerProps }) }) });
|
|
14794
14834
|
};
|
|
14795
14835
|
const LocationFilterInner = ({ value, fields, placeholderText, lapisFilter }) => {
|
|
14796
|
-
const lapis =
|
|
14836
|
+
const lapis = useLapisUrl();
|
|
14797
14837
|
const { data, error, isLoading } = useQuery(
|
|
14798
14838
|
() => fetchAutocompletionList({ fields, lapis, lapisFilter }),
|
|
14799
14839
|
[fields, lapis, lapisFilter]
|
|
@@ -14961,7 +15001,7 @@ const TextInputInner = ({
|
|
|
14961
15001
|
placeholderText,
|
|
14962
15002
|
lapisFilter
|
|
14963
15003
|
}) => {
|
|
14964
|
-
const lapis =
|
|
15004
|
+
const lapis = useLapisUrl();
|
|
14965
15005
|
const { data, error, isLoading } = useQuery(
|
|
14966
15006
|
() => fetchStringAutocompleteList({ lapis, field: lapisField, lapisFilter }),
|
|
14967
15007
|
[lapisField, lapis, lapisFilter]
|
|
@@ -15073,48 +15113,219 @@ const ReferenceGenomesAwaiter = ({ children }) => {
|
|
|
15073
15113
|
function isNotInitialized(referenceGenome) {
|
|
15074
15114
|
return referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0;
|
|
15075
15115
|
}
|
|
15076
|
-
const
|
|
15116
|
+
const ExampleMutation = ({ sequenceType, mutationType }) => {
|
|
15077
15117
|
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15078
|
-
|
|
15118
|
+
return /* @__PURE__ */ u$1("b", { children: getExampleMutation(referenceGenome, sequenceType, mutationType) });
|
|
15119
|
+
};
|
|
15120
|
+
function getExampleMutation(referenceGenome, sequenceType, mutationType) {
|
|
15121
|
+
switch (sequenceType) {
|
|
15122
|
+
case "amino acid": {
|
|
15123
|
+
if (referenceGenome.genes.length === 0) {
|
|
15124
|
+
return "";
|
|
15125
|
+
}
|
|
15126
|
+
const firstGene = referenceGenome.genes[0].name;
|
|
15127
|
+
switch (mutationType) {
|
|
15128
|
+
case "substitution":
|
|
15129
|
+
return `${firstGene}:57Q`;
|
|
15130
|
+
case "insertion":
|
|
15131
|
+
return `ins_${firstGene}:31:N`;
|
|
15132
|
+
}
|
|
15133
|
+
}
|
|
15134
|
+
// Issue of linter https://github.com/typescript-eslint/typescript-eslint/issues/3455
|
|
15135
|
+
// eslint-disable-next-line no-fallthrough
|
|
15136
|
+
case "nucleotide": {
|
|
15137
|
+
switch (referenceGenome.nucleotideSequences.length) {
|
|
15138
|
+
case 0: {
|
|
15139
|
+
return "";
|
|
15140
|
+
}
|
|
15141
|
+
case 1: {
|
|
15142
|
+
switch (mutationType) {
|
|
15143
|
+
case "substitution":
|
|
15144
|
+
return "23T";
|
|
15145
|
+
case "insertion":
|
|
15146
|
+
return "ins_1046:A";
|
|
15147
|
+
}
|
|
15148
|
+
}
|
|
15149
|
+
// Issue of linter https://github.com/typescript-eslint/typescript-eslint/issues/3455
|
|
15150
|
+
// eslint-disable-next-line no-fallthrough
|
|
15151
|
+
default: {
|
|
15152
|
+
const firstSegment = referenceGenome.nucleotideSequences[0].name;
|
|
15153
|
+
switch (mutationType) {
|
|
15154
|
+
case "substitution":
|
|
15155
|
+
return `${firstSegment}:23T`;
|
|
15156
|
+
case "insertion":
|
|
15157
|
+
return `ins_${firstSegment}:10462:A`;
|
|
15158
|
+
}
|
|
15159
|
+
}
|
|
15160
|
+
}
|
|
15161
|
+
}
|
|
15162
|
+
}
|
|
15163
|
+
}
|
|
15164
|
+
const MutationFilterInfo = () => {
|
|
15079
15165
|
return /* @__PURE__ */ u$1(Info, { children: [
|
|
15080
15166
|
/* @__PURE__ */ u$1(InfoHeadline1, { children: " Mutation Filter" }),
|
|
15081
15167
|
/* @__PURE__ */ u$1(InfoParagraph, { children: "This component allows you to filter for mutations at specific positions." }),
|
|
15168
|
+
/* @__PURE__ */ u$1(QuickStart, {}),
|
|
15169
|
+
/* @__PURE__ */ u$1(NucleotideMutationsInfo, {}),
|
|
15170
|
+
/* @__PURE__ */ u$1(AminoAcidMutationsInfo, {}),
|
|
15171
|
+
/* @__PURE__ */ u$1(InsertionWildcards, {}),
|
|
15172
|
+
/* @__PURE__ */ u$1(MultipleMutations, {}),
|
|
15173
|
+
/* @__PURE__ */ u$1(AnyMutation, {}),
|
|
15174
|
+
/* @__PURE__ */ u$1(NoMutation, {})
|
|
15175
|
+
] });
|
|
15176
|
+
};
|
|
15177
|
+
const QuickStart = () => {
|
|
15178
|
+
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15179
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15082
15180
|
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Quickstart" }),
|
|
15083
15181
|
/* @__PURE__ */ u$1(InfoParagraph, { children: /* @__PURE__ */ u$1("ul", { className: "list-disc list-inside", children: [
|
|
15084
|
-
/* @__PURE__ */ u$1("li", { children: [
|
|
15182
|
+
referenceGenome.nucleotideSequences.length > 0 && /* @__PURE__ */ u$1("li", { children: [
|
|
15085
15183
|
"Filter for nucleotide mutations:",
|
|
15086
15184
|
" ",
|
|
15087
15185
|
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "substitution", sequenceType: "nucleotide" })
|
|
15088
15186
|
] }),
|
|
15089
|
-
/* @__PURE__ */ u$1("li", { children: [
|
|
15187
|
+
referenceGenome.genes.length > 0 && /* @__PURE__ */ u$1("li", { children: [
|
|
15090
15188
|
"Filter for amino acid mutations:",
|
|
15091
15189
|
" ",
|
|
15092
|
-
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "
|
|
15190
|
+
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "substitution", sequenceType: "amino acid" })
|
|
15093
15191
|
] }),
|
|
15094
|
-
/* @__PURE__ */ u$1("li", { children: [
|
|
15192
|
+
referenceGenome.nucleotideSequences.length > 0 && /* @__PURE__ */ u$1("li", { children: [
|
|
15095
15193
|
"Filter for nucleotide insertions:",
|
|
15096
15194
|
" ",
|
|
15097
|
-
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "
|
|
15195
|
+
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "nucleotide" })
|
|
15098
15196
|
] }),
|
|
15099
|
-
/* @__PURE__ */ u$1("li", { children: [
|
|
15197
|
+
referenceGenome.genes.length > 0 && /* @__PURE__ */ u$1("li", { children: [
|
|
15100
15198
|
"Filter for amino acid insertions:",
|
|
15101
15199
|
" ",
|
|
15102
15200
|
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "amino acid" })
|
|
15103
15201
|
] })
|
|
15104
15202
|
] }) }),
|
|
15105
|
-
|
|
15203
|
+
referenceGenome.nucleotideSequences.length > 1 && /* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15106
15204
|
"This organism has the following segments:",
|
|
15107
15205
|
" ",
|
|
15108
15206
|
referenceGenome.nucleotideSequences.map((gene) => gene.name).join(", "),
|
|
15109
15207
|
"."
|
|
15110
15208
|
] }),
|
|
15111
|
-
/* @__PURE__ */ u$1(InfoParagraph, { children:
|
|
15209
|
+
referenceGenome.nucleotideSequences.length === 0 && /* @__PURE__ */ u$1(InfoParagraph, { children: "This organism doesn't support nucleotide sequences." }),
|
|
15210
|
+
referenceGenome.genes.length !== 0 ? /* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15112
15211
|
"This organism has the following genes: ",
|
|
15113
15212
|
referenceGenome.genes.map((gene) => gene.name).join(", "),
|
|
15114
15213
|
"."
|
|
15115
|
-
] }),
|
|
15214
|
+
] }) : /* @__PURE__ */ u$1(InfoParagraph, { children: "This organism doesn't support amino acid sequences." })
|
|
15215
|
+
] });
|
|
15216
|
+
};
|
|
15217
|
+
const NucleotideMutationsInfo = () => {
|
|
15218
|
+
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15219
|
+
if (referenceGenome.nucleotideSequences.length === 0) {
|
|
15220
|
+
return null;
|
|
15221
|
+
}
|
|
15222
|
+
if (isSingleSegmented(referenceGenome)) {
|
|
15223
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15224
|
+
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Nucleotide Mutations and Insertions" }),
|
|
15225
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15226
|
+
"This organism is single-segmented. Thus, nucleotide mutations have the format",
|
|
15227
|
+
" ",
|
|
15228
|
+
/* @__PURE__ */ u$1("b", { children: "<position><base>" }),
|
|
15229
|
+
" or ",
|
|
15230
|
+
/* @__PURE__ */ u$1("b", { children: "<base_ref><position><base>" }),
|
|
15231
|
+
". The",
|
|
15232
|
+
" ",
|
|
15233
|
+
/* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
|
|
15234
|
+
" is the reference base at the position. It is optional. A ",
|
|
15235
|
+
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
15236
|
+
" ",
|
|
15237
|
+
"can be one of the four nucleotides ",
|
|
15238
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15239
|
+
", ",
|
|
15240
|
+
/* @__PURE__ */ u$1("b", { children: "T" }),
|
|
15241
|
+
", ",
|
|
15242
|
+
/* @__PURE__ */ u$1("b", { children: "C" }),
|
|
15243
|
+
", and ",
|
|
15244
|
+
/* @__PURE__ */ u$1("b", { children: "G" }),
|
|
15245
|
+
". It can also be",
|
|
15246
|
+
" ",
|
|
15247
|
+
/* @__PURE__ */ u$1("b", { children: "-" }),
|
|
15248
|
+
" for deletion and ",
|
|
15249
|
+
/* @__PURE__ */ u$1("b", { children: "N" }),
|
|
15250
|
+
" for unknown. For example if the reference sequence is ",
|
|
15251
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15252
|
+
" at position ",
|
|
15253
|
+
/* @__PURE__ */ u$1("b", { children: "23" }),
|
|
15254
|
+
" both: ",
|
|
15255
|
+
/* @__PURE__ */ u$1("b", { children: "23T" }),
|
|
15256
|
+
" and ",
|
|
15257
|
+
/* @__PURE__ */ u$1("b", { children: "A23T" }),
|
|
15258
|
+
" will yield the same results."
|
|
15259
|
+
] }),
|
|
15260
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15261
|
+
"Insertions can be searched for in the same manner, they just need to have ",
|
|
15262
|
+
/* @__PURE__ */ u$1("b", { children: "ins_" }),
|
|
15263
|
+
" appended to the start of the mutation. Example: ",
|
|
15264
|
+
/* @__PURE__ */ u$1("b", { children: "ins_1046:A" }),
|
|
15265
|
+
" would filter for sequences with an insertion of A between the positions 1046 and 1047 in the nucleotide sequence."
|
|
15266
|
+
] })
|
|
15267
|
+
] });
|
|
15268
|
+
}
|
|
15269
|
+
const firstSegment = referenceGenome.nucleotideSequences[0].name;
|
|
15270
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15116
15271
|
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Nucleotide Mutations and Insertions" }),
|
|
15117
|
-
|
|
15272
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15273
|
+
"This organism is multi-segmented. Thus, nucleotide mutations have the format",
|
|
15274
|
+
" ",
|
|
15275
|
+
/* @__PURE__ */ u$1("b", { children: "<segment>:<position><base>" }),
|
|
15276
|
+
" or",
|
|
15277
|
+
" ",
|
|
15278
|
+
/* @__PURE__ */ u$1("b", { children: "<segment>:<base_ref><position><base>" }),
|
|
15279
|
+
". ",
|
|
15280
|
+
/* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
|
|
15281
|
+
" is the reference base at the position. It is optional. A ",
|
|
15282
|
+
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
15283
|
+
" can be one of the four nucleotides",
|
|
15284
|
+
" ",
|
|
15285
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15286
|
+
", ",
|
|
15287
|
+
/* @__PURE__ */ u$1("b", { children: "T" }),
|
|
15288
|
+
", ",
|
|
15289
|
+
/* @__PURE__ */ u$1("b", { children: "C" }),
|
|
15290
|
+
", and ",
|
|
15291
|
+
/* @__PURE__ */ u$1("b", { children: "G" }),
|
|
15292
|
+
". It can also be ",
|
|
15293
|
+
/* @__PURE__ */ u$1("b", { children: "-" }),
|
|
15294
|
+
" for deletion and ",
|
|
15295
|
+
/* @__PURE__ */ u$1("b", { children: "N" }),
|
|
15296
|
+
" for unknown. For example if the reference sequence is ",
|
|
15297
|
+
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15298
|
+
" at position ",
|
|
15299
|
+
/* @__PURE__ */ u$1("b", { children: "23" }),
|
|
15300
|
+
" both:",
|
|
15301
|
+
" ",
|
|
15302
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
15303
|
+
firstSegment,
|
|
15304
|
+
":23T"
|
|
15305
|
+
] }),
|
|
15306
|
+
" and ",
|
|
15307
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
15308
|
+
firstSegment,
|
|
15309
|
+
":A23T"
|
|
15310
|
+
] }),
|
|
15311
|
+
" will yield the same results."
|
|
15312
|
+
] }),
|
|
15313
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15314
|
+
"Insertions can be searched for in the same manner, they just need to have ",
|
|
15315
|
+
/* @__PURE__ */ u$1("b", { children: "ins_" }),
|
|
15316
|
+
" appended to the start of the mutation. Example: ",
|
|
15317
|
+
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "nucleotide" }),
|
|
15318
|
+
"."
|
|
15319
|
+
] })
|
|
15320
|
+
] });
|
|
15321
|
+
};
|
|
15322
|
+
const AminoAcidMutationsInfo = () => {
|
|
15323
|
+
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15324
|
+
if (referenceGenome.genes.length === 0) {
|
|
15325
|
+
return null;
|
|
15326
|
+
}
|
|
15327
|
+
const firstGene = referenceGenome.genes[0].name;
|
|
15328
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15118
15329
|
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Amino Acid Mutations and Insertions" }),
|
|
15119
15330
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15120
15331
|
"An amino acid mutation has the format ",
|
|
@@ -15144,30 +15355,46 @@ const MutationFilterInfo = () => {
|
|
|
15144
15355
|
" would filter for sequences with an insertion of N between positions 31 and 32 in the gene ",
|
|
15145
15356
|
firstGene,
|
|
15146
15357
|
"."
|
|
15147
|
-
] })
|
|
15358
|
+
] })
|
|
15359
|
+
] });
|
|
15360
|
+
};
|
|
15361
|
+
const InsertionWildcards = () => {
|
|
15362
|
+
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15363
|
+
if (referenceGenome.nucleotideSequences.length === 0 && referenceGenome.genes.length === 0) {
|
|
15364
|
+
return null;
|
|
15365
|
+
}
|
|
15366
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15148
15367
|
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Insertion Wildcards" }),
|
|
15149
15368
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15150
|
-
"This component supports insertion queries that contain wildcards ",
|
|
15369
|
+
"This component supports nucleotide and amino acid insertion queries that contain wildcards ",
|
|
15151
15370
|
/* @__PURE__ */ u$1("b", { children: "?" }),
|
|
15152
15371
|
". For example",
|
|
15153
15372
|
" ",
|
|
15154
15373
|
/* @__PURE__ */ u$1("b", { children: [
|
|
15155
15374
|
"ins_",
|
|
15156
|
-
|
|
15157
|
-
"
|
|
15375
|
+
exampleSegmentString(referenceGenome),
|
|
15376
|
+
"214:?",
|
|
15377
|
+
exampleWildcardInsertion(referenceGenome),
|
|
15378
|
+
"?"
|
|
15158
15379
|
] }),
|
|
15159
|
-
"
|
|
15160
|
-
|
|
15161
|
-
"
|
|
15162
|
-
|
|
15380
|
+
" ",
|
|
15381
|
+
"will match all cases where segment ",
|
|
15382
|
+
/* @__PURE__ */ u$1("b", { children: exampleSegment(referenceGenome) }),
|
|
15383
|
+
" has an insertion of",
|
|
15384
|
+
" ",
|
|
15385
|
+
/* @__PURE__ */ u$1("b", { children: exampleWildcardInsertion(referenceGenome) }),
|
|
15163
15386
|
" between the positions ",
|
|
15164
15387
|
/* @__PURE__ */ u$1("b", { children: "214" }),
|
|
15165
15388
|
" and ",
|
|
15166
15389
|
/* @__PURE__ */ u$1("b", { children: "215" }),
|
|
15167
15390
|
" but also an insertion of other amino acids which include the ",
|
|
15168
15391
|
/* @__PURE__ */ u$1("b", { children: "EP" }),
|
|
15169
|
-
", e.g. the insertion
|
|
15170
|
-
|
|
15392
|
+
", e.g. the insertion",
|
|
15393
|
+
" ",
|
|
15394
|
+
/* @__PURE__ */ u$1("b", { children: [
|
|
15395
|
+
exampleWildcardInsertion(referenceGenome),
|
|
15396
|
+
"T"
|
|
15397
|
+
] }),
|
|
15171
15398
|
" will be matched."
|
|
15172
15399
|
] }),
|
|
15173
15400
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
@@ -15175,13 +15402,47 @@ const MutationFilterInfo = () => {
|
|
|
15175
15402
|
" ",
|
|
15176
15403
|
/* @__PURE__ */ u$1("b", { children: [
|
|
15177
15404
|
"ins_",
|
|
15178
|
-
|
|
15179
|
-
"
|
|
15405
|
+
exampleSegmentString(referenceGenome),
|
|
15406
|
+
"214:?"
|
|
15180
15407
|
] }),
|
|
15181
15408
|
" match any (but at least one) insertion between the positions 214 and 215."
|
|
15182
|
-
] })
|
|
15409
|
+
] })
|
|
15410
|
+
] });
|
|
15411
|
+
};
|
|
15412
|
+
const exampleSegmentString = (referenceGenome) => {
|
|
15413
|
+
const segment = exampleSegment(referenceGenome);
|
|
15414
|
+
if (segment === "") {
|
|
15415
|
+
return "";
|
|
15416
|
+
}
|
|
15417
|
+
return `${segment}:`;
|
|
15418
|
+
};
|
|
15419
|
+
const exampleSegment = (referenceGenome) => {
|
|
15420
|
+
if (referenceGenome.genes.length > 0) {
|
|
15421
|
+
return `${referenceGenome.genes[0].name}`;
|
|
15422
|
+
}
|
|
15423
|
+
if (referenceGenome.nucleotideSequences.length > 1) {
|
|
15424
|
+
return `${referenceGenome.nucleotideSequences[0].name}`;
|
|
15425
|
+
}
|
|
15426
|
+
return "";
|
|
15427
|
+
};
|
|
15428
|
+
const exampleWildcardInsertion = (referenceGenome) => {
|
|
15429
|
+
if (referenceGenome.genes.length > 0) {
|
|
15430
|
+
return "EP";
|
|
15431
|
+
}
|
|
15432
|
+
if (referenceGenome.nucleotideSequences.length > 0) {
|
|
15433
|
+
return "CG";
|
|
15434
|
+
}
|
|
15435
|
+
return "";
|
|
15436
|
+
};
|
|
15437
|
+
const MultipleMutations = () => {
|
|
15438
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15183
15439
|
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Multiple Mutations" }),
|
|
15184
|
-
/* @__PURE__ */ u$1(InfoParagraph, { children: "Multiple mutation filters can be provided by adding one mutation after the other." })
|
|
15440
|
+
/* @__PURE__ */ u$1(InfoParagraph, { children: "Multiple mutation filters can be provided by adding one mutation after the other." })
|
|
15441
|
+
] });
|
|
15442
|
+
};
|
|
15443
|
+
const AnyMutation = () => {
|
|
15444
|
+
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15445
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15185
15446
|
/* @__PURE__ */ u$1(InfoHeadline2, { children: "Any Mutation" }),
|
|
15186
15447
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15187
15448
|
"To filter for any mutation at a given position you can omit the ",
|
|
@@ -15189,11 +15450,15 @@ const MutationFilterInfo = () => {
|
|
|
15189
15450
|
". Example:",
|
|
15190
15451
|
" ",
|
|
15191
15452
|
/* @__PURE__ */ u$1("b", { children: [
|
|
15192
|
-
|
|
15193
|
-
"
|
|
15453
|
+
exampleSegmentString(referenceGenome),
|
|
15454
|
+
"20"
|
|
15194
15455
|
] }),
|
|
15195
15456
|
"."
|
|
15196
|
-
] })
|
|
15457
|
+
] })
|
|
15458
|
+
] });
|
|
15459
|
+
};
|
|
15460
|
+
const NoMutation = () => {
|
|
15461
|
+
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15197
15462
|
/* @__PURE__ */ u$1(InfoHeadline2, { children: "No Mutation" }),
|
|
15198
15463
|
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15199
15464
|
"You can write a ",
|
|
@@ -15204,146 +15469,6 @@ const MutationFilterInfo = () => {
|
|
|
15204
15469
|
] })
|
|
15205
15470
|
] });
|
|
15206
15471
|
};
|
|
15207
|
-
const SingleSegmentedNucleotideMutationsInfo = () => {
|
|
15208
|
-
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15209
|
-
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15210
|
-
"This organism is single-segmented. Thus, nucleotide mutations have the format",
|
|
15211
|
-
" ",
|
|
15212
|
-
/* @__PURE__ */ u$1("b", { children: "<position><base>" }),
|
|
15213
|
-
" or ",
|
|
15214
|
-
/* @__PURE__ */ u$1("b", { children: "<base_ref><position><base>" }),
|
|
15215
|
-
". The",
|
|
15216
|
-
" ",
|
|
15217
|
-
/* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
|
|
15218
|
-
" is the reference base at the position. It is optional. A ",
|
|
15219
|
-
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
15220
|
-
" can be one of the four nucleotides ",
|
|
15221
|
-
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15222
|
-
", ",
|
|
15223
|
-
/* @__PURE__ */ u$1("b", { children: "T" }),
|
|
15224
|
-
", ",
|
|
15225
|
-
/* @__PURE__ */ u$1("b", { children: "C" }),
|
|
15226
|
-
", and ",
|
|
15227
|
-
/* @__PURE__ */ u$1("b", { children: "G" }),
|
|
15228
|
-
". It can also be ",
|
|
15229
|
-
/* @__PURE__ */ u$1("b", { children: "-" }),
|
|
15230
|
-
" for deletion and ",
|
|
15231
|
-
/* @__PURE__ */ u$1("b", { children: "N" }),
|
|
15232
|
-
" for unknown. For example if the reference sequence is ",
|
|
15233
|
-
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15234
|
-
" at position",
|
|
15235
|
-
" ",
|
|
15236
|
-
/* @__PURE__ */ u$1("b", { children: "23" }),
|
|
15237
|
-
" both: ",
|
|
15238
|
-
/* @__PURE__ */ u$1("b", { children: "23T" }),
|
|
15239
|
-
" and ",
|
|
15240
|
-
/* @__PURE__ */ u$1("b", { children: "A23T" }),
|
|
15241
|
-
" will yield the same results."
|
|
15242
|
-
] }),
|
|
15243
|
-
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15244
|
-
"Insertions can be searched for in the same manner, they just need to have ",
|
|
15245
|
-
/* @__PURE__ */ u$1("b", { children: "ins_" }),
|
|
15246
|
-
" appended to the start of the mutation. Example: ",
|
|
15247
|
-
/* @__PURE__ */ u$1("b", { children: "ins_1046:A" }),
|
|
15248
|
-
" would filter for sequences with an insertion of A between the positions 1046 and 1047 in the nucleotide sequence."
|
|
15249
|
-
] })
|
|
15250
|
-
] });
|
|
15251
|
-
};
|
|
15252
|
-
const MultiSegmentedNucleotideMutationsInfo = () => {
|
|
15253
|
-
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15254
|
-
const firstSegment = referenceGenome.nucleotideSequences[0].name;
|
|
15255
|
-
return /* @__PURE__ */ u$1(Fragment, { children: [
|
|
15256
|
-
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15257
|
-
"This organism is multi-segmented. Thus, nucleotide mutations have the format",
|
|
15258
|
-
" ",
|
|
15259
|
-
/* @__PURE__ */ u$1("b", { children: "<segment>:<position><base>" }),
|
|
15260
|
-
" or",
|
|
15261
|
-
" ",
|
|
15262
|
-
/* @__PURE__ */ u$1("b", { children: "<segment>:<base_ref><position><base>" }),
|
|
15263
|
-
". ",
|
|
15264
|
-
/* @__PURE__ */ u$1("b", { children: "<base_ref>" }),
|
|
15265
|
-
" is the reference base at the position. It is optional. A ",
|
|
15266
|
-
/* @__PURE__ */ u$1("b", { children: "<base>" }),
|
|
15267
|
-
" can be one of the four nucleotides",
|
|
15268
|
-
" ",
|
|
15269
|
-
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15270
|
-
", ",
|
|
15271
|
-
/* @__PURE__ */ u$1("b", { children: "T" }),
|
|
15272
|
-
", ",
|
|
15273
|
-
/* @__PURE__ */ u$1("b", { children: "C" }),
|
|
15274
|
-
", and ",
|
|
15275
|
-
/* @__PURE__ */ u$1("b", { children: "G" }),
|
|
15276
|
-
". It can also be ",
|
|
15277
|
-
/* @__PURE__ */ u$1("b", { children: "-" }),
|
|
15278
|
-
" for deletion and ",
|
|
15279
|
-
/* @__PURE__ */ u$1("b", { children: "N" }),
|
|
15280
|
-
" for unknown. For example if the reference sequence is ",
|
|
15281
|
-
/* @__PURE__ */ u$1("b", { children: "A" }),
|
|
15282
|
-
" at position ",
|
|
15283
|
-
/* @__PURE__ */ u$1("b", { children: "23" }),
|
|
15284
|
-
" both:",
|
|
15285
|
-
" ",
|
|
15286
|
-
/* @__PURE__ */ u$1("b", { children: [
|
|
15287
|
-
firstSegment,
|
|
15288
|
-
":23T"
|
|
15289
|
-
] }),
|
|
15290
|
-
" and ",
|
|
15291
|
-
/* @__PURE__ */ u$1("b", { children: [
|
|
15292
|
-
firstSegment,
|
|
15293
|
-
":A23T"
|
|
15294
|
-
] }),
|
|
15295
|
-
" will yield the same results."
|
|
15296
|
-
] }),
|
|
15297
|
-
/* @__PURE__ */ u$1(InfoParagraph, { children: [
|
|
15298
|
-
"Insertions can be searched for in the same manner, they just need to have ",
|
|
15299
|
-
/* @__PURE__ */ u$1("b", { children: "ins_" }),
|
|
15300
|
-
" appended to the start of the mutation. Example: ",
|
|
15301
|
-
/* @__PURE__ */ u$1(ExampleMutation, { mutationType: "insertion", sequenceType: "nucleotide" }),
|
|
15302
|
-
"."
|
|
15303
|
-
] })
|
|
15304
|
-
] });
|
|
15305
|
-
};
|
|
15306
|
-
const ExampleMutation = ({ sequenceType, mutationType }) => {
|
|
15307
|
-
const referenceGenome = x$1(ReferenceGenomeContext);
|
|
15308
|
-
const firstSegment = referenceGenome.nucleotideSequences[0].name;
|
|
15309
|
-
const firstGene = referenceGenome.genes[0].name;
|
|
15310
|
-
if (sequenceType === "amino acid") {
|
|
15311
|
-
switch (mutationType) {
|
|
15312
|
-
case "substitution":
|
|
15313
|
-
return /* @__PURE__ */ u$1("b", { children: [
|
|
15314
|
-
firstGene,
|
|
15315
|
-
":57Q"
|
|
15316
|
-
] });
|
|
15317
|
-
case "insertion":
|
|
15318
|
-
return /* @__PURE__ */ u$1("b", { children: [
|
|
15319
|
-
"ins_",
|
|
15320
|
-
firstGene,
|
|
15321
|
-
":31:N"
|
|
15322
|
-
] });
|
|
15323
|
-
}
|
|
15324
|
-
}
|
|
15325
|
-
if (isSingleSegmented(referenceGenome)) {
|
|
15326
|
-
switch (mutationType) {
|
|
15327
|
-
case "substitution":
|
|
15328
|
-
return /* @__PURE__ */ u$1("b", { children: "23T" });
|
|
15329
|
-
case "insertion":
|
|
15330
|
-
return /* @__PURE__ */ u$1("b", { children: "ins_1046:A" });
|
|
15331
|
-
}
|
|
15332
|
-
}
|
|
15333
|
-
switch (mutationType) {
|
|
15334
|
-
case "substitution":
|
|
15335
|
-
return /* @__PURE__ */ u$1("b", { children: [
|
|
15336
|
-
firstSegment,
|
|
15337
|
-
":23T"
|
|
15338
|
-
] });
|
|
15339
|
-
case "insertion":
|
|
15340
|
-
return /* @__PURE__ */ u$1("b", { children: [
|
|
15341
|
-
"ins_",
|
|
15342
|
-
firstSegment,
|
|
15343
|
-
":10462:A"
|
|
15344
|
-
] });
|
|
15345
|
-
}
|
|
15346
|
-
};
|
|
15347
15472
|
const sequenceTypeFromSegment = (possibleSegment, referenceGenome) => {
|
|
15348
15473
|
if (possibleSegment === void 0) {
|
|
15349
15474
|
return isSingleSegmented(referenceGenome) ? "nucleotide" : void 0;
|
|
@@ -15587,9 +15712,12 @@ const MutationFilterSelector = ({ referenceGenome, setSelectedFilters, selectedF
|
|
|
15587
15712
|
] });
|
|
15588
15713
|
};
|
|
15589
15714
|
function getPlaceholder(referenceGenome) {
|
|
15590
|
-
const
|
|
15591
|
-
const
|
|
15592
|
-
|
|
15715
|
+
const nucleotideSubstitution = getExampleMutation(referenceGenome, "nucleotide", "substitution");
|
|
15716
|
+
const nucleotideInsertion = getExampleMutation(referenceGenome, "nucleotide", "insertion");
|
|
15717
|
+
const aminoAcidSubstitution = getExampleMutation(referenceGenome, "amino acid", "substitution");
|
|
15718
|
+
const aminoAcidInsertion = getExampleMutation(referenceGenome, "amino acid", "insertion");
|
|
15719
|
+
const exampleMutations = [nucleotideSubstitution, nucleotideInsertion, aminoAcidSubstitution, aminoAcidInsertion].filter((example) => example !== "").join(", ");
|
|
15720
|
+
return `Enter a mutation (e.g. ${exampleMutations})`;
|
|
15593
15721
|
}
|
|
15594
15722
|
const backgroundColor = {
|
|
15595
15723
|
aminoAcidMutations: singleGraphColorRGBByName("teal", 0.4),
|
|
@@ -15721,7 +15849,7 @@ const LineageFilterInner = ({
|
|
|
15721
15849
|
value,
|
|
15722
15850
|
lapisFilter
|
|
15723
15851
|
}) => {
|
|
15724
|
-
const lapis =
|
|
15852
|
+
const lapis = useLapisUrl();
|
|
15725
15853
|
const { data, error, isLoading } = useQuery(
|
|
15726
15854
|
() => fetchLineageAutocompleteList({ lapis, field: lapisField, lapisFilter }),
|
|
15727
15855
|
[lapisField, lapis, lapisFilter]
|
|
@@ -15811,7 +15939,7 @@ LineageFilterComponent = __decorateClass([
|
|
|
15811
15939
|
], LineageFilterComponent);
|
|
15812
15940
|
export {
|
|
15813
15941
|
AggregateComponent,
|
|
15814
|
-
|
|
15942
|
+
AppComponent,
|
|
15815
15943
|
DateRangeSelectorComponent,
|
|
15816
15944
|
LineageFilterComponent,
|
|
15817
15945
|
LocationFilterComponent,
|