@genspectrum/dashboard-components 0.1.5 → 0.2.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.
Files changed (50) hide show
  1. package/custom-elements.json +1013 -931
  2. package/dist/dashboard-components.js +350 -171
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +48 -57
  5. package/dist/style.css +74 -23
  6. package/package.json +2 -2
  7. package/src/preact/aggregatedData/aggregate.tsx +28 -28
  8. package/src/preact/components/error-boundary.stories.tsx +62 -0
  9. package/src/preact/components/error-boundary.tsx +31 -0
  10. package/src/preact/components/error-display.stories.tsx +24 -3
  11. package/src/preact/components/error-display.tsx +14 -1
  12. package/src/preact/components/loading-display.stories.tsx +6 -6
  13. package/src/preact/components/loading-display.tsx +1 -1
  14. package/src/preact/components/no-data-display.tsx +5 -1
  15. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +17 -0
  16. package/src/preact/dateRangeSelector/date-range-selector.tsx +33 -5
  17. package/src/preact/locationFilter/location-filter.stories.tsx +23 -6
  18. package/src/preact/locationFilter/location-filter.tsx +29 -18
  19. package/src/preact/mutationComparison/mutation-comparison.tsx +29 -25
  20. package/src/preact/mutationFilter/mutation-filter.stories.tsx +17 -2
  21. package/src/preact/mutationFilter/mutation-filter.tsx +25 -7
  22. package/src/preact/mutations/mutations.tsx +23 -23
  23. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +44 -28
  24. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +43 -31
  25. package/src/preact/textInput/text-input.tsx +26 -3
  26. package/src/web-components/app.stories.ts +1 -2
  27. package/src/web-components/app.ts +4 -2
  28. package/src/web-components/index.ts +1 -1
  29. package/src/web-components/input/{date-range-selector-component.stories.ts → gs-date-range-selector.stories.ts} +19 -2
  30. package/src/web-components/input/{date-range-selector-component.tsx → gs-date-range-selector.tsx} +12 -0
  31. package/src/web-components/input/{location-filter-component.stories.ts → gs-location-filter.stories.ts} +29 -4
  32. package/src/web-components/input/{location-filter-component.tsx → gs-location-filter.tsx} +12 -1
  33. package/src/web-components/input/{mutation-filter-component.stories.ts → gs-mutation-filter.stories.ts} +20 -4
  34. package/src/web-components/input/{mutation-filter-component.tsx → gs-mutation-filter.tsx} +36 -5
  35. package/src/web-components/input/{text-input-component.stories.ts → gs-text-input.stories.ts} +31 -3
  36. package/src/web-components/input/{text-input-component.tsx → gs-text-input.tsx} +12 -0
  37. package/src/web-components/input/index.ts +4 -4
  38. package/src/web-components/visualization/data_visualization_statistical_analysis.mdx +26 -0
  39. package/src/web-components/{display/aggregate-component.stories.ts → visualization/gs-aggregate.stories.ts} +5 -6
  40. package/src/web-components/{display/aggregate-component.tsx → visualization/gs-aggregate.tsx} +1 -1
  41. package/src/web-components/{display/mutation-comparison-component.stories.ts → visualization/gs-mutation-comparison.stories.ts} +8 -9
  42. package/src/web-components/{display/mutation-comparison-component.tsx → visualization/gs-mutation-comparison.tsx} +1 -1
  43. package/src/web-components/{display/mutations-component.stories.ts → visualization/gs-mutations.stories.ts} +6 -7
  44. package/src/web-components/{display/mutations-component.tsx → visualization/gs-mutations.tsx} +2 -2
  45. package/src/web-components/{display/prevalence-over-time-component.stories.ts → visualization/gs-prevalence-over-time.stories.ts} +1 -2
  46. package/src/web-components/{display/prevalence-over-time-component.tsx → visualization/gs-prevalence-over-time.tsx} +3 -1
  47. package/src/web-components/{display/relative-growth-advantage-component.stories.ts → visualization/gs-relative-growth-advantage.stories.ts} +1 -2
  48. package/src/web-components/visualization/index.ts +5 -0
  49. package/src/web-components/display/index.ts +0 -5
  50. /package/src/web-components/{display/relative-growth-advantage-component.tsx → visualization/gs-relative-growth-advantage.tsx} +0 -0
@@ -93,7 +93,7 @@ const { is: i$1, defineProperty: e$1, getOwnPropertyDescriptor: r$2, getOwnPrope
93
93
  return i2;
94
94
  } }, f$2 = (t2, s2) => !i$1(t2, s2), y$1 = { attribute: true, type: String, converter: u$2, reflect: false, hasChanged: f$2 };
95
95
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a$1.litPropertyMetadata ?? (a$1.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
96
- class b extends HTMLElement {
96
+ let b$1 = class b extends HTMLElement {
97
97
  static addInitializer(t2) {
98
98
  this._$Ei(), (this.l ?? (this.l = [])).push(t2);
99
99
  }
@@ -303,8 +303,8 @@ class b extends HTMLElement {
303
303
  }
304
304
  firstUpdated(t2) {
305
305
  }
306
- }
307
- b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d$1("elementProperties")] = /* @__PURE__ */ new Map(), b[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1 == null ? void 0 : p$1({ ReactiveElement: b }), (a$1.reactiveElementVersions ?? (a$1.reactiveElementVersions = [])).push("2.0.4");
306
+ };
307
+ b$1.elementStyles = [], b$1.shadowRootOptions = { mode: "open" }, b$1[d$1("elementProperties")] = /* @__PURE__ */ new Map(), b$1[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1 == null ? void 0 : p$1({ ReactiveElement: b$1 }), (a$1.reactiveElementVersions ?? (a$1.reactiveElementVersions = [])).push("2.0.4");
308
308
  /**
309
309
  * @license
310
310
  * Copyright 2017 Google LLC
@@ -492,9 +492,9 @@ let App = class extends LitElement {
492
492
  render() {
493
493
  return this.updateReferenceGenome.render({
494
494
  complete: () => html` <slot></slot>`,
495
- error: () => html`<p>Error</p>`,
496
- // TODO(#143): Add more advanced error handling
497
- pending: () => html` <p>Loading reference genomes...</p> `
495
+ error: () => html` <div class="m-2 w-full alert alert-error">
496
+ Error: Cannot fetch reference genome. Is LAPIS available?
497
+ </div>`
498
498
  });
499
499
  }
500
500
  createRenderRoot() {
@@ -586,6 +586,14 @@ function P(n3) {
586
586
  var u2 = r.context[n3.__c], i2 = h(t++, 9);
587
587
  return i2.c = n3, u2 ? (null == i2.__ && (i2.__ = true, u2.sub(r)), u2.props.value) : n3.__;
588
588
  }
589
+ function b2(n3) {
590
+ var u2 = h(t++, 10), i2 = p();
591
+ return u2.__ = n3, r.componentDidCatch || (r.componentDidCatch = function(n4, t2) {
592
+ u2.__ && u2.__(n4, t2), i2[1](n4);
593
+ }), [i2[0], function() {
594
+ i2[1](void 0);
595
+ }];
596
+ }
589
597
  function j() {
590
598
  for (var n3; n3 = f.shift(); )
591
599
  if (n3.__P && n3.__H)
@@ -850,45 +858,45 @@ const bases = {
850
858
  "-"
851
859
  ]
852
860
  };
853
- const sortSubstitutionsAndDeletions = (a2, b2) => {
854
- if (a2.segment !== b2.segment) {
855
- compareSegments(a2.segment, b2.segment);
861
+ const sortSubstitutionsAndDeletions = (a2, b3) => {
862
+ if (a2.segment !== b3.segment) {
863
+ compareSegments(a2.segment, b3.segment);
856
864
  }
857
- if (a2.position !== b2.position) {
858
- return comparePositions(a2.position, b2.position);
865
+ if (a2.position !== b3.position) {
866
+ return comparePositions(a2.position, b3.position);
859
867
  }
860
868
  const aIsDeletion = a2 instanceof Deletion;
861
- const bIsDeletion = b2 instanceof Deletion;
869
+ const bIsDeletion = b3 instanceof Deletion;
862
870
  if (aIsDeletion !== bIsDeletion) {
863
871
  return aIsDeletion ? 1 : -1;
864
872
  }
865
873
  if (!aIsDeletion && !bIsDeletion) {
866
- if (a2.substitutionValue !== b2.substitutionValue) {
867
- return compareSubstitutionValues(a2.substitutionValue, b2.substitutionValue);
874
+ if (a2.substitutionValue !== b3.substitutionValue) {
875
+ return compareSubstitutionValues(a2.substitutionValue, b3.substitutionValue);
868
876
  }
869
877
  }
870
878
  return 0;
871
879
  };
872
- const compareSegments = (a2, b2) => {
880
+ const compareSegments = (a2, b3) => {
873
881
  if (a2 === void 0) {
874
882
  return -1;
875
883
  }
876
- if (b2 === void 0) {
884
+ if (b3 === void 0) {
877
885
  return 1;
878
886
  }
879
- return a2.localeCompare(b2);
887
+ return a2.localeCompare(b3);
880
888
  };
881
- const comparePositions = (a2, b2) => {
882
- return a2 - b2;
889
+ const comparePositions = (a2, b3) => {
890
+ return a2 - b3;
883
891
  };
884
- const compareSubstitutionValues = (a2, b2) => {
892
+ const compareSubstitutionValues = (a2, b3) => {
885
893
  if (a2 === void 0) {
886
894
  return -1;
887
895
  }
888
- if (b2 === void 0) {
896
+ if (b3 === void 0) {
889
897
  return 1;
890
898
  }
891
- return a2.localeCompare(b2);
899
+ return a2.localeCompare(b3);
892
900
  };
893
901
  const formatProportion = (proportion) => {
894
902
  return `${(proportion * 100).toFixed(2)}%`;
@@ -1081,11 +1089,11 @@ class SortOperator {
1081
1089
  }
1082
1090
  function querySubstitutionsOrDeletions(variant, sequenceType, lapis, signal) {
1083
1091
  const fetchData = new FetchSubstitutionsOrDeletionsOperator(variant, sequenceType, 0);
1084
- const sortData = new SortOperator(fetchData, (a2, b2) => {
1085
- if (a2.mutation.segment !== b2.mutation.segment) {
1086
- return (a2.mutation.segment ?? "").localeCompare(b2.mutation.segment ?? "");
1092
+ const sortData = new SortOperator(fetchData, (a2, b3) => {
1093
+ if (a2.mutation.segment !== b3.mutation.segment) {
1094
+ return (a2.mutation.segment ?? "").localeCompare(b3.mutation.segment ?? "");
1087
1095
  }
1088
- return a2.mutation.position - b2.mutation.position;
1096
+ return a2.mutation.position - b3.mutation.position;
1089
1097
  });
1090
1098
  return sortData.evaluate(lapis, signal);
1091
1099
  }
@@ -1218,12 +1226,28 @@ const CsvDownloadButton = ({
1218
1226
  };
1219
1227
  return /* @__PURE__ */ u$1("button", { className, onClick: download, children: label });
1220
1228
  };
1229
+ class UserFacingError extends Error {
1230
+ constructor(message) {
1231
+ super(message);
1232
+ this.name = "UserFacingError";
1233
+ }
1234
+ }
1221
1235
  const ErrorDisplay = ({ error }) => {
1222
- return /* @__PURE__ */ u$1("div", { children: [
1223
- "Error: ",
1224
- error.message
1236
+ return /* @__PURE__ */ u$1("div", { className: "h-full w-full rounded-md border-2 border-gray-100 p-2 flex items-center justify-center flex-col", children: [
1237
+ /* @__PURE__ */ u$1("div", { className: "text-red-700 font-bold", children: "Error" }),
1238
+ /* @__PURE__ */ u$1("div", { children: "Oops! Something went wrong." }),
1239
+ error instanceof UserFacingError && /* @__PURE__ */ u$1("div", { className: "text-sm text-gray-600", children: error.message })
1225
1240
  ] });
1226
1241
  };
1242
+ const ResizeContainer = ({ children, size, defaultSize }) => {
1243
+ return /* @__PURE__ */ u$1("div", { style: extendByDefault(size, defaultSize), children });
1244
+ };
1245
+ const extendByDefault = (size, defaultSize) => {
1246
+ if (size === void 0) {
1247
+ return defaultSize;
1248
+ }
1249
+ return { ...defaultSize, ...size };
1250
+ };
1227
1251
  const Headline = ({ heading, children }) => {
1228
1252
  if (!heading) {
1229
1253
  return /* @__PURE__ */ u$1(Fragment, { children });
@@ -1244,6 +1268,21 @@ const ResizingHeadline = ({ heading, children }) => {
1244
1268
  /* @__PURE__ */ u$1("div", { style: { height: `calc(100% - ${h1Height})` }, children })
1245
1269
  ] });
1246
1270
  };
1271
+ const ErrorBoundary = ({
1272
+ size,
1273
+ defaultSize,
1274
+ headline,
1275
+ children
1276
+ }) => {
1277
+ const [internalError] = b2();
1278
+ if (internalError) {
1279
+ console.error(internalError);
1280
+ }
1281
+ if (internalError) {
1282
+ return /* @__PURE__ */ u$1(ResizeContainer, { defaultSize, size, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(ErrorDisplay, { error: internalError }) }) });
1283
+ }
1284
+ return /* @__PURE__ */ u$1(Fragment, { children });
1285
+ };
1247
1286
  const Info = ({ children, size }) => {
1248
1287
  const [showHelp, setShowHelp] = p(false);
1249
1288
  const toggleHelp = () => {
@@ -1277,7 +1316,7 @@ const InfoLink = ({ children, href }) => {
1277
1316
  return /* @__PURE__ */ u$1("a", { className: "text-blue-600 hover:text-blue-800", href, target: "_blank", rel: "noopener noreferrer", children });
1278
1317
  };
1279
1318
  const LoadingDisplay = () => {
1280
- return /* @__PURE__ */ u$1("div", { children: "Loading..." });
1319
+ return /* @__PURE__ */ u$1("div", { "aria-label": "Loading", className: "h-full w-full skeleton" });
1281
1320
  };
1282
1321
  const MutationTypeSelector = ({
1283
1322
  displayedMutationTypes,
@@ -1296,7 +1335,7 @@ const MutationTypeSelector = ({
1296
1335
  );
1297
1336
  };
1298
1337
  const NoDataDisplay = () => {
1299
- return /* @__PURE__ */ u$1("div", { children: "No data available." });
1338
+ return /* @__PURE__ */ u$1("div", { className: "h-full w-full rounded-md border-2 border-gray-100 p-2 flex items-center justify-center", children: /* @__PURE__ */ u$1("div", { children: "No data available." }) });
1300
1339
  };
1301
1340
  const MinMaxRangeSlider = ({
1302
1341
  min,
@@ -1466,15 +1505,6 @@ const ProportionSelectorDropdown = ({
1466
1505
  ) }) })
1467
1506
  ] });
1468
1507
  };
1469
- const ResizeContainer = ({ children, size, defaultSize }) => {
1470
- return /* @__PURE__ */ u$1("div", { style: extendByDefault(size, defaultSize), children });
1471
- };
1472
- const extendByDefault = (size, defaultSize) => {
1473
- if (size === void 0) {
1474
- return defaultSize;
1475
- }
1476
- return { ...defaultSize, ...size };
1477
- };
1478
1508
  const Tabs = ({ tabs, toolbar }) => {
1479
1509
  const [activeTab, setActiveTab] = p(tabs[0].title);
1480
1510
  const [heightOfTabs, setHeightOfTabs] = p("3rem");
@@ -1540,21 +1570,29 @@ const MutationComparison = ({
1540
1570
  views,
1541
1571
  size,
1542
1572
  headline = "Mutation comparison"
1573
+ }) => {
1574
+ const defaultSize = { height: "600px", width: "100%" };
1575
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, defaultSize, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationComparisonInner, { variants, sequenceType, views }) }) }) });
1576
+ };
1577
+ const MutationComparisonInner = ({
1578
+ variants,
1579
+ sequenceType,
1580
+ views
1543
1581
  }) => {
1544
1582
  const lapis = P(LapisUrlContext);
1545
1583
  const { data, error, isLoading } = useQuery(async () => {
1546
1584
  return queryMutationData(variants, sequenceType, lapis);
1547
1585
  }, [variants, sequenceType, lapis]);
1548
1586
  if (isLoading) {
1549
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
1587
+ return /* @__PURE__ */ u$1(LoadingDisplay, {});
1550
1588
  }
1551
1589
  if (error !== null) {
1552
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(ErrorDisplay, { error }) });
1590
+ return /* @__PURE__ */ u$1(ErrorDisplay, { error });
1553
1591
  }
1554
1592
  if (data === null) {
1555
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
1593
+ return /* @__PURE__ */ u$1(NoDataDisplay, {});
1556
1594
  }
1557
- return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationComparisonTabs, { data: data.mutationData, sequenceType, views }) }) });
1595
+ return /* @__PURE__ */ u$1(MutationComparisonTabs, { data: data.mutationData, sequenceType, views });
1558
1596
  };
1559
1597
  const MutationComparisonTabs = ({ data, views, sequenceType }) => {
1560
1598
  const [proportionInterval, setProportionInterval] = p({ min: 0.5, max: 1 });
@@ -2285,6 +2323,35 @@ html {
2285
2323
  max-width: 1536px;
2286
2324
  }
2287
2325
  }
2326
+ .alert {
2327
+ display: grid;
2328
+ width: 100%;
2329
+ grid-auto-flow: row;
2330
+ align-content: flex-start;
2331
+ align-items: center;
2332
+ justify-items: center;
2333
+ gap: 1rem;
2334
+ text-align: center;
2335
+ border-radius: var(--rounded-box, 1rem);
2336
+ border-width: 1px;
2337
+ --tw-border-opacity: 1;
2338
+ border-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));
2339
+ padding: 1rem;
2340
+ --tw-text-opacity: 1;
2341
+ color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
2342
+ --alert-bg: var(--fallback-b2,oklch(var(--b2)/1));
2343
+ --alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1));
2344
+ background-color: var(--alert-bg);
2345
+ }
2346
+ @media (min-width: 640px) {
2347
+
2348
+ .alert {
2349
+ grid-auto-flow: column;
2350
+ grid-template-columns: auto minmax(auto,1fr);
2351
+ justify-items: start;
2352
+ text-align: start;
2353
+ }
2354
+ }
2288
2355
  .avatar.placeholder > div {
2289
2356
  display: flex;
2290
2357
  align-items: center;
@@ -2793,29 +2860,6 @@ html {
2793
2860
  .select[multiple] {
2794
2861
  height: auto;
2795
2862
  }
2796
- .stack {
2797
- display: inline-grid;
2798
- place-items: center;
2799
- align-items: flex-end;
2800
- }
2801
- .stack > * {
2802
- grid-column-start: 1;
2803
- grid-row-start: 1;
2804
- transform: translateY(10%) scale(0.9);
2805
- z-index: 1;
2806
- width: 100%;
2807
- opacity: 0.6;
2808
- }
2809
- .stack > *:nth-child(2) {
2810
- transform: translateY(5%) scale(0.95);
2811
- z-index: 2;
2812
- opacity: 0.8;
2813
- }
2814
- .stack > *:nth-child(1) {
2815
- transform: translateY(0) scale(1);
2816
- z-index: 3;
2817
- opacity: 1;
2818
- }
2819
2863
  .steps {
2820
2864
  display: inline-grid;
2821
2865
  grid-auto-flow: column;
@@ -2915,6 +2959,13 @@ input.tab:checked + .tab-content,
2915
2959
  --tw-bg-opacity: 1;
2916
2960
  background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
2917
2961
  }
2962
+ .alert-error {
2963
+ border-color: var(--fallback-er,oklch(var(--er)/0.2));
2964
+ --tw-text-opacity: 1;
2965
+ color: var(--fallback-erc,oklch(var(--erc)/var(--tw-text-opacity)));
2966
+ --alert-bg: var(--fallback-er,oklch(var(--er)/1));
2967
+ --alert-bg-mix: var(--fallback-b1,oklch(var(--b1)/1));
2968
+ }
2918
2969
  .btm-nav > *.disabled,
2919
2970
  .btm-nav > *[disabled] {
2920
2971
  pointer-events: none;
@@ -3463,6 +3514,30 @@ input.tab:checked + .tab-content,
3463
3514
  background-position: calc(0% + 12px) calc(1px + 50%),
3464
3515
  calc(0% + 16px) calc(1px + 50%);
3465
3516
  }
3517
+ .skeleton {
3518
+ border-radius: var(--rounded-box, 1rem);
3519
+ --tw-bg-opacity: 1;
3520
+ background-color: var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)));
3521
+ will-change: background-position;
3522
+ animation: skeleton 1.8s ease-in-out infinite;
3523
+ background-image: linear-gradient(
3524
+ 105deg,
3525
+ transparent 0%,
3526
+ transparent 40%,
3527
+ var(--fallback-b1,oklch(var(--b1)/1)) 50%,
3528
+ transparent 60%,
3529
+ transparent 100%
3530
+ );
3531
+ background-size: 200% auto;
3532
+ background-repeat: no-repeat;
3533
+ background-position-x: -50%;
3534
+ }
3535
+ @media (prefers-reduced-motion) {
3536
+
3537
+ .skeleton {
3538
+ animation-duration: 15s;
3539
+ }
3540
+ }
3466
3541
  @keyframes skeleton {
3467
3542
 
3468
3543
  from {
@@ -4088,6 +4163,10 @@ input.tab:checked + .tab-content,
4088
4163
  .min-w-0 {
4089
4164
  min-width: 0px;
4090
4165
  }
4166
+ .min-w-max {
4167
+ min-width: -moz-max-content;
4168
+ min-width: max-content;
4169
+ }
4091
4170
  .max-w-screen-lg {
4092
4171
  max-width: 1024px;
4093
4172
  }
@@ -4130,6 +4209,9 @@ input.tab:checked + .tab-content,
4130
4209
  .overflow-auto {
4131
4210
  overflow: auto;
4132
4211
  }
4212
+ .overflow-scroll {
4213
+ overflow: scroll;
4214
+ }
4133
4215
  .whitespace-nowrap {
4134
4216
  white-space: nowrap;
4135
4217
  }
@@ -4148,6 +4230,9 @@ input.tab:checked + .tab-content,
4148
4230
  .rounded-lg {
4149
4231
  border-radius: 0.5rem;
4150
4232
  }
4233
+ .rounded-md {
4234
+ border-radius: 0.375rem;
4235
+ }
4151
4236
  .rounded-none {
4152
4237
  border-radius: 0px;
4153
4238
  }
@@ -4273,6 +4358,10 @@ input.tab:checked + .tab-content,
4273
4358
  --tw-text-opacity: 1;
4274
4359
  color: rgb(75 85 99 / var(--tw-text-opacity));
4275
4360
  }
4361
+ .text-red-700 {
4362
+ --tw-text-opacity: 1;
4363
+ color: rgb(185 28 28 / var(--tw-text-opacity));
4364
+ }
4276
4365
  .underline {
4277
4366
  text-decoration-line: underline;
4278
4367
  }
@@ -4403,7 +4492,7 @@ __decorateClass$8([
4403
4492
  n2({ type: String })
4404
4493
  ], MutationComparisonComponent.prototype, "headline", 2);
4405
4494
  MutationComparisonComponent = __decorateClass$8([
4406
- t$2("gs-mutation-comparison-component")
4495
+ t$2("gs-mutation-comparison")
4407
4496
  ], MutationComparisonComponent);
4408
4497
  function getInsertionsTableData(data) {
4409
4498
  return data.map((mutationEntry) => {
@@ -4427,16 +4516,16 @@ function getMutationsTableData(data, proportionInterval) {
4427
4516
  });
4428
4517
  }
4429
4518
  const pattern = /(?:([A-Za-z0-9]+):)?(\d+)$/;
4430
- const sortMutationPositions = (a2, b2) => {
4519
+ const sortMutationPositions = (a2, b3) => {
4431
4520
  const aMatch = a2.match(pattern);
4432
- const bMatch = b2.match(pattern);
4521
+ const bMatch = b3.match(pattern);
4433
4522
  if (aMatch && bMatch) {
4434
4523
  if (aMatch[1] !== bMatch[1]) {
4435
4524
  return aMatch[1].localeCompare(bMatch[1]);
4436
4525
  }
4437
4526
  return parseInt(aMatch[2], 10) - parseInt(bMatch[2], 10);
4438
4527
  }
4439
- throw new Error(`Invalid mutation position: ${a2} or ${b2}`);
4528
+ throw new Error(`Invalid mutation position: ${a2} or ${b3}`);
4440
4529
  };
4441
4530
  const getMutationsGridData = (data, sequenceType, proportionInterval) => {
4442
4531
  return accumulateByPosition(data, sequenceType).filter((row) => byProportion(row, proportionInterval));
@@ -4468,8 +4557,8 @@ const accumulateByPosition = (data, sequenceType) => {
4468
4557
  };
4469
4558
  subtractSubstitutionValue();
4470
4559
  }
4471
- const orderedPositionsToProportionAtBase = [...positionsToProportionAtBase.entries()].map(([position, proportionsAtBase]) => ({ position, proportions: proportionsAtBase })).sort((a2, b2) => {
4472
- return sortMutationPositions(a2.position, b2.position);
4560
+ const orderedPositionsToProportionAtBase = [...positionsToProportionAtBase.entries()].map(([position, proportionsAtBase]) => ({ position, proportions: proportionsAtBase })).sort((a2, b3) => {
4561
+ return sortMutationPositions(a2.position, b3.position);
4473
4562
  });
4474
4563
  return orderedPositionsToProportionAtBase.map((proportionsForBaseAtPosition) => {
4475
4564
  const proportions = bases[sequenceType].map((base) => {
@@ -4500,8 +4589,8 @@ const MutationsGrid = ({ data, sequenceType, proportionInterval }) => {
4500
4589
  {
4501
4590
  name: "Position",
4502
4591
  sort: {
4503
- compare: (a2, b2) => {
4504
- return sortMutationPositions(a2, b2);
4592
+ compare: (a2, b3) => {
4593
+ return sortMutationPositions(a2, b3);
4505
4594
  }
4506
4595
  }
4507
4596
  },
@@ -4513,9 +4602,9 @@ const MutationsGrid = ({ data, sequenceType, proportionInterval }) => {
4513
4602
  return {
4514
4603
  name: base,
4515
4604
  sort: {
4516
- compare: (a2, b2) => {
4605
+ compare: (a2, b3) => {
4517
4606
  const aProportion = a2.proportion;
4518
- const bProportion = b2.proportion;
4607
+ const bProportion = b3.proportion;
4519
4608
  if (aProportion < bProportion) {
4520
4609
  return -1;
4521
4610
  }
@@ -4549,14 +4638,14 @@ const MutationsGrid = ({ data, sequenceType, proportionInterval }) => {
4549
4638
  const tableData = getMutationsGridData(data, sequenceType, proportionInterval).map((row) => Object.values(row));
4550
4639
  return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(), pagination: true });
4551
4640
  };
4552
- const sortInsertions = (a2, b2) => {
4553
- if (a2.segment !== b2.segment) {
4554
- return compareSegments(a2.segment, b2.segment);
4641
+ const sortInsertions = (a2, b3) => {
4642
+ if (a2.segment !== b3.segment) {
4643
+ return compareSegments(a2.segment, b3.segment);
4555
4644
  }
4556
- if (a2.position !== b2.position) {
4557
- return comparePositions(a2.position, b2.position);
4645
+ if (a2.position !== b3.position) {
4646
+ return comparePositions(a2.position, b3.position);
4558
4647
  }
4559
- return a2.insertedSymbols.localeCompare(b2.insertedSymbols);
4648
+ return a2.insertedSymbols.localeCompare(b3.insertedSymbols);
4560
4649
  };
4561
4650
  const InsertionsTable = ({ data }) => {
4562
4651
  const getHeaders = () => {
@@ -4564,8 +4653,8 @@ const InsertionsTable = ({ data }) => {
4564
4653
  {
4565
4654
  name: "Insertion",
4566
4655
  sort: {
4567
- compare: (a2, b2) => {
4568
- return sortInsertions(a2, b2);
4656
+ compare: (a2, b3) => {
4657
+ return sortInsertions(a2, b3);
4569
4658
  }
4570
4659
  },
4571
4660
  formatter: (cell) => cell.toString()
@@ -4585,8 +4674,8 @@ const MutationsTable = ({ data, proportionInterval }) => {
4585
4674
  {
4586
4675
  name: "Mutation",
4587
4676
  sort: {
4588
- compare: (a2, b2) => {
4589
- return sortSubstitutionsAndDeletions(a2, b2);
4677
+ compare: (a2, b3) => {
4678
+ return sortSubstitutionsAndDeletions(a2, b3);
4590
4679
  }
4591
4680
  },
4592
4681
  formatter: (cell) => cell.toString()
@@ -4626,11 +4715,11 @@ class FetchInsertionsOperator {
4626
4715
  }
4627
4716
  function queryInsertions(variant, sequenceType, lapis, signal) {
4628
4717
  const fetchData = new FetchInsertionsOperator(variant, sequenceType);
4629
- const sortData = new SortOperator(fetchData, (a2, b2) => {
4630
- if (a2.mutation.segment !== b2.mutation.segment) {
4631
- return (a2.mutation.segment ?? "").localeCompare(b2.mutation.segment ?? "");
4718
+ const sortData = new SortOperator(fetchData, (a2, b3) => {
4719
+ if (a2.mutation.segment !== b3.mutation.segment) {
4720
+ return (a2.mutation.segment ?? "").localeCompare(b3.mutation.segment ?? "");
4632
4721
  }
4633
- return a2.mutation.position - b2.mutation.position;
4722
+ return a2.mutation.position - b3.mutation.position;
4634
4723
  });
4635
4724
  return sortData.evaluate(lapis, signal);
4636
4725
  }
@@ -4670,20 +4759,24 @@ const Mutations = ({
4670
4759
  size,
4671
4760
  headline = "Mutations"
4672
4761
  }) => {
4762
+ const defaultSize = { height: "600px", width: "100%" };
4763
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, defaultSize, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsInner, { variant, sequenceType, views }) }) }) });
4764
+ };
4765
+ const MutationsInner = ({ variant, sequenceType, views }) => {
4673
4766
  const lapis = P(LapisUrlContext);
4674
4767
  const { data, error, isLoading } = useQuery(async () => {
4675
4768
  return queryMutationsData(variant, sequenceType, lapis);
4676
4769
  }, [variant, sequenceType, lapis]);
4677
4770
  if (isLoading) {
4678
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
4771
+ return /* @__PURE__ */ u$1(LoadingDisplay, {});
4679
4772
  }
4680
4773
  if (error !== null) {
4681
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(ErrorDisplay, { error }) });
4774
+ return /* @__PURE__ */ u$1(ErrorDisplay, { error });
4682
4775
  }
4683
4776
  if (data === null) {
4684
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
4777
+ return /* @__PURE__ */ u$1(NoDataDisplay, {});
4685
4778
  }
4686
- return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data, sequenceType, views }) }) });
4779
+ return /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data, sequenceType, views });
4687
4780
  };
4688
4781
  const MutationsTabs = ({ mutationsData, sequenceType, views }) => {
4689
4782
  const [proportionInterval, setProportionInterval] = p({ min: 0.05, max: 1 });
@@ -4803,7 +4896,7 @@ var __decorateClass$7 = (decorators, target, key, kind) => {
4803
4896
  let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
4804
4897
  constructor() {
4805
4898
  super(...arguments);
4806
- this.variant = { displayName: "" };
4899
+ this.variant = {};
4807
4900
  this.sequenceType = "nucleotide";
4808
4901
  this.views = ["table", "grid"];
4809
4902
  this.size = void 0;
@@ -4838,7 +4931,7 @@ __decorateClass$7([
4838
4931
  n2({ type: String })
4839
4932
  ], MutationsComponent.prototype, "headline", 2);
4840
4933
  MutationsComponent = __decorateClass$7([
4841
- t$2("gs-mutations-component")
4934
+ t$2("gs-mutations")
4842
4935
  ], MutationsComponent);
4843
4936
  function getPrevalenceOverTimeTableData(data, granularity) {
4844
4937
  return data[0].content.map((row, rowNumber) => {
@@ -5055,14 +5148,14 @@ var padZoneStr = function padZoneStr2(instance) {
5055
5148
  var minuteOffset = minutes % 60;
5056
5149
  return (negMinutes <= 0 ? "+" : "-") + padStart(hourOffset, 2, "0") + ":" + padStart(minuteOffset, 2, "0");
5057
5150
  };
5058
- var monthDiff = function monthDiff2(a2, b2) {
5059
- if (a2.date() < b2.date())
5060
- return -monthDiff2(b2, a2);
5061
- var wholeMonthDiff = (b2.year() - a2.year()) * 12 + (b2.month() - a2.month());
5151
+ var monthDiff = function monthDiff2(a2, b3) {
5152
+ if (a2.date() < b3.date())
5153
+ return -monthDiff2(b3, a2);
5154
+ var wholeMonthDiff = (b3.year() - a2.year()) * 12 + (b3.month() - a2.month());
5062
5155
  var anchor = a2.clone().add(wholeMonthDiff, M);
5063
- var c2 = b2 - anchor < 0;
5156
+ var c2 = b3 - anchor < 0;
5064
5157
  var anchor2 = a2.clone().add(wholeMonthDiff + (c2 ? -1 : 1), M);
5065
- return +(-(wholeMonthDiff + (b2 - anchor) / (c2 ? anchor - anchor2 : anchor2 - anchor)) || 0);
5158
+ return +(-(wholeMonthDiff + (b3 - anchor) / (c2 ? anchor - anchor2 : anchor2 - anchor)) || 0);
5066
5159
  };
5067
5160
  var absFloor = function absFloor2(n3) {
5068
5161
  return n3 < 0 ? Math.ceil(n3) || 0 : Math.floor(n3);
@@ -5796,29 +5889,29 @@ function generateAllInRange(start, end) {
5796
5889
  }
5797
5890
  throw new Error(`Invalid arguments: start and end must be of the same type: ${start}, ${end}`);
5798
5891
  }
5799
- function minusTemporal(a2, b2) {
5800
- if (a2 instanceof YearMonthDay && b2 instanceof YearMonthDay) {
5801
- return a2.minus(b2);
5892
+ function minusTemporal(a2, b3) {
5893
+ if (a2 instanceof YearMonthDay && b3 instanceof YearMonthDay) {
5894
+ return a2.minus(b3);
5802
5895
  }
5803
- if (a2 instanceof YearWeek && b2 instanceof YearWeek) {
5804
- return a2.minus(b2);
5896
+ if (a2 instanceof YearWeek && b3 instanceof YearWeek) {
5897
+ return a2.minus(b3);
5805
5898
  }
5806
- if (a2 instanceof YearMonth && b2 instanceof YearMonth) {
5807
- return a2.minus(b2);
5899
+ if (a2 instanceof YearMonth && b3 instanceof YearMonth) {
5900
+ return a2.minus(b3);
5808
5901
  }
5809
- if (a2 instanceof Year && b2 instanceof Year) {
5810
- return a2.minus(b2);
5902
+ if (a2 instanceof Year && b3 instanceof Year) {
5903
+ return a2.minus(b3);
5811
5904
  }
5812
- throw new Error(`Cannot compare ${a2} and ${b2}`);
5905
+ throw new Error(`Cannot compare ${a2} and ${b3}`);
5813
5906
  }
5814
- function compareTemporal(a2, b2) {
5907
+ function compareTemporal(a2, b3) {
5815
5908
  if (a2 === null) {
5816
5909
  return 1;
5817
5910
  }
5818
- if (b2 === null) {
5911
+ if (b3 === null) {
5819
5912
  return -1;
5820
5913
  }
5821
- const diff = minusTemporal(a2, b2);
5914
+ const diff = minusTemporal(a2, b3);
5822
5915
  if (diff < 0) {
5823
5916
  return -1;
5824
5917
  }
@@ -6297,14 +6390,14 @@ function mapDateToGranularityRange(d2, granularity) {
6297
6390
  count: d2.count
6298
6391
  };
6299
6392
  }
6300
- function dateRangeCompare(a2, b2) {
6393
+ function dateRangeCompare(a2, b3) {
6301
6394
  if (a2.dateRange === null) {
6302
6395
  return 1;
6303
6396
  }
6304
- if (b2.dateRange === null) {
6397
+ if (b3.dateRange === null) {
6305
6398
  return -1;
6306
6399
  }
6307
- return compareTemporal(a2.dateRange, b2.dateRange);
6400
+ return compareTemporal(a2.dateRange, b3.dateRange);
6308
6401
  }
6309
6402
  function averageSmoothing(slidingWindow) {
6310
6403
  const average = slidingWindow.reduce((acc, curr) => acc + curr.count, 0) / slidingWindow.length;
@@ -6381,6 +6474,27 @@ const PrevalenceOverTime = ({
6381
6474
  confidenceIntervalMethods,
6382
6475
  size,
6383
6476
  headline = "Prevalence over time"
6477
+ }) => {
6478
+ const defaultSize = { height: "600px", width: "100%" };
6479
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, defaultSize, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6480
+ PrevalenceOverTimeInner,
6481
+ {
6482
+ numerator,
6483
+ denominator,
6484
+ granularity,
6485
+ smoothingWindow,
6486
+ views,
6487
+ confidenceIntervalMethods
6488
+ }
6489
+ ) }) }) });
6490
+ };
6491
+ const PrevalenceOverTimeInner = ({
6492
+ numerator,
6493
+ denominator,
6494
+ granularity,
6495
+ smoothingWindow,
6496
+ views,
6497
+ confidenceIntervalMethods
6384
6498
  }) => {
6385
6499
  const lapis = P(LapisUrlContext);
6386
6500
  const { data, error, isLoading } = useQuery(
@@ -6388,15 +6502,15 @@ const PrevalenceOverTime = ({
6388
6502
  [lapis, numerator, denominator, granularity, smoothingWindow]
6389
6503
  );
6390
6504
  if (isLoading) {
6391
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
6505
+ return /* @__PURE__ */ u$1(LoadingDisplay, {});
6392
6506
  }
6393
6507
  if (error !== null) {
6394
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(ErrorDisplay, { error }) });
6508
+ return /* @__PURE__ */ u$1(ErrorDisplay, { error });
6395
6509
  }
6396
6510
  if (data === null) {
6397
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
6511
+ return /* @__PURE__ */ u$1(NoDataDisplay, {});
6398
6512
  }
6399
- return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "600px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6513
+ return /* @__PURE__ */ u$1(
6400
6514
  PrevalenceOverTimeTabs,
6401
6515
  {
6402
6516
  views,
@@ -6404,7 +6518,7 @@ const PrevalenceOverTime = ({
6404
6518
  granularity,
6405
6519
  confidenceIntervalMethods
6406
6520
  }
6407
- ) }) });
6521
+ );
6408
6522
  };
6409
6523
  const PrevalenceOverTimeTabs = ({
6410
6524
  views,
@@ -6759,12 +6873,29 @@ function toYearMonthDay(d2) {
6759
6873
  };
6760
6874
  }
6761
6875
  const RelativeGrowthAdvantage = ({
6876
+ views,
6877
+ size,
6762
6878
  numerator,
6763
6879
  denominator,
6764
6880
  generationTime,
6765
- views,
6766
- size,
6767
6881
  headline = "Relative growth advantage"
6882
+ }) => {
6883
+ const defaultSize = { height: "600px", width: "100%" };
6884
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, defaultSize, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6885
+ RelativeGrowthAdvantageInner,
6886
+ {
6887
+ views,
6888
+ numerator,
6889
+ denominator,
6890
+ generationTime
6891
+ }
6892
+ ) }) }) });
6893
+ };
6894
+ const RelativeGrowthAdvantageInner = ({
6895
+ numerator,
6896
+ denominator,
6897
+ generationTime,
6898
+ views
6768
6899
  }) => {
6769
6900
  const lapis = P(LapisUrlContext);
6770
6901
  const [yAxisScaleType, setYAxisScaleType] = p("linear");
@@ -6773,15 +6904,15 @@ const RelativeGrowthAdvantage = ({
6773
6904
  [lapis, numerator, denominator, generationTime, views]
6774
6905
  );
6775
6906
  if (isLoading) {
6776
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
6907
+ return /* @__PURE__ */ u$1(LoadingDisplay, {});
6777
6908
  }
6778
6909
  if (error !== null) {
6779
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(ErrorDisplay, { error }) });
6910
+ return /* @__PURE__ */ u$1(ErrorDisplay, { error });
6780
6911
  }
6781
6912
  if (data === null) {
6782
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
6913
+ return /* @__PURE__ */ u$1(NoDataDisplay, {});
6783
6914
  }
6784
- return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
6915
+ return /* @__PURE__ */ u$1(
6785
6916
  RelativeGrowthAdvantageTabs,
6786
6917
  {
6787
6918
  data,
@@ -6790,7 +6921,7 @@ const RelativeGrowthAdvantage = ({
6790
6921
  views,
6791
6922
  generationTime
6792
6923
  }
6793
- ) }) });
6924
+ );
6794
6925
  };
6795
6926
  const RelativeGrowthAdvantageTabs = ({
6796
6927
  data,
@@ -6948,26 +7079,30 @@ async function queryAggregateData(variant, fields, lapis, signal) {
6948
7079
  );
6949
7080
  }
6950
7081
  const Aggregate = ({
6951
- fields,
6952
7082
  views,
6953
- filter,
6954
7083
  size,
6955
- headline = "Aggregate"
7084
+ headline = "Mutations",
7085
+ filter,
7086
+ fields
6956
7087
  }) => {
7088
+ const defaultSize = { height: "600px", width: "100%" };
7089
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, defaultSize, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(AggregateInner, { fields, filter, views }) }) }) });
7090
+ };
7091
+ const AggregateInner = ({ fields, views, filter }) => {
6957
7092
  const lapis = P(LapisUrlContext);
6958
7093
  const { data, error, isLoading } = useQuery(async () => {
6959
7094
  return queryAggregateData(filter, fields, lapis);
6960
7095
  }, [filter, fields, lapis]);
6961
7096
  if (isLoading) {
6962
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(LoadingDisplay, {}) });
7097
+ return /* @__PURE__ */ u$1(LoadingDisplay, {});
6963
7098
  }
6964
7099
  if (error !== null) {
6965
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(ErrorDisplay, { error }) });
7100
+ return /* @__PURE__ */ u$1(ErrorDisplay, { error });
6966
7101
  }
6967
7102
  if (data === null) {
6968
- return /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(NoDataDisplay, {}) });
7103
+ return /* @__PURE__ */ u$1(NoDataDisplay, {});
6969
7104
  }
6970
- return /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize: { height: "700px", width: "100%" }, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(AggregatedDataTabs, { data, views, fields }) }) });
7105
+ return /* @__PURE__ */ u$1(AggregatedDataTabs, { data, views, fields });
6971
7106
  };
6972
7107
  const AggregatedDataTabs = ({ data, views, fields }) => {
6973
7108
  const getTab = (view) => {
@@ -7037,7 +7172,7 @@ __decorateClass$4([
7037
7172
  n2({ type: String })
7038
7173
  ], AggregateComponent.prototype, "headline", 2);
7039
7174
  AggregateComponent = __decorateClass$4([
7040
- t$2("gs-aggregate-component")
7175
+ t$2("gs-aggregate")
7041
7176
  ], AggregateComponent);
7042
7177
  const toYYYYMMDD = (date) => {
7043
7178
  if (!date) {
@@ -7063,6 +7198,23 @@ const presets = {
7063
7198
  [PRESET_VALUE_LAST_6_MONTHS]: { label: "Last 6 months" }
7064
7199
  };
7065
7200
  const DateRangeSelector = ({
7201
+ customSelectOptions,
7202
+ earliestDate = "1900-01-01",
7203
+ initialValue,
7204
+ width
7205
+ }) => {
7206
+ const defaultSize = { width: "100%", height: "3rem" };
7207
+ const size = width === void 0 ? void 0 : { width, height: defaultSize.height };
7208
+ return /* @__PURE__ */ u$1(ErrorBoundary, { defaultSize, size, children: /* @__PURE__ */ u$1(ResizeContainer, { defaultSize, size, children: /* @__PURE__ */ u$1(
7209
+ DateRangeSelectorInner,
7210
+ {
7211
+ customSelectOptions,
7212
+ earliestDate,
7213
+ initialValue
7214
+ }
7215
+ ) }) });
7216
+ };
7217
+ const DateRangeSelectorInner = ({
7066
7218
  customSelectOptions,
7067
7219
  earliestDate = "1900-01-01",
7068
7220
  initialValue
@@ -7153,13 +7305,13 @@ const DateRangeSelector = ({
7153
7305
  })
7154
7306
  );
7155
7307
  };
7156
- return /* @__PURE__ */ u$1("div", { class: "join", ref: divRef, children: [
7308
+ return /* @__PURE__ */ u$1("div", { class: "join w-full", ref: divRef, children: [
7157
7309
  /* @__PURE__ */ u$1(
7158
7310
  Select,
7159
7311
  {
7160
7312
  items: selectableOptions,
7161
7313
  selected: selectedDateRange,
7162
- selectStyle: "select-bordered rounded-none join-item",
7314
+ selectStyle: "select-bordered rounded-none join-item grow",
7163
7315
  onChange: (event) => {
7164
7316
  event.preventDefault();
7165
7317
  const select = event.target;
@@ -7171,7 +7323,7 @@ const DateRangeSelector = ({
7171
7323
  /* @__PURE__ */ u$1(
7172
7324
  "input",
7173
7325
  {
7174
- class: "input input-bordered rounded-none join-item",
7326
+ class: "input input-bordered rounded-none join-item grow",
7175
7327
  type: "text",
7176
7328
  placeholder: "Date from",
7177
7329
  ref: fromDatePickerRef,
@@ -7182,7 +7334,7 @@ const DateRangeSelector = ({
7182
7334
  /* @__PURE__ */ u$1(
7183
7335
  "input",
7184
7336
  {
7185
- class: "input input-bordered rounded-none join-item",
7337
+ class: "input input-bordered rounded-none join-item grow",
7186
7338
  type: "text",
7187
7339
  placeholder: "Date to",
7188
7340
  ref: toDatePickerRef,
@@ -7257,6 +7409,7 @@ let DateRangeSelectorComponent = class extends PreactLitAdapter {
7257
7409
  this.customSelectOptions = [];
7258
7410
  this.earliestDate = "1900-01-01";
7259
7411
  this.initialValue = "last6Months";
7412
+ this.width = void 0;
7260
7413
  }
7261
7414
  render() {
7262
7415
  return /* @__PURE__ */ u$1(
@@ -7264,7 +7417,8 @@ let DateRangeSelectorComponent = class extends PreactLitAdapter {
7264
7417
  {
7265
7418
  customSelectOptions: this.customSelectOptions,
7266
7419
  earliestDate: this.earliestDate,
7267
- initialValue: this.initialValue
7420
+ initialValue: this.initialValue,
7421
+ width: this.width
7268
7422
  }
7269
7423
  );
7270
7424
  }
@@ -7278,6 +7432,9 @@ __decorateClass$3([
7278
7432
  __decorateClass$3([
7279
7433
  n2()
7280
7434
  ], DateRangeSelectorComponent.prototype, "initialValue", 2);
7435
+ __decorateClass$3([
7436
+ n2({ type: Object })
7437
+ ], DateRangeSelectorComponent.prototype, "width", 2);
7281
7438
  DateRangeSelectorComponent = __decorateClass$3([
7282
7439
  t$2("gs-date-range-selector")
7283
7440
  ], DateRangeSelectorComponent);
@@ -7295,10 +7452,10 @@ async function fetchAutocompletionList(fields, lapis, signal) {
7295
7452
  return [...locationValues].map((json) => JSON.parse(json)).sort(compareLocationEntries(fields));
7296
7453
  }
7297
7454
  function compareLocationEntries(fields) {
7298
- return (a2, b2) => {
7455
+ return (a2, b3) => {
7299
7456
  for (const field of fields) {
7300
7457
  const valueA = a2[field];
7301
- const valueB = b2[field];
7458
+ const valueB = b3[field];
7302
7459
  if (valueA === valueB) {
7303
7460
  continue;
7304
7461
  }
@@ -7313,26 +7470,22 @@ function compareLocationEntries(fields) {
7313
7470
  return 0;
7314
7471
  };
7315
7472
  }
7316
- const LocationFilter = ({ initialValue, fields }) => {
7473
+ const LocationFilter = ({ width, initialValue, fields }) => {
7474
+ const defaultSize = { width: "100%", height: "3rem" };
7475
+ const size = width === void 0 ? void 0 : { width, height: defaultSize.height };
7476
+ return /* @__PURE__ */ u$1(ErrorBoundary, { defaultSize, size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(LocationFilterInner, { initialValue, fields }) }) });
7477
+ };
7478
+ const LocationFilterInner = ({ initialValue, fields }) => {
7317
7479
  const lapis = P(LapisUrlContext);
7318
7480
  const [value, setValue] = p(initialValue ?? "");
7319
7481
  const [unknownLocation, setUnknownLocation] = p(false);
7320
7482
  const formRef = F(null);
7321
7483
  const { data, error, isLoading } = useQuery(() => fetchAutocompletionList(fields, lapis), [fields, lapis]);
7322
- if (isLoading)
7323
- return /* @__PURE__ */ u$1("form", { class: "flex", children: [
7324
- /* @__PURE__ */ u$1("input", { type: "text", class: "input input-bordered grow", value, disabled: true }),
7325
- /* @__PURE__ */ u$1("button", { class: "btn ml-1", disabled: true, type: "submit", children: "Loading..." })
7326
- ] });
7484
+ if (isLoading) {
7485
+ return /* @__PURE__ */ u$1(LoadingDisplay, {});
7486
+ }
7327
7487
  if (error) {
7328
- return /* @__PURE__ */ u$1("p", { children: [
7329
- "Error: ",
7330
- error.name,
7331
- " ",
7332
- error.message,
7333
- " ",
7334
- error.stack
7335
- ] });
7488
+ return /* @__PURE__ */ u$1(ErrorDisplay, { error });
7336
7489
  }
7337
7490
  const onInput = (event) => {
7338
7491
  if (event.target instanceof HTMLInputElement) {
@@ -7363,7 +7516,7 @@ const LocationFilter = ({ initialValue, fields }) => {
7363
7516
  setUnknownLocation(true);
7364
7517
  }
7365
7518
  };
7366
- return /* @__PURE__ */ u$1("form", { class: "flex", onSubmit: submit, ref: formRef, children: [
7519
+ return /* @__PURE__ */ u$1("form", { class: "flex w-full", onSubmit: submit, ref: formRef, children: [
7367
7520
  /* @__PURE__ */ u$1(
7368
7521
  "input",
7369
7522
  {
@@ -7408,9 +7561,10 @@ let LocationFilterComponent = class extends PreactLitAdapter {
7408
7561
  super(...arguments);
7409
7562
  this.initialValue = "";
7410
7563
  this.fields = [];
7564
+ this.width = void 0;
7411
7565
  }
7412
7566
  render() {
7413
- return /* @__PURE__ */ u$1(LocationFilter, { initialValue: this.initialValue, fields: this.fields });
7567
+ return /* @__PURE__ */ u$1(LocationFilter, { initialValue: this.initialValue, fields: this.fields, width: this.width });
7414
7568
  }
7415
7569
  };
7416
7570
  __decorateClass$2([
@@ -7419,6 +7573,9 @@ __decorateClass$2([
7419
7573
  __decorateClass$2([
7420
7574
  n2({ type: Array })
7421
7575
  ], LocationFilterComponent.prototype, "fields", 2);
7576
+ __decorateClass$2([
7577
+ n2({ type: Object })
7578
+ ], LocationFilterComponent.prototype, "width", 2);
7422
7579
  LocationFilterComponent = __decorateClass$2([
7423
7580
  t$2("gs-location-filter")
7424
7581
  ], LocationFilterComponent);
@@ -7427,7 +7584,16 @@ async function fetchAutocompleteList(lapis, field, signal) {
7427
7584
  const data = (await fetchAggregatedOperator.evaluate(lapis, signal)).content;
7428
7585
  return data.map((item) => item[field]);
7429
7586
  }
7430
- const TextInput = ({ lapisField, placeholderText, initialValue }) => {
7587
+ const TextInput = ({ width, lapisField, placeholderText, initialValue }) => {
7588
+ const defaultSize = { width: "100%", height: "3rem" };
7589
+ const size = width === void 0 ? void 0 : { width, height: defaultSize.height };
7590
+ return /* @__PURE__ */ u$1(ErrorBoundary, { defaultSize, size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(TextInputInner, { lapisField, placeholderText, initialValue }) }) });
7591
+ };
7592
+ const TextInputInner = ({
7593
+ lapisField,
7594
+ placeholderText,
7595
+ initialValue
7596
+ }) => {
7431
7597
  const lapis = P(LapisUrlContext);
7432
7598
  const inputRef = F(null);
7433
7599
  const { data, error, isLoading } = useQuery(() => fetchAutocompleteList(lapis, lapisField), [lapisField, lapis]);
@@ -7464,7 +7630,7 @@ const TextInput = ({ lapisField, placeholderText, initialValue }) => {
7464
7630
  "input",
7465
7631
  {
7466
7632
  type: "text",
7467
- class: "input input-bordered",
7633
+ class: "input input-bordered w-full",
7468
7634
  placeholder: placeholderText !== void 0 ? placeholderText : lapisField,
7469
7635
  onInput,
7470
7636
  ref: inputRef,
@@ -7492,6 +7658,7 @@ let TextInputComponent = class extends PreactLitAdapter {
7492
7658
  this.initialValue = "";
7493
7659
  this.lapisField = "";
7494
7660
  this.placeholderText = "";
7661
+ this.width = void 0;
7495
7662
  }
7496
7663
  render() {
7497
7664
  return /* @__PURE__ */ u$1(
@@ -7499,7 +7666,8 @@ let TextInputComponent = class extends PreactLitAdapter {
7499
7666
  {
7500
7667
  lapisField: this.lapisField,
7501
7668
  placeholderText: this.placeholderText,
7502
- initialValue: this.initialValue
7669
+ initialValue: this.initialValue,
7670
+ width: this.width
7503
7671
  }
7504
7672
  );
7505
7673
  }
@@ -7513,6 +7681,9 @@ __decorateClass$1([
7513
7681
  __decorateClass$1([
7514
7682
  n2()
7515
7683
  ], TextInputComponent.prototype, "placeholderText", 2);
7684
+ __decorateClass$1([
7685
+ n2({ type: Object })
7686
+ ], TextInputComponent.prototype, "width", 2);
7516
7687
  TextInputComponent = __decorateClass$1([
7517
7688
  t$2("gs-text-input")
7518
7689
  ], TextInputComponent);
@@ -7592,7 +7763,11 @@ const DeleteIcon = () => {
7592
7763
  }
7593
7764
  );
7594
7765
  };
7595
- const MutationFilter = ({ initialValue }) => {
7766
+ const MutationFilter = ({ initialValue, size }) => {
7767
+ const defaultSize = { width: "100%", height: "6.5rem" };
7768
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, defaultSize, children: /* @__PURE__ */ u$1(ResizeContainer, { size, defaultSize, children: /* @__PURE__ */ u$1(MutationFilterInner, { initialValue }) }) });
7769
+ };
7770
+ const MutationFilterInner = ({ initialValue }) => {
7596
7771
  const referenceGenome = P(ReferenceGenomeContext);
7597
7772
  const [selectedFilters, setSelectedFilters] = p(
7598
7773
  getInitialState(initialValue, referenceGenome)
@@ -7641,7 +7816,7 @@ const MutationFilter = ({ initialValue }) => {
7641
7816
  setInputValue(event.target.value);
7642
7817
  setIsError(false);
7643
7818
  };
7644
- return /* @__PURE__ */ u$1("div", { class: `rounded-lg border border-gray-300 bg-white p-2`, children: [
7819
+ return /* @__PURE__ */ u$1("div", { class: `h-full w-full rounded-lg border border-gray-300 bg-white p-2 overflow-scroll`, children: [
7645
7820
  /* @__PURE__ */ u$1("div", { class: "flex justify-between", children: [
7646
7821
  /* @__PURE__ */ u$1(
7647
7822
  SelectedMutationDisplay,
@@ -7804,11 +7979,11 @@ const SelectedFilter = ({
7804
7979
  return /* @__PURE__ */ u$1(
7805
7980
  "div",
7806
7981
  {
7807
- class: "flex items-center flex-nowrap gap-1 rounded me-1 px-2.5 py-0.5 font-medium text-xs mb-1",
7982
+ class: "flex items-center flex-nowrap gap-1 rounded me-1 px-2.5 py-0.5 font-medium text-xs mb-1 min-w-max",
7808
7983
  style: { backgroundColor, color: textColor },
7809
7984
  children: [
7810
- /* @__PURE__ */ u$1("div", { children: mutation.toString() }),
7811
- /* @__PURE__ */ u$1("button", { onClick: () => onDelete(mutation), children: /* @__PURE__ */ u$1(DeleteIcon, {}) })
7985
+ /* @__PURE__ */ u$1("div", { className: "whitespace-nowrap min-w-max", children: mutation.toString() }),
7986
+ /* @__PURE__ */ u$1("button", { type: "button", onClick: () => onDelete(mutation), children: /* @__PURE__ */ u$1(DeleteIcon, {}) })
7812
7987
  ]
7813
7988
  }
7814
7989
  );
@@ -7836,14 +8011,18 @@ let MutationFilterComponent = class extends PreactLitAdapter {
7836
8011
  constructor() {
7837
8012
  super(...arguments);
7838
8013
  this.initialValue = void 0;
8014
+ this.size = void 0;
7839
8015
  }
7840
8016
  render() {
7841
- return /* @__PURE__ */ u$1(ReferenceGenomesAwaiter, { children: /* @__PURE__ */ u$1(MutationFilter, { initialValue: this.initialValue }) });
8017
+ return /* @__PURE__ */ u$1(ReferenceGenomesAwaiter, { children: /* @__PURE__ */ u$1(MutationFilter, { initialValue: this.initialValue, size: this.size }) });
7842
8018
  }
7843
8019
  };
7844
8020
  __decorateClass([
7845
8021
  n2()
7846
8022
  ], MutationFilterComponent.prototype, "initialValue", 2);
8023
+ __decorateClass([
8024
+ n2({ type: Object })
8025
+ ], MutationFilterComponent.prototype, "size", 2);
7847
8026
  MutationFilterComponent = __decorateClass([
7848
8027
  t$2("gs-mutation-filter")
7849
8028
  ], MutationFilterComponent);