@genspectrum/dashboard-components 0.6.9 → 0.6.11

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 (27) hide show
  1. package/custom-elements.json +3 -3
  2. package/dist/dashboard-components.js +366 -75
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +2 -2
  5. package/dist/style.css +65 -1
  6. package/package.json +4 -1
  7. package/src/preact/aggregatedData/aggregate.tsx +14 -4
  8. package/src/preact/components/chart.tsx +14 -1
  9. package/src/preact/components/fullscreen.tsx +57 -0
  10. package/src/preact/components/info.tsx +88 -1
  11. package/src/preact/components/resize-container.tsx +5 -1
  12. package/src/preact/mutationComparison/mutation-comparison.tsx +2 -0
  13. package/src/preact/mutations/mutations.tsx +34 -2
  14. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_byDayOverall.json +4726 -0
  15. package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json +11143 -0
  16. package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byWeekOverall.json +9154 -0
  17. package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +66 -22
  18. package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +16 -7
  19. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +17 -0
  20. package/src/preact/mutationsOverTime/mutations-over-time.tsx +28 -4
  21. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +42 -6
  22. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +2 -1
  23. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +46 -53
  24. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +2 -0
  25. package/src/query/queryMutationsOverTime.ts +10 -1
  26. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +51 -1
  27. package/src/web-components/visualization/gs-prevalence-over-time.tsx +2 -4
@@ -5025,7 +5025,7 @@ function P$1() {
5025
5025
  }
5026
5026
  function S$2(n3, l2, u2, t2, i3, o2, r2, f2, e3, c2, s6) {
5027
5027
  var a2, v2, y2, d2, w2, _2 = t2 && t2.__k || p$2, g2 = l2.length;
5028
- for (u2.__d = e3, $$1(u2, l2, _2), e3 = u2.__d, a2 = 0; a2 < g2; a2++) null != (y2 = u2.__k[a2]) && "boolean" != typeof y2 && "function" != typeof y2 && (v2 = -1 === y2.__i ? h$2 : _2[y2.__i] || h$2, y2.__i = a2, O$1(n3, y2, v2, i3, o2, r2, f2, e3, c2, s6), d2 = y2.__e, y2.ref && v2.ref != y2.ref && (v2.ref && N$1(v2.ref, null, y2), s6.push(y2.ref, y2.__c || d2, y2)), null == w2 && null != d2 && (w2 = d2), 65536 & y2.__u || v2.__k === y2.__k ? (e3 && "string" == typeof y2.type && !n3.contains(e3) && (e3 = x$2(v2)), e3 = I$1(y2, e3, n3)) : "function" == typeof y2.type && void 0 !== y2.__d ? e3 = y2.__d : d2 && (e3 = d2.nextSibling), y2.__d = void 0, y2.__u &= -196609);
5028
+ for (u2.__d = e3, $$1(u2, l2, _2), e3 = u2.__d, a2 = 0; a2 < g2; a2++) null != (y2 = u2.__k[a2]) && "boolean" != typeof y2 && "function" != typeof y2 && (v2 = -1 === y2.__i ? h$2 : _2[y2.__i] || h$2, y2.__i = a2, O$1(n3, y2, v2, i3, o2, r2, f2, e3, c2, s6), d2 = y2.__e, y2.ref && v2.ref != y2.ref && (v2.ref && N$1(v2.ref, null, y2), s6.push(y2.ref, y2.__c || d2, y2)), null == w2 && null != d2 && (w2 = d2), 65536 & y2.__u || v2.__k === y2.__k ? e3 = I$1(y2, e3, n3) : "function" == typeof y2.type && void 0 !== y2.__d ? e3 = y2.__d : d2 && (e3 = d2.nextSibling), y2.__d = void 0, y2.__u &= -196609);
5029
5029
  u2.__d = e3, u2.__e = w2;
5030
5030
  }
5031
5031
  function $$1(n3, l2, u2) {
@@ -5039,7 +5039,7 @@ function I$1(n3, l2, u2) {
5039
5039
  for (t2 = n3.__k, i3 = 0; t2 && i3 < t2.length; i3++) t2[i3] && (t2[i3].__ = n3, l2 = I$1(t2[i3], l2, u2));
5040
5040
  return l2;
5041
5041
  }
5042
- n3.__e != l2 && (u2.insertBefore(n3.__e, l2 || null), l2 = n3.__e);
5042
+ n3.__e != l2 && (l2 && n3.type && !u2.contains(l2) && (l2 = x$2(n3)), u2.insertBefore(n3.__e, l2 || null), l2 = n3.__e);
5043
5043
  do {
5044
5044
  l2 = l2 && l2.nextSibling;
5045
5045
  } while (null != l2 && 8 === l2.nodeType);
@@ -5117,7 +5117,11 @@ function O$1(n3, u2, t2, i3, o2, r2, f2, e3, c2, s6) {
5117
5117
  } while (h3.__d && ++I3 < 25);
5118
5118
  h3.state = h3.__s, null != h3.getChildContext && (i3 = d$2(d$2({}, i3), h3.getChildContext())), x2 && !p2 && null != h3.getSnapshotBeforeUpdate && (_2 = h3.getSnapshotBeforeUpdate(v2, w2)), S$2(n3, y$2(L3 = null != a2 && a2.type === k$1 && null == a2.key ? a2.props.children : a2) ? L3 : [L3], u2, t2, i3, o2, r2, f2, e3, c2, s6), h3.base = u2.__e, u2.__u &= -161, h3.__h.length && f2.push(h3), g2 && (h3.__E = h3.__ = null);
5119
5119
  } catch (n4) {
5120
- u2.__v = null, c2 || null != r2 ? (u2.__e = e3, u2.__u |= c2 ? 160 : 32, r2[r2.indexOf(e3)] = null) : (u2.__e = t2.__e, u2.__k = t2.__k), l$2.__e(n4, u2, t2);
5120
+ if (u2.__v = null, c2 || null != r2) {
5121
+ for (u2.__u |= c2 ? 160 : 32; e3 && 8 === e3.nodeType && e3.nextSibling; ) e3 = e3.nextSibling;
5122
+ r2[r2.indexOf(e3)] = null, u2.__e = e3;
5123
+ } else u2.__e = t2.__e, u2.__k = t2.__k;
5124
+ l$2.__e(n4, u2, t2);
5121
5125
  }
5122
5126
  else null == r2 && u2.__v === t2.__v ? (u2.__k = t2.__k, u2.__e = t2.__e) : u2.__e = z$2(t2.__e, u2, t2, i3, o2, r2, f2, c2, s6);
5123
5127
  (a2 = l$2.diffed) && a2(u2);
@@ -5165,7 +5169,10 @@ function z$2(l2, u2, t2, i3, o2, r2, f2, e3, c2) {
5165
5169
  }
5166
5170
  function N$1(n3, u2, t2) {
5167
5171
  try {
5168
- "function" == typeof n3 ? n3(u2) : n3.current = u2;
5172
+ if ("function" == typeof n3) {
5173
+ var i3 = "function" == typeof n3.__u;
5174
+ i3 && n3.__u(), i3 && null == u2 || (n3.__u = n3(u2));
5175
+ } else n3.current = u2;
5169
5176
  } catch (n4) {
5170
5177
  l$2.__e(n4, t2);
5171
5178
  }
@@ -25667,6 +25674,7 @@ const GsChart = ({ configuration }) => {
25667
25674
  return;
25668
25675
  }
25669
25676
  chartRef.current = new Chart(ctx, configuration);
25677
+ resizeChartAfterFullscreenChange(chartRef, ctx, configuration);
25670
25678
  return () => {
25671
25679
  var _a2;
25672
25680
  (_a2 = chartRef.current) == null ? void 0 : _a2.destroy();
@@ -25674,6 +25682,13 @@ const GsChart = ({ configuration }) => {
25674
25682
  }, [canvasRef, configuration]);
25675
25683
  return /* @__PURE__ */ u$2("canvas", { ref: canvasRef });
25676
25684
  };
25685
+ const resizeChartAfterFullscreenChange = (chartRef, ctx, configuration) => {
25686
+ document.addEventListener("fullscreenchange", () => {
25687
+ var _a2;
25688
+ (_a2 = chartRef.current) == null ? void 0 : _a2.destroy();
25689
+ chartRef.current = new Chart(ctx, configuration);
25690
+ });
25691
+ };
25677
25692
  Chart.register(...registerables, VennDiagramController, ArcSlice);
25678
25693
  const MutationComparisonVenn = ({
25679
25694
  data,
@@ -27312,7 +27327,7 @@ const ErrorDisplay = ({ error }) => {
27312
27327
  ] });
27313
27328
  };
27314
27329
  const ResizeContainer = ({ children, size }) => {
27315
- return /* @__PURE__ */ u$2("div", { style: size, children });
27330
+ return /* @__PURE__ */ u$2("div", { style: size, className: "bg-white", children });
27316
27331
  };
27317
27332
  const ErrorBoundary = ({ size, children }) => {
27318
27333
  const [internalError] = b$1();
@@ -27321,6 +27336,60 @@ const ErrorBoundary = ({ size, children }) => {
27321
27336
  }
27322
27337
  return /* @__PURE__ */ u$2(k$1, { children });
27323
27338
  };
27339
+ const Fullscreen = () => {
27340
+ const element = A$1(null);
27341
+ const isFullscreen = useFullscreenStatus();
27342
+ return /* @__PURE__ */ u$2(
27343
+ "button",
27344
+ {
27345
+ ref: element,
27346
+ onClick: async () => {
27347
+ if (element.current) {
27348
+ if (isFullscreen) {
27349
+ await document.exitFullscreen();
27350
+ } else {
27351
+ const componentRoot = findComponentRoot(element.current);
27352
+ if (componentRoot) {
27353
+ await componentRoot.requestFullscreen();
27354
+ }
27355
+ }
27356
+ }
27357
+ },
27358
+ className: `mt-0.5 iconify text-2xl ${isFullscreen ? "mdi--fullscreen-exit hover:scale-90" : "mdi--fullscreen hover:scale-110"}`,
27359
+ title: isFullscreen ? "Exit fullscreen" : "Enter fullscreen"
27360
+ }
27361
+ );
27362
+ };
27363
+ function findComponentRoot(element) {
27364
+ var _a2;
27365
+ return (_a2 = findShadowRoot(element)) == null ? void 0 : _a2.children[0];
27366
+ }
27367
+ function findShadowRoot(element) {
27368
+ let current = element;
27369
+ while (current) {
27370
+ if (current instanceof ShadowRoot) {
27371
+ return current;
27372
+ }
27373
+ if (current.parentNode === null) {
27374
+ return null;
27375
+ }
27376
+ current = current.parentNode;
27377
+ }
27378
+ return null;
27379
+ }
27380
+ function useFullscreenStatus() {
27381
+ const [isFullscreen, setIsFullscreen] = h$1(document.fullscreenElement !== null);
27382
+ y$1(() => {
27383
+ const handleFullscreenChange = () => {
27384
+ setIsFullscreen(document.fullscreenElement !== null);
27385
+ };
27386
+ document.addEventListener("fullscreenchange", handleFullscreenChange);
27387
+ return () => {
27388
+ document.removeEventListener("fullscreenchange", handleFullscreenChange);
27389
+ };
27390
+ }, []);
27391
+ return isFullscreen;
27392
+ }
27324
27393
  const Info = ({ children }) => {
27325
27394
  const dialogRef = A$1(null);
27326
27395
  const toggleHelp = () => {
@@ -27330,7 +27399,7 @@ const Info = ({ children }) => {
27330
27399
  return /* @__PURE__ */ u$2("div", { className: "relative", children: [
27331
27400
  /* @__PURE__ */ u$2("button", { type: "button", className: "btn btn-xs", onClick: toggleHelp, children: "?" }),
27332
27401
  /* @__PURE__ */ u$2("dialog", { ref: dialogRef, className: "modal modal-bottom sm:modal-middle", children: [
27333
- /* @__PURE__ */ u$2("div", { className: "modal-box", children: [
27402
+ /* @__PURE__ */ u$2("div", { className: "modal-box sm:max-w-5xl", children: [
27334
27403
  /* @__PURE__ */ u$2("form", { method: "dialog", children: /* @__PURE__ */ u$2("button", { className: "btn btn-sm btn-circle btn-ghost absolute right-2 top-2", children: "✕" }) }),
27335
27404
  /* @__PURE__ */ u$2("div", { className: "flex flex-col", children }),
27336
27405
  /* @__PURE__ */ u$2("div", { className: "modal-action", children: /* @__PURE__ */ u$2("form", { method: "dialog", children: /* @__PURE__ */ u$2("button", { className: "float-right underline text-sm hover:text-blue-700 mr-2", children: "Close" }) }) })
@@ -27351,6 +27420,73 @@ const InfoParagraph = ({ children }) => {
27351
27420
  const InfoLink = ({ children, href }) => {
27352
27421
  return /* @__PURE__ */ u$2("a", { className: "text-blue-600 hover:text-blue-800", href, target: "_blank", rel: "noopener noreferrer", children });
27353
27422
  };
27423
+ const InfoComponentCode = ({ componentName, params, lapisUrl }) => {
27424
+ const componentCode = componentParametersToCode(componentName, params, lapisUrl);
27425
+ const codePenData = {
27426
+ title: "GenSpectrum dashboard component",
27427
+ html: generateFullExampleCode(componentCode, componentName),
27428
+ layout: "left",
27429
+ editors: "100"
27430
+ };
27431
+ return /* @__PURE__ */ u$2(k$1, { children: [
27432
+ /* @__PURE__ */ u$2(InfoHeadline2, { children: "Use this component yourself" }),
27433
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
27434
+ "This component was created using the following parameters:",
27435
+ /* @__PURE__ */ u$2("div", { className: "p-4 border border-gray-200 rounded-lg overflow-x-auto", children: /* @__PURE__ */ u$2("pre", { children: /* @__PURE__ */ u$2("code", { children: componentCode }) }) })
27436
+ ] }),
27437
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
27438
+ "You can add this component to your own website using the",
27439
+ " ",
27440
+ /* @__PURE__ */ u$2(InfoLink, { href: "https://github.com/GenSpectrum/dashboard-components", children: "GenSpectrum dashboard components library" }),
27441
+ " ",
27442
+ "and the code from above."
27443
+ ] }),
27444
+ /* @__PURE__ */ u$2(InfoParagraph, { children: /* @__PURE__ */ u$2("form", { action: "https://codepen.io/pen/define", method: "POST", target: "_blank", children: [
27445
+ /* @__PURE__ */ u$2(
27446
+ "input",
27447
+ {
27448
+ type: "hidden",
27449
+ name: "data",
27450
+ value: JSON.stringify(codePenData).replace(/"/g, "&quot;").replace(/'/g, "&apos;")
27451
+ }
27452
+ ),
27453
+ /* @__PURE__ */ u$2("button", { className: "text-blue-600 hover:text-blue-800", type: "submit", children: "Click here to try it out on CodePen." })
27454
+ ] }) })
27455
+ ] });
27456
+ };
27457
+ function componentParametersToCode(componentName, params, lapisUrl) {
27458
+ const stringifyIfNeeded = (value) => {
27459
+ return typeof value === "object" ? JSON.stringify(value) : value;
27460
+ };
27461
+ const attributes = indentLines(
27462
+ Object.entries(params).map(([key, value]) => `${key}='${stringifyIfNeeded(value)}'`).join("\n"),
27463
+ 4
27464
+ );
27465
+ return `<gs-app lapis="${lapisUrl}">
27466
+ <gs-${componentName}
27467
+ ${attributes}
27468
+ />
27469
+ </gs-app>`;
27470
+ }
27471
+ function generateFullExampleCode(componentCode, componentName) {
27472
+ const storyBookPath = `/docs/visualization-${componentName}--docs`;
27473
+ return `<html>
27474
+ <head>
27475
+ <script type="module" src="https://unpkg.com/@genspectrum/dashboard-components@latest/dist/dashboard-components.js"><\/script>
27476
+ <link rel="stylesheet" href="https://unpkg.com/@genspectrum/dashboard-components@latest/dist/style.css" />
27477
+ </head>
27478
+
27479
+ <body>
27480
+ <!-- Component documentation: https://genspectrum.github.io/dashboard-components/?path=${storyBookPath} -->
27481
+ ${indentLines(componentCode, 2)}
27482
+ </body>
27483
+ </html>
27484
+ `;
27485
+ }
27486
+ function indentLines(text, numberSpaces) {
27487
+ const spaces = " ".repeat(numberSpaces);
27488
+ return text.split("\n").map((line) => spaces + line).join("\n");
27489
+ }
27354
27490
  const LoadingDisplay = () => {
27355
27491
  return /* @__PURE__ */ u$2("div", { "aria-label": "Loading", className: "h-full w-full skeleton" });
27356
27492
  };
@@ -27729,13 +27865,14 @@ const Toolbar$5 = ({
27729
27865
  filename: "mutation_comparison.csv"
27730
27866
  }
27731
27867
  ),
27732
- /* @__PURE__ */ u$2(Info, { children: "Info for mutation comparison" })
27868
+ /* @__PURE__ */ u$2(Info, { children: "Info for mutation comparison" }),
27869
+ /* @__PURE__ */ u$2(Fullscreen, {})
27733
27870
  ] });
27734
27871
  };
27735
27872
  const gridJsStyle = '.gridjs-head button, .gridjs-footer button {\n cursor: pointer;\n background-color: transparent;\n background-image: none;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n}\n\n.gridjs-temp {\n position: relative;\n}\n\n.gridjs-head {\n width: 100%;\n margin-bottom: 5px;\n padding: 5px 1px;\n}\n.gridjs-head::after {\n content: "";\n display: block;\n clear: both;\n}\n.gridjs-head:empty {\n padding: 0;\n border: none;\n}\n\n.gridjs-container {\n overflow: hidden;\n display: inline-block;\n padding: 2px;\n color: #000;\n position: relative;\n z-index: 0;\n}\n\n.gridjs-footer {\n display: block;\n position: relative;\n width: 100%;\n z-index: 5;\n padding: 12px 24px;\n border-top: 1px solid #e5e7eb;\n background-color: #fff;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.26);\n border-radius: 0 0 8px 8px;\n border-bottom-width: 1px;\n border-color: #e5e7eb;\n}\n.gridjs-footer:empty {\n padding: 0;\n border: none;\n}\n\ninput.gridjs-input {\n outline: none;\n background-color: #fff;\n border: 1px solid #d2d6dc;\n border-radius: 5px;\n padding: 10px 13px;\n font-size: 14px;\n line-height: 1.45;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\ninput.gridjs-input:focus {\n box-shadow: 0 0 0 3px rgba(149, 189, 243, 0.5);\n border-color: #9bc2f7;\n}\n\n.gridjs-pagination {\n color: #3d4044;\n}\n.gridjs-pagination::after {\n content: "";\n display: block;\n clear: both;\n}\n.gridjs-pagination .gridjs-summary {\n float: left;\n margin-top: 5px;\n}\n.gridjs-pagination .gridjs-pages {\n float: right;\n}\n.gridjs-pagination .gridjs-pages button {\n padding: 5px 14px;\n border: 1px solid #d2d6dc;\n background-color: #fff;\n border-right: none;\n outline: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.gridjs-pagination .gridjs-pages button:focus {\n box-shadow: 0 0 0 2px rgba(149, 189, 243, 0.5);\n position: relative;\n margin-right: -1px;\n border-right: 1px solid #d2d6dc;\n}\n.gridjs-pagination .gridjs-pages button:hover {\n background-color: #f7f7f7;\n color: rgb(60, 66, 87);\n outline: none;\n}\n.gridjs-pagination .gridjs-pages button:disabled,\n.gridjs-pagination .gridjs-pages button[disabled],\n.gridjs-pagination .gridjs-pages button:hover:disabled {\n cursor: default;\n background-color: #fff;\n color: #6b7280;\n}\n.gridjs-pagination .gridjs-pages button.gridjs-spread {\n cursor: default;\n box-shadow: none;\n background-color: #fff;\n}\n.gridjs-pagination .gridjs-pages button.gridjs-currentPage {\n background-color: #f7f7f7;\n font-weight: bold;\n}\n.gridjs-pagination .gridjs-pages button:last-child {\n border-bottom-right-radius: 6px;\n border-top-right-radius: 6px;\n border-right: 1px solid #d2d6dc;\n}\n.gridjs-pagination .gridjs-pages button:first-child {\n border-bottom-left-radius: 6px;\n border-top-left-radius: 6px;\n}\n.gridjs-pagination .gridjs-pages button:last-child:focus {\n margin-right: 0;\n}\n\nbutton.gridjs-sort {\n float: right;\n height: 24px;\n width: 13px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position-x: center;\n cursor: pointer;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n background-size: contain;\n}\nbutton.gridjs-sort-neutral {\n opacity: 0.3;\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSI0MDEuOTk4cHgiIGhlaWdodD0iNDAxLjk5OHB4IiB2aWV3Qm94PSIwIDAgNDAxLjk5OCA0MDEuOTk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MDEuOTk4IDQwMS45OTg7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnPgoJCTxwYXRoIGQ9Ik03My4wOTIsMTY0LjQ1MmgyNTUuODEzYzQuOTQ5LDAsOS4yMzMtMS44MDcsMTIuODQ4LTUuNDI0YzMuNjEzLTMuNjE2LDUuNDI3LTcuODk4LDUuNDI3LTEyLjg0NwoJCQljMC00Ljk0OS0xLjgxMy05LjIyOS01LjQyNy0xMi44NUwyMTMuODQ2LDUuNDI0QzIxMC4yMzIsMS44MTIsMjA1Ljk1MSwwLDIwMC45OTksMHMtOS4yMzMsMS44MTItMTIuODUsNS40MjRMNjAuMjQyLDEzMy4zMzEKCQkJYy0zLjYxNywzLjYxNy01LjQyNCw3LjkwMS01LjQyNCwxMi44NWMwLDQuOTQ4LDEuODA3LDkuMjMxLDUuNDI0LDEyLjg0N0M2My44NjMsMTYyLjY0NSw2OC4xNDQsMTY0LjQ1Miw3My4wOTIsMTY0LjQ1MnoiLz4KCQk8cGF0aCBkPSJNMzI4LjkwNSwyMzcuNTQ5SDczLjA5MmMtNC45NTIsMC05LjIzMywxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MTctNS40MjQsNy44OTgtNS40MjQsMTIuODQ3CgkJCWMwLDQuOTQ5LDEuODA3LDkuMjMzLDUuNDI0LDEyLjg0OEwxODguMTQ5LDM5Ni41N2MzLjYyMSwzLjYxNyw3LjkwMiw1LjQyOCwxMi44NSw1LjQyOHM5LjIzMy0xLjgxMSwxMi44NDctNS40MjhsMTI3LjkwNy0xMjcuOTA2CgkJCWMzLjYxMy0zLjYxNCw1LjQyNy03Ljg5OCw1LjQyNy0xMi44NDhjMC00Ljk0OC0xLjgxMy05LjIyOS01LjQyNy0xMi44NDdDMzM4LjEzOSwyMzkuMzUzLDMzMy44NTQsMjM3LjU0OSwzMjguOTA1LDIzNy41NDl6Ii8+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: center;\n}\nbutton.gridjs-sort-asc {\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyOTIuMzYycHgiIGhlaWdodD0iMjkyLjM2MXB4IiB2aWV3Qm94PSIwIDAgMjkyLjM2MiAyOTIuMzYxIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyOTIuMzYyIDI5Mi4zNjE7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0yODYuOTM1LDE5Ny4yODdMMTU5LjAyOCw2OS4zODFjLTMuNjEzLTMuNjE3LTcuODk1LTUuNDI0LTEyLjg0Ny01LjQyNHMtOS4yMzMsMS44MDctMTIuODUsNS40MjRMNS40MjQsMTk3LjI4NwoJCUMxLjgwNywyMDAuOTA0LDAsMjA1LjE4NiwwLDIxMC4xMzRzMS44MDcsOS4yMzMsNS40MjQsMTIuODQ3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI1LDEyLjg1LDUuNDI1aDI1NS44MTMKCQljNC45NDksMCw5LjIzMy0xLjgwOCwxMi44NDgtNS40MjVjMy42MTMtMy42MTMsNS40MjctNy44OTgsNS40MjctMTIuODQ3UzI5MC41NDgsMjAwLjkwNCwyODYuOTM1LDE5Ny4yODd6Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: 35%;\n background-size: 10px;\n}\nbutton.gridjs-sort-desc {\n background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyOTIuMzYycHgiIGhlaWdodD0iMjkyLjM2MnB4IiB2aWV3Qm94PSIwIDAgMjkyLjM2MiAyOTIuMzYyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyOTIuMzYyIDI5Mi4zNjI7IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxwYXRoIGQ9Ik0yODYuOTM1LDY5LjM3N2MtMy42MTQtMy42MTctNy44OTgtNS40MjQtMTIuODQ4LTUuNDI0SDE4LjI3NGMtNC45NTIsMC05LjIzMywxLjgwNy0xMi44NSw1LjQyNAoJCUMxLjgwNyw3Mi45OTgsMCw3Ny4yNzksMCw4Mi4yMjhjMCw0Ljk0OCwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDdsMTI3LjkwNywxMjcuOTA3YzMuNjIxLDMuNjE3LDcuOTAyLDUuNDI4LDEyLjg1LDUuNDI4CgkJczkuMjMzLTEuODExLDEyLjg0Ny01LjQyOEwyODYuOTM1LDk1LjA3NGMzLjYxMy0zLjYxNyw1LjQyNy03Ljg5OCw1LjQyNy0xMi44NDdDMjkyLjM2Miw3Ny4yNzksMjkwLjU0OCw3Mi45OTgsMjg2LjkzNSw2OS4zNzd6Ii8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+");\n background-position-y: 65%;\n background-size: 10px;\n}\nbutton.gridjs-sort:focus {\n outline: none;\n}\n\ntable.gridjs-table {\n width: 100%;\n max-width: 100%;\n border-collapse: collapse;\n text-align: left;\n display: table;\n margin: 0;\n padding: 0;\n overflow: auto;\n table-layout: fixed;\n}\n\n.gridjs-tbody {\n background-color: #fff;\n}\n\ntd.gridjs-td {\n border: 1px solid #e5e7eb;\n padding: 12px 24px;\n background-color: #fff;\n box-sizing: content-box;\n}\ntd.gridjs-td:first-child {\n border-left: none;\n}\ntd.gridjs-td:last-child {\n border-right: none;\n}\ntd.gridjs-message {\n text-align: center;\n}\n\nth.gridjs-th {\n position: relative;\n color: #6b7280;\n background-color: #f9fafb;\n border: 1px solid #e5e7eb;\n border-top: none;\n padding: 14px 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n box-sizing: border-box;\n white-space: nowrap;\n outline: none;\n vertical-align: middle;\n}\nth.gridjs-th .gridjs-th-content {\n text-overflow: ellipsis;\n overflow: hidden;\n width: 100%;\n float: left;\n}\nth.gridjs-th-sort {\n cursor: pointer;\n}\nth.gridjs-th-sort .gridjs-th-content {\n width: calc(100% - 15px);\n}\nth.gridjs-th-sort:hover {\n background-color: #e5e7eb;\n}\nth.gridjs-th-sort:focus {\n background-color: #e5e7eb;\n}\nth.gridjs-th-fixed {\n position: sticky;\n box-shadow: 0 1px 0 0 #e5e7eb;\n}\n@supports (-moz-appearance: none) {\n th.gridjs-th-fixed {\n box-shadow: 0 0 0 1px #e5e7eb;\n }\n}\nth.gridjs-th:first-child {\n border-left: none;\n}\nth.gridjs-th:last-child {\n border-right: none;\n}\n\n.gridjs-tr {\n border: none;\n}\n.gridjs-tr-selected td {\n background-color: #ebf5ff;\n}\n.gridjs-tr:last-child td {\n border-bottom: 0;\n}\n\n.gridjs *,\n.gridjs :after,\n.gridjs :before {\n box-sizing: border-box;\n}\n\n.gridjs-wrapper {\n position: relative;\n z-index: 1;\n overflow: auto;\n width: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.26);\n border-radius: 8px 8px 0 0;\n display: block;\n border-top-width: 1px;\n border-color: #e5e7eb;\n}\n.gridjs-wrapper:nth-last-of-type(2) {\n border-radius: 8px;\n border-bottom-width: 1px;\n}\n\n.gridjs-search {\n float: left;\n}\n.gridjs-search-input {\n width: 250px;\n}\n\n.gridjs-loading-bar {\n z-index: 10;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: #fff;\n opacity: 0.5;\n}\n.gridjs-loading-bar::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(90deg, rgba(204, 204, 204, 0) 0, rgba(204, 204, 204, 0.2) 20%, rgba(204, 204, 204, 0.5) 60%, rgba(204, 204, 204, 0));\n animation: shimmer 2s infinite;\n content: "";\n}\n@keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.gridjs-td .gridjs-checkbox {\n display: block;\n margin: auto;\n cursor: pointer;\n}\n\n.gridjs-resizable {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 5px;\n}\n.gridjs-resizable:hover {\n cursor: ew-resize;\n background-color: #9bc2f7;\n}\n/*# sourceMappingURL=mermaid.css?inline.map */';
27736
27873
  const minMaxPercentSliderCss = 'input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none;\n pointer-events: all;\n width: 24px;\n height: 24px;\n background-color: #fff;\n border-radius: 50%;\n box-shadow: 0 0 0 1px #C6C6C6;\n cursor: pointer;\n}\n\ninput[type=range]::-moz-range-thumb {\n -webkit-appearance: none;\n pointer-events: all;\n width: 24px;\n height: 24px;\n background-color: #fff;\n border-radius: 50%;\n box-shadow: 0 0 0 1px #C6C6C6;\n cursor: pointer;\n}\n\ninput[type=range]::-webkit-slider-thumb:hover {\n background: #f7f7f7;\n}\n\ninput[type=range]::-webkit-slider-thumb:active {\n box-shadow: inset 0 0 3px #387bbe, 0 0 9px #387bbe;\n -webkit-box-shadow: inset 0 0 3px #387bbe, 0 0 9px #387bbe;\n}\n\ninput[type="range"] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n height: 2px;\n width: 100%;\n position: absolute;\n background-color: #C6C6C6;\n pointer-events: none;\n}';
27737
27874
  const tailwindStyle = `/*
27738
- ! tailwindcss v3.4.6 | MIT License | https://tailwindcss.com
27875
+ ! tailwindcss v3.4.7 | MIT License | https://tailwindcss.com
27739
27876
  *//*
27740
27877
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
27741
27878
  2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
@@ -28721,6 +28858,10 @@ html {
28721
28858
  border-radius: inherit;
28722
28859
  }
28723
28860
  }
28861
+ .link {
28862
+ cursor: pointer;
28863
+ text-decoration-line: underline;
28864
+ }
28724
28865
  .menu li.disabled {
28725
28866
  cursor: not-allowed;
28726
28867
  -webkit-user-select: none;
@@ -29217,6 +29358,14 @@ input.tab:checked + .tab-content,
29217
29358
  .join > :where(*:not(:first-child)):is(.btn) {
29218
29359
  margin-inline-start: calc(var(--border-btn) * -1);
29219
29360
  }
29361
+ .link:focus {
29362
+ outline: 2px solid transparent;
29363
+ outline-offset: 2px;
29364
+ }
29365
+ .link:focus-visible {
29366
+ outline: 2px solid currentColor;
29367
+ outline-offset: 2px;
29368
+ }
29220
29369
  .loading {
29221
29370
  pointer-events: none;
29222
29371
  display: inline-block;
@@ -30136,6 +30285,18 @@ input.tab:checked + .tab-content,
30136
30285
  right: auto;
30137
30286
  bottom: var(--tooltip-tail-offset);
30138
30287
  }
30288
+ .iconify {
30289
+ display: inline-block;
30290
+ width: 1em;
30291
+ height: 1em;
30292
+ background-color: currentColor;
30293
+ -webkit-mask-image: var(--svg);
30294
+ mask-image: var(--svg);
30295
+ -webkit-mask-repeat: no-repeat;
30296
+ mask-repeat: no-repeat;
30297
+ -webkit-mask-size: 100% 100%;
30298
+ mask-size: 100% 100%;
30299
+ }
30139
30300
  .visible {
30140
30301
  visibility: visible;
30141
30302
  }
@@ -30231,6 +30392,9 @@ input.tab:checked + .tab-content,
30231
30392
  .ml-1 {
30232
30393
  margin-left: 0.25rem;
30233
30394
  }
30395
+ .ml-2 {
30396
+ margin-left: 0.5rem;
30397
+ }
30234
30398
  .ml-2\\.5 {
30235
30399
  margin-left: 0.625rem;
30236
30400
  }
@@ -30243,6 +30407,9 @@ input.tab:checked + .tab-content,
30243
30407
  .mr-2 {
30244
30408
  margin-right: 0.5rem;
30245
30409
  }
30410
+ .mt-0\\.5 {
30411
+ margin-top: 0.125rem;
30412
+ }
30246
30413
  .mt-1 {
30247
30414
  margin-top: 0.25rem;
30248
30415
  }
@@ -30321,6 +30488,12 @@ input.tab:checked + .tab-content,
30321
30488
  .resize {
30322
30489
  resize: both;
30323
30490
  }
30491
+ .list-inside {
30492
+ list-style-position: inside;
30493
+ }
30494
+ .list-disc {
30495
+ list-style-type: disc;
30496
+ }
30324
30497
  .flex-row {
30325
30498
  flex-direction: row;
30326
30499
  }
@@ -30351,6 +30524,9 @@ input.tab:checked + .tab-content,
30351
30524
  .overflow-auto {
30352
30525
  overflow: auto;
30353
30526
  }
30527
+ .overflow-x-auto {
30528
+ overflow-x: auto;
30529
+ }
30354
30530
  .whitespace-nowrap {
30355
30531
  white-space: nowrap;
30356
30532
  }
@@ -30360,6 +30536,9 @@ input.tab:checked + .tab-content,
30360
30536
  .rounded-full {
30361
30537
  border-radius: 9999px;
30362
30538
  }
30539
+ .rounded-lg {
30540
+ border-radius: 0.5rem;
30541
+ }
30363
30542
  .rounded-md {
30364
30543
  border-radius: 0.375rem;
30365
30544
  }
@@ -30542,6 +30721,12 @@ input.tab:checked + .tab-content,
30542
30721
  .duration-150 {
30543
30722
  transition-duration: 150ms;
30544
30723
  }
30724
+ .mdi--fullscreen {
30725
+ --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M5 5h5v2H7v3H5zm9 0h5v5h-2V7h-3zm3 9h2v5h-5v-2h3zm-7 3v2H5v-5h2v3z'/%3E%3C/svg%3E");
30726
+ }
30727
+ .mdi--fullscreen-exit {
30728
+ --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M14 14h5v2h-3v3h-2zm-9 0h5v5H8v-3H5zm3-9h2v5H5V8h3zm11 3v2h-5V5h2v3z'/%3E%3C/svg%3E");
30729
+ }
30545
30730
  @media (min-width: 640px) {
30546
30731
 
30547
30732
  .sm\\:modal-middle {
@@ -30565,6 +30750,16 @@ input.tab:checked + .tab-content,
30565
30750
  --tw-border-opacity: 1;
30566
30751
  border-color: rgb(156 163 175 / var(--tw-border-opacity));
30567
30752
  }
30753
+ .hover\\:scale-110:hover {
30754
+ --tw-scale-x: 1.1;
30755
+ --tw-scale-y: 1.1;
30756
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
30757
+ }
30758
+ .hover\\:scale-90:hover {
30759
+ --tw-scale-x: .9;
30760
+ --tw-scale-y: .9;
30761
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
30762
+ }
30568
30763
  .hover\\:bg-gray-100:hover {
30569
30764
  --tw-bg-opacity: 1;
30570
30765
  background-color: rgb(243 244 246 / var(--tw-bg-opacity));
@@ -30599,6 +30794,12 @@ input.tab:checked + .tab-content,
30599
30794
  }
30600
30795
  .peer:hover ~ .peer-hover\\:visible {
30601
30796
  visibility: visible;
30797
+ }
30798
+ @media (min-width: 640px) {
30799
+
30800
+ .sm\\:max-w-5xl {
30801
+ max-width: 64rem;
30802
+ }
30602
30803
  }`;
30603
30804
  var __defProp$c = Object.defineProperty;
30604
30805
  var __decorateClass$c = (decorators, target, key, kind) => {
@@ -31090,9 +31291,39 @@ const Toolbar$4 = ({
31090
31291
  filename: "insertions.csv"
31091
31292
  }
31092
31293
  ),
31093
- /* @__PURE__ */ u$2(Info, { children: "Info for mutations" })
31294
+ /* @__PURE__ */ u$2(MutationsInfo, {}),
31295
+ /* @__PURE__ */ u$2(Fullscreen, {})
31094
31296
  ] });
31095
31297
  };
31298
+ const MutationsInfo = () => /* @__PURE__ */ u$2(Info, { children: [
31299
+ /* @__PURE__ */ u$2(InfoHeadline1, { children: "Mutations" }),
31300
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
31301
+ "This shows mutations of a variant. There are three types of mutations:",
31302
+ " ",
31303
+ /* @__PURE__ */ u$2(InfoLink, { href: "https://www.genome.gov/genetics-glossary/Substitution", children: "substitutions" }),
31304
+ ",",
31305
+ " ",
31306
+ /* @__PURE__ */ u$2(InfoLink, { href: "https://www.genome.gov/genetics-glossary/Deletion", children: "deletions" }),
31307
+ " and",
31308
+ " ",
31309
+ /* @__PURE__ */ u$2(InfoLink, { href: "https://www.genome.gov/genetics-glossary/Insertion", children: "insertions" }),
31310
+ "."
31311
+ ] }),
31312
+ /* @__PURE__ */ u$2(InfoHeadline2, { children: "Proportion calculation" }),
31313
+ /* @__PURE__ */ u$2(InfoParagraph, { children: "The proportion of a mutation is calculated by dividing the number of sequences with the mutation by the total number of sequences with a non-ambiguous symbol at the position." }),
31314
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
31315
+ /* @__PURE__ */ u$2("b", { children: "Example:" }),
31316
+ " Assume we look at nucleotide mutations at position 5 where the reference has a T and assume there are 10 sequences in total:",
31317
+ /* @__PURE__ */ u$2("ul", { className: "list-disc list-inside ml-2", children: [
31318
+ /* @__PURE__ */ u$2("li", { children: "3 sequences have a C," }),
31319
+ /* @__PURE__ */ u$2("li", { children: "2 sequences have a T," }),
31320
+ /* @__PURE__ */ u$2("li", { children: "1 sequence has a G," }),
31321
+ /* @__PURE__ */ u$2("li", { children: "3 sequences have an N," }),
31322
+ /* @__PURE__ */ u$2("li", { children: "1 sequence has a Y (which means T or C)," })
31323
+ ] }),
31324
+ "then the proportion of the T5C mutation is 50%. The 4 sequences that have an N or Y are excluded from the calculation."
31325
+ ] })
31326
+ ] });
31096
31327
  var __defProp$a = Object.defineProperty;
31097
31328
  var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
31098
31329
  var __decorateClass$a = (decorators, target, key, kind) => {
@@ -33444,21 +33675,13 @@ const ScalingSelector = ({
33444
33675
  }
33445
33676
  );
33446
33677
  };
33447
- const PrevalenceOverTime = ({ width, height, ...innerProps }) => {
33678
+ const PrevalenceOverTime = (componentProps) => {
33679
+ const { width, height } = componentProps;
33448
33680
  const size = { height, width };
33449
- return /* @__PURE__ */ u$2(ErrorBoundary, { size, children: /* @__PURE__ */ u$2(ResizeContainer, { size, children: /* @__PURE__ */ u$2(PrevalenceOverTimeInner, { ...innerProps }) }) });
33681
+ return /* @__PURE__ */ u$2(ErrorBoundary, { size, children: /* @__PURE__ */ u$2(ResizeContainer, { size, children: /* @__PURE__ */ u$2(PrevalenceOverTimeInner, { ...componentProps }) }) });
33450
33682
  };
33451
- const PrevalenceOverTimeInner = ({
33452
- numeratorFilter,
33453
- denominatorFilter,
33454
- granularity,
33455
- smoothingWindow,
33456
- views,
33457
- confidenceIntervalMethods,
33458
- lapisDateField,
33459
- pageSize,
33460
- yAxisMaxConfig
33461
- }) => {
33683
+ const PrevalenceOverTimeInner = (componentProps) => {
33684
+ const { numeratorFilter, denominatorFilter, granularity, smoothingWindow, lapisDateField } = componentProps;
33462
33685
  const lapis = x$1(LapisUrlContext);
33463
33686
  const { data, error, isLoading } = useQuery(
33464
33687
  () => queryPrevalenceOverTime(
@@ -33480,30 +33703,15 @@ const PrevalenceOverTimeInner = ({
33480
33703
  if (data === null) {
33481
33704
  return /* @__PURE__ */ u$2(NoDataDisplay, {});
33482
33705
  }
33483
- return /* @__PURE__ */ u$2(
33484
- PrevalenceOverTimeTabs,
33485
- {
33486
- views,
33487
- data,
33488
- granularity,
33489
- confidenceIntervalMethods,
33490
- pageSize,
33491
- yAxisMaxConfig
33492
- }
33493
- );
33706
+ return /* @__PURE__ */ u$2(PrevalenceOverTimeTabs, { data, ...componentProps });
33494
33707
  };
33495
- const PrevalenceOverTimeTabs = ({
33496
- views,
33497
- data,
33498
- granularity,
33499
- confidenceIntervalMethods,
33500
- pageSize,
33501
- yAxisMaxConfig
33502
- }) => {
33708
+ const PrevalenceOverTimeTabs = ({ data, ...componentProps }) => {
33709
+ const { views, granularity, confidenceIntervalMethods, pageSize, yAxisMaxLinear, yAxisMaxLogarithmic } = componentProps;
33503
33710
  const [yAxisScaleType, setYAxisScaleType] = h$1("linear");
33504
33711
  const [confidenceIntervalMethod, setConfidenceIntervalMethod] = h$1(
33505
33712
  confidenceIntervalMethods.length > 0 ? confidenceIntervalMethods[0] : "none"
33506
33713
  );
33714
+ const yAxisMaxConfig = { linear: yAxisMaxLinear, logarithmic: yAxisMaxLogarithmic };
33507
33715
  const getTab = (view) => {
33508
33716
  switch (view) {
33509
33717
  case "bar":
@@ -33559,10 +33767,9 @@ const PrevalenceOverTimeTabs = ({
33559
33767
  yAxisScaleType,
33560
33768
  setYAxisScaleType,
33561
33769
  data,
33562
- granularity,
33563
- confidenceIntervalMethods,
33564
33770
  confidenceIntervalMethod,
33565
- setConfidenceIntervalMethod
33771
+ setConfidenceIntervalMethod,
33772
+ ...componentProps
33566
33773
  }
33567
33774
  );
33568
33775
  return /* @__PURE__ */ u$2(Tabs, { tabs, toolbar });
@@ -33571,12 +33778,12 @@ const Toolbar$3 = ({
33571
33778
  activeTab,
33572
33779
  yAxisScaleType,
33573
33780
  setYAxisScaleType,
33574
- confidenceIntervalMethods,
33575
33781
  confidenceIntervalMethod,
33576
33782
  setConfidenceIntervalMethod,
33577
33783
  data,
33578
- granularity
33784
+ ...componentProps
33579
33785
  }) => {
33786
+ const { confidenceIntervalMethods, granularity } = componentProps;
33580
33787
  return /* @__PURE__ */ u$2(k$1, { children: [
33581
33788
  activeTab !== "Table" && /* @__PURE__ */ u$2(ScalingSelector, { yAxisScaleType, setYAxisScaleType }),
33582
33789
  (activeTab === "Bar" || activeTab === "Line") && /* @__PURE__ */ u$2(
@@ -33595,13 +33802,34 @@ const Toolbar$3 = ({
33595
33802
  filename: "prevalence_over_time.csv"
33596
33803
  }
33597
33804
  ),
33598
- /* @__PURE__ */ u$2(PrevalenceOverTimeInfo, {})
33805
+ /* @__PURE__ */ u$2(PrevalenceOverTimeInfo, { ...componentProps }),
33806
+ /* @__PURE__ */ u$2(Fullscreen, {})
33599
33807
  ] });
33600
33808
  };
33601
- const PrevalenceOverTimeInfo = () => {
33809
+ const PrevalenceOverTimeInfo = (componentProps) => {
33810
+ const { granularity, smoothingWindow, views } = componentProps;
33811
+ const lapis = x$1(LapisUrlContext);
33602
33812
  return /* @__PURE__ */ u$2(Info, { children: [
33603
33813
  /* @__PURE__ */ u$2(InfoHeadline1, { children: "Prevalence over time" }),
33604
- /* @__PURE__ */ u$2(InfoParagraph, { children: "Prevalence over time info." })
33814
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
33815
+ "This presents the proportion of one or more variants per ",
33816
+ /* @__PURE__ */ u$2("b", { children: granularity }),
33817
+ smoothingWindow > 0 && `, smoothed using a ${smoothingWindow}-${granularity} sliding window`,
33818
+ ". The proportion is calculated as the number of sequences of the variant(s) divided by the number of sequences that match the ",
33819
+ /* @__PURE__ */ u$2("code", { children: "denominatorFilter" }),
33820
+ " (see below)."
33821
+ ] }),
33822
+ /* @__PURE__ */ u$2(InfoParagraph, { children: 'Sequences that have no assigned date will not be shown in the line and bubble chart. They will show up in the bar and table view with date "unknown".' }),
33823
+ views.includes("bubble") && /* @__PURE__ */ u$2(k$1, { children: [
33824
+ /* @__PURE__ */ u$2(InfoHeadline2, { children: "Bubble chart" }),
33825
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
33826
+ "The size of the bubble scales with the total number of available sequences from the",
33827
+ " ",
33828
+ granularity,
33829
+ "."
33830
+ ] })
33831
+ ] }),
33832
+ /* @__PURE__ */ u$2(InfoComponentCode, { componentName: "prevalence-over-time", params: componentProps, lapisUrl: lapis })
33605
33833
  ] });
33606
33834
  };
33607
33835
  const maxInData = (data) => Math.max(...data.flatMap((variant) => variant.content.map((dataPoint) => dataPoint.prevalence)));
@@ -33645,10 +33873,8 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
33645
33873
  height: this.height,
33646
33874
  lapisDateField: this.lapisDateField,
33647
33875
  pageSize: this.pageSize,
33648
- yAxisMaxConfig: {
33649
- linear: this.yAxisMaxLinear,
33650
- logarithmic: this.yAxisMaxLogarithmic
33651
- }
33876
+ yAxisMaxLinear: this.yAxisMaxLinear,
33877
+ yAxisMaxLogarithmic: this.yAxisMaxLogarithmic
33652
33878
  }
33653
33879
  );
33654
33880
  }
@@ -33989,7 +34215,8 @@ const RelativeGrowthAdvantageToolbar = ({
33989
34215
  }) => {
33990
34216
  return /* @__PURE__ */ u$2(k$1, { children: [
33991
34217
  /* @__PURE__ */ u$2(ScalingSelector, { yAxisScaleType, setYAxisScaleType }),
33992
- /* @__PURE__ */ u$2(RelativeGrowthAdvantageInfo, { generationTime })
34218
+ /* @__PURE__ */ u$2(RelativeGrowthAdvantageInfo, { generationTime }),
34219
+ /* @__PURE__ */ u$2(Fullscreen, {})
33993
34220
  ] });
33994
34221
  };
33995
34222
  const RelativeGrowthAdvantageInfo = ({ generationTime }) => {
@@ -34171,12 +34398,21 @@ const AggregatedDataTabs = ({ data, views, fields, pageSize }) => {
34171
34398
  }
34172
34399
  };
34173
34400
  const tabs = views.map((view) => getTab(view));
34174
- return /* @__PURE__ */ u$2(Tabs, { tabs, toolbar: /* @__PURE__ */ u$2(Toolbar$2, { data }) });
34401
+ return /* @__PURE__ */ u$2(Tabs, { tabs, toolbar: /* @__PURE__ */ u$2(Toolbar$2, { data, fields }) });
34175
34402
  };
34176
- const Toolbar$2 = ({ data }) => {
34403
+ const Toolbar$2 = ({ data, fields }) => {
34177
34404
  return /* @__PURE__ */ u$2("div", { class: "flex flex-row", children: [
34178
34405
  /* @__PURE__ */ u$2(CsvDownloadButton, { className: "mx-1 btn btn-xs", getData: () => data, filename: "aggregate.csv" }),
34179
- /* @__PURE__ */ u$2(Info, { children: "Info for aggregate" })
34406
+ /* @__PURE__ */ u$2(Info, { children: [
34407
+ /* @__PURE__ */ u$2(InfoHeadline1, { children: "Aggregated data" }),
34408
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
34409
+ "This table shows the number and proportion of sequences stratified by the following fields:",
34410
+ " ",
34411
+ fields.join(", "),
34412
+ ". The proportion is calculated with respect to the total count within the filtered dataset."
34413
+ ] })
34414
+ ] }),
34415
+ /* @__PURE__ */ u$2(Fullscreen, {})
34180
34416
  ] });
34181
34417
  };
34182
34418
  var __defProp$7 = Object.defineProperty;
@@ -34425,9 +34661,24 @@ const NumberSequencesOverTimeInner = ({
34425
34661
  if (data === null) {
34426
34662
  return /* @__PURE__ */ u$2(NoDataDisplay, {});
34427
34663
  }
34428
- return /* @__PURE__ */ u$2(NumberSequencesOverTimeTabs, { views, data, granularity, pageSize });
34664
+ return /* @__PURE__ */ u$2(
34665
+ NumberSequencesOverTimeTabs,
34666
+ {
34667
+ views,
34668
+ data,
34669
+ granularity,
34670
+ smoothingWindow,
34671
+ pageSize
34672
+ }
34673
+ );
34429
34674
  };
34430
- const NumberSequencesOverTimeTabs = ({ views, data, granularity, pageSize }) => {
34675
+ const NumberSequencesOverTimeTabs = ({
34676
+ views,
34677
+ data,
34678
+ granularity,
34679
+ smoothingWindow,
34680
+ pageSize
34681
+ }) => {
34431
34682
  const [yAxisScaleType, setYAxisScaleType] = h$1("linear");
34432
34683
  const getTab = (view) => {
34433
34684
  switch (view) {
@@ -34460,6 +34711,7 @@ const NumberSequencesOverTimeTabs = ({ views, data, granularity, pageSize }) =>
34460
34711
  activeTab,
34461
34712
  data,
34462
34713
  granularity,
34714
+ smoothingWindow,
34463
34715
  yAxisScaleType,
34464
34716
  setYAxisScaleType
34465
34717
  }
@@ -34467,7 +34719,14 @@ const NumberSequencesOverTimeTabs = ({ views, data, granularity, pageSize }) =>
34467
34719
  }
34468
34720
  );
34469
34721
  };
34470
- const Toolbar$1 = ({ activeTab, data, granularity, yAxisScaleType, setYAxisScaleType }) => {
34722
+ const Toolbar$1 = ({
34723
+ activeTab,
34724
+ data,
34725
+ granularity,
34726
+ yAxisScaleType,
34727
+ setYAxisScaleType,
34728
+ smoothingWindow
34729
+ }) => {
34471
34730
  return /* @__PURE__ */ u$2(k$1, { children: [
34472
34731
  activeTab !== "Table" && /* @__PURE__ */ u$2(
34473
34732
  ScalingSelector,
@@ -34485,12 +34744,21 @@ const Toolbar$1 = ({ activeTab, data, granularity, yAxisScaleType, setYAxisScale
34485
34744
  filename: "number_of_sequences_over_time.csv"
34486
34745
  }
34487
34746
  ),
34488
- /* @__PURE__ */ u$2(NumberSequencesOverTimeInfo, {})
34747
+ /* @__PURE__ */ u$2(NumberSequencesOverTimeInfo, { granularity, smoothingWindow }),
34748
+ /* @__PURE__ */ u$2(Fullscreen, {})
34489
34749
  ] });
34490
34750
  };
34491
- const NumberSequencesOverTimeInfo = () => /* @__PURE__ */ u$2(Info, { children: [
34751
+ const NumberSequencesOverTimeInfo = ({
34752
+ granularity,
34753
+ smoothingWindow
34754
+ }) => /* @__PURE__ */ u$2(Info, { children: [
34492
34755
  /* @__PURE__ */ u$2(InfoHeadline1, { children: "Number of sequences over time" }),
34493
- /* @__PURE__ */ u$2(InfoParagraph, { children: /* @__PURE__ */ u$2("a", { href: "https://github.com/GenSpectrum/dashboard-components/issues/315", children: "TODO" }) })
34756
+ /* @__PURE__ */ u$2(InfoParagraph, { children: [
34757
+ "This presents the number of available sequences of a variant per ",
34758
+ /* @__PURE__ */ u$2("b", { children: granularity }),
34759
+ smoothingWindow > 0 && `, smoothed using a ${smoothingWindow}-${granularity} sliding window`,
34760
+ "."
34761
+ ] })
34494
34762
  ] });
34495
34763
  var __defProp$6 = Object.defineProperty;
34496
34764
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
@@ -34557,11 +34825,11 @@ __decorateClass$6([
34557
34825
  NumberSequencesOverTimeComponent = __decorateClass$6([
34558
34826
  t$2("gs-number-sequences-over-time")
34559
34827
  ], NumberSequencesOverTimeComponent);
34560
- function getFilteredMutationOverTimeData(data, displayedSegments, displayedMutationTypes, proportionInterval) {
34828
+ function getFilteredMutationOverTimeData(data, overallMutationData, displayedSegments, displayedMutationTypes, proportionInterval) {
34561
34829
  const filteredData = data.copy();
34562
34830
  filterDisplayedSegments(displayedSegments, filteredData);
34563
34831
  filterMutationTypes(displayedMutationTypes, filteredData);
34564
- filterProportion(filteredData, proportionInterval);
34832
+ filterProportion(filteredData, overallMutationData, proportionInterval);
34565
34833
  return filteredData;
34566
34834
  }
34567
34835
  function filterDisplayedSegments(displayedSegments, data) {
@@ -34586,12 +34854,17 @@ function filterMutationTypes(displayedMutationTypes, data) {
34586
34854
  }
34587
34855
  });
34588
34856
  }
34589
- function filterProportion(data, proportionInterval) {
34857
+ function filterProportion(data, overallMutationData, proportionInterval) {
34858
+ const overallProportionsByMutation = overallMutationData.content.reduce(
34859
+ (acc, { mutation, proportion }) => ({
34860
+ ...acc,
34861
+ [mutation.toString()]: proportion
34862
+ }),
34863
+ {}
34864
+ );
34590
34865
  data.getFirstAxisKeys().forEach((mutation) => {
34591
- const row = data.getRow(mutation, { count: 0, proportion: 0 });
34592
- if (!row.some(
34593
- (value) => value.proportion >= proportionInterval.min && value.proportion <= proportionInterval.max
34594
- )) {
34866
+ const overallProportion = overallProportionsByMutation[mutation.toString()] || -1;
34867
+ if (overallProportion < proportionInterval.min || overallProportion > proportionInterval.max) {
34595
34868
  data.deleteRow(mutation);
34596
34869
  }
34597
34870
  });
@@ -35671,6 +35944,9 @@ class Map2d {
35671
35944
  }
35672
35945
  }
35673
35946
  const MAX_NUMBER_OF_GRID_COLUMNS = 200;
35947
+ async function queryOverallMutationData(lapisFilter, sequenceType, lapis, signal) {
35948
+ return fetchAndPrepareSubstitutionsOrDeletions(lapisFilter, sequenceType).evaluate(lapis, signal);
35949
+ }
35674
35950
  async function queryMutationsOverTimeData(lapisFilter, sequenceType, lapis, lapisDateField, granularity, signal) {
35675
35951
  const allDates = await getDatesInDataset(lapisFilter, lapis, granularity, lapisDateField, signal);
35676
35952
  if (allDates.length > MAX_NUMBER_OF_GRID_COLUMNS) {
@@ -35782,7 +36058,11 @@ const MutationsOverTimeInner = ({
35782
36058
  }) => {
35783
36059
  const lapis = x$1(LapisUrlContext);
35784
36060
  const { data, error, isLoading } = useQuery(async () => {
35785
- return queryMutationsOverTimeData(lapisFilter, sequenceType, lapis, lapisDateField, granularity);
36061
+ const [mutationOverTimeData, overallMutationData] = await Promise.all([
36062
+ queryMutationsOverTimeData(lapisFilter, sequenceType, lapis, lapisDateField, granularity),
36063
+ queryOverallMutationData(lapisFilter, sequenceType, lapis)
36064
+ ]);
36065
+ return { mutationOverTimeData, overallMutationData };
35786
36066
  }, [lapisFilter, sequenceType, lapis, granularity, lapisDateField]);
35787
36067
  if (isLoading) {
35788
36068
  return /* @__PURE__ */ u$2(LoadingDisplay, {});
@@ -35793,12 +36073,21 @@ const MutationsOverTimeInner = ({
35793
36073
  if (data === null) {
35794
36074
  return /* @__PURE__ */ u$2(NoDataDisplay, {});
35795
36075
  }
35796
- return /* @__PURE__ */ u$2(MutationsOverTimeTabs, { mutationOverTimeData: data, sequenceType, views });
36076
+ return /* @__PURE__ */ u$2(
36077
+ MutationsOverTimeTabs,
36078
+ {
36079
+ overallMutationData: data.overallMutationData,
36080
+ mutationOverTimeData: data.mutationOverTimeData,
36081
+ sequenceType,
36082
+ views
36083
+ }
36084
+ );
35797
36085
  };
35798
36086
  const MutationsOverTimeTabs = ({
35799
36087
  mutationOverTimeData,
35800
36088
  sequenceType,
35801
- views
36089
+ views,
36090
+ overallMutationData
35802
36091
  }) => {
35803
36092
  const [proportionInterval, setProportionInterval] = h$1({ min: 0.05, max: 0.9 });
35804
36093
  const [colorScale, setColorScale] = h$1({ min: 0, max: 1, color: "indigo" });
@@ -35810,11 +36099,12 @@ const MutationsOverTimeTabs = ({
35810
36099
  const filteredData = T$1(
35811
36100
  () => getFilteredMutationOverTimeData(
35812
36101
  mutationOverTimeData,
36102
+ overallMutationData,
35813
36103
  displayedSegments,
35814
36104
  displayedMutationTypes,
35815
36105
  proportionInterval
35816
36106
  ),
35817
- [mutationOverTimeData, displayedSegments, displayedMutationTypes, proportionInterval]
36107
+ [mutationOverTimeData, overallMutationData, displayedSegments, displayedMutationTypes, proportionInterval]
35818
36108
  );
35819
36109
  const getTab = (view) => {
35820
36110
  switch (view) {
@@ -35881,7 +36171,8 @@ const Toolbar = ({
35881
36171
  filename: "mutations_over_time.csv"
35882
36172
  }
35883
36173
  ),
35884
- /* @__PURE__ */ u$2(Info, { children: "Info for mutations over time" })
36174
+ /* @__PURE__ */ u$2(Info, { children: "Info for mutations over time" }),
36175
+ /* @__PURE__ */ u$2(Fullscreen, {})
35885
36176
  ] });
35886
36177
  };
35887
36178
  function getDownloadData(filteredData) {