@genspectrum/dashboard-components 0.6.5 → 0.6.7

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 (44) hide show
  1. package/custom-elements.json +51 -3
  2. package/dist/dashboard-components.js +359 -159
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +3 -3
  5. package/dist/style.css +92 -8
  6. package/package.json +1 -1
  7. package/src/constants.ts +1 -0
  8. package/src/preact/aggregatedData/aggregate.tsx +1 -1
  9. package/src/preact/components/color-scale-selector-dropdown.stories.tsx +27 -0
  10. package/src/preact/components/color-scale-selector-dropdown.tsx +17 -0
  11. package/src/preact/components/color-scale-selector.stories.tsx +61 -0
  12. package/src/preact/components/color-scale-selector.tsx +79 -0
  13. package/src/preact/components/info.stories.tsx +37 -10
  14. package/src/preact/components/info.tsx +22 -43
  15. package/src/preact/components/min-max-range-slider.tsx +1 -1
  16. package/src/preact/components/tooltip.stories.tsx +12 -2
  17. package/src/preact/components/tooltip.tsx +38 -14
  18. package/src/preact/mutationComparison/mutation-comparison.tsx +1 -1
  19. package/src/preact/mutationFilter/mutation-filter-info.tsx +1 -1
  20. package/src/preact/mutationFilter/mutation-filter.stories.tsx +1 -1
  21. package/src/preact/mutationFilter/mutation-filter.tsx +2 -3
  22. package/src/preact/mutations/mutations.tsx +1 -1
  23. package/src/preact/mutationsOverTime/__mockData__/aggregated_byDay.json +38 -0
  24. package/src/preact/mutationsOverTime/__mockData__/aggregated_byWeek.json +122 -0
  25. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_20_01_2024.json +6778 -0
  26. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_21_01_2024.json +7129 -0
  27. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_22_01_2024.json +4681 -0
  28. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_23_01_2024.json +10738 -0
  29. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_24_01_2024.json +11710 -0
  30. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_25_01_2024.json +11557 -0
  31. package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_26_01_2024.json +8596 -0
  32. package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week3_2024.json +8812 -0
  33. package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week4_2024.json +9730 -0
  34. package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week5_2024.json +9865 -0
  35. package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week6_2024.json +11314 -0
  36. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +83 -40
  37. package/src/preact/mutationsOverTime/mutations-over-time.tsx +50 -11
  38. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +1 -1
  39. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +1 -1
  40. package/src/preact/shared/charts/colors.ts +1 -1
  41. package/src/utils/temporal.spec.ts +3 -4
  42. package/src/utils/temporal.ts +9 -4
  43. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +262 -2
  44. package/src/preact/shared/icons/DeleteIcon.tsx +0 -17
@@ -6,7 +6,7 @@ import { options, createContext as createContext$1, Fragment, render } from "pre
6
6
  import { Grid } from "gridjs";
7
7
  import { Chart, registerables, Scale } from "chart.js";
8
8
  import { VennDiagramController, ArcSlice, extractSets } from "chartjs-chart-venn";
9
- import { autoUpdate, computePosition, offset, shift, flip, size } from "@floating-ui/dom";
9
+ import { autoUpdate, computePosition, offset, shift, flip } from "@floating-ui/dom";
10
10
  import { ReactiveElement } from "@lit/reactive-element";
11
11
  import { BarWithErrorBarsController, BarWithErrorBar } from "chartjs-chart-error-bars";
12
12
  import hash from "object-hash";
@@ -1361,58 +1361,32 @@ const ErrorDisplay = ({ error }) => {
1361
1361
  ] })
1362
1362
  ] });
1363
1363
  };
1364
- const ResizeContainer = ({ children, size: size2 }) => {
1365
- return /* @__PURE__ */ u$1("div", { style: size2, children });
1364
+ const ResizeContainer = ({ children, size }) => {
1365
+ return /* @__PURE__ */ u$1("div", { style: size, children });
1366
1366
  };
1367
- const ErrorBoundary = ({ size: size2, children }) => {
1367
+ const ErrorBoundary = ({ size, children }) => {
1368
1368
  const [internalError] = b2();
1369
1369
  if (internalError) {
1370
- return /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(ErrorDisplay, { error: internalError }) });
1370
+ return /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(ErrorDisplay, { error: internalError }) });
1371
1371
  }
1372
1372
  return /* @__PURE__ */ u$1(Fragment, { children });
1373
1373
  };
1374
- const Info = ({ children, height }) => {
1375
- const [showHelp, setShowHelp] = h(false);
1376
- const referenceRef = A(null);
1377
- const floatingRef = A(null);
1378
- useFloatingUi(referenceRef, floatingRef, [
1379
- offset(10),
1380
- shift(),
1381
- size({
1382
- apply() {
1383
- if (!floatingRef.current) {
1384
- return;
1385
- }
1386
- floatingRef.current.style.width = "100vw";
1387
- floatingRef.current.style.height = height ? height : "50vh";
1388
- }
1389
- })
1390
- ]);
1374
+ const Info = ({ children }) => {
1375
+ const dialogRef = A(null);
1391
1376
  const toggleHelp = () => {
1392
- setShowHelp(!showHelp);
1377
+ var _a;
1378
+ (_a = dialogRef.current) == null ? void 0 : _a.showModal();
1393
1379
  };
1394
- useCloseOnEsc(setShowHelp);
1395
- useCloseOnClickOutside(floatingRef, referenceRef, setShowHelp);
1396
1380
  return /* @__PURE__ */ u$1("div", { className: "relative", children: [
1397
- /* @__PURE__ */ u$1("button", { type: "button", className: "btn btn-xs", onClick: toggleHelp, ref: referenceRef, children: "?" }),
1398
- /* @__PURE__ */ u$1(
1399
- "div",
1400
- {
1401
- ref: floatingRef,
1402
- className: `${dropdownClass} overflow-y-auto opacity-90 ${showHelp ? "" : "hidden"}`,
1403
- children: [
1404
- /* @__PURE__ */ u$1("div", { className: "flex flex-col", children }),
1405
- /* @__PURE__ */ u$1(
1406
- "button",
1407
- {
1408
- onClick: () => setShowHelp(false),
1409
- className: "float-right underline text-sm hover:text-blue-700 mr-2",
1410
- children: "Close"
1411
- }
1412
- )
1413
- ]
1414
- }
1415
- )
1381
+ /* @__PURE__ */ u$1("button", { type: "button", className: "btn btn-xs", onClick: toggleHelp, children: "?" }),
1382
+ /* @__PURE__ */ u$1("dialog", { ref: dialogRef, className: "modal modal-bottom sm:modal-middle", children: [
1383
+ /* @__PURE__ */ u$1("div", { className: "modal-box", children: [
1384
+ /* @__PURE__ */ u$1("form", { method: "dialog", children: /* @__PURE__ */ u$1("button", { className: "btn btn-sm btn-circle btn-ghost absolute right-2 top-2", children: "✕" }) }),
1385
+ /* @__PURE__ */ u$1("div", { className: "flex flex-col", children }),
1386
+ /* @__PURE__ */ u$1("div", { className: "modal-action", children: /* @__PURE__ */ u$1("form", { method: "dialog", children: /* @__PURE__ */ u$1("button", { className: "float-right underline text-sm hover:text-blue-700 mr-2", children: "Close" }) }) })
1387
+ ] }),
1388
+ /* @__PURE__ */ u$1("form", { method: "dialog", className: "modal-backdrop", children: /* @__PURE__ */ u$1("button", { children: "Helper to close when clicked outside" }) })
1389
+ ] })
1416
1390
  ] });
1417
1391
  };
1418
1392
  const InfoHeadline1 = ({ children }) => {
@@ -1495,7 +1469,7 @@ const MinMaxRangeSlider = ({
1495
1469
  ${sliderColor} ${max}%,
1496
1470
  ${sliderColor} 100%)
1497
1471
  `;
1498
- return /* @__PURE__ */ u$1("div", { class: "my-4 relative", children: [
1472
+ return /* @__PURE__ */ u$1("div", { class: "my-4 relative w-full h-full", children: [
1499
1473
  /* @__PURE__ */ u$1(
1500
1474
  "input",
1501
1475
  {
@@ -1676,8 +1650,8 @@ function useQuery(fetchDataCallback, dependencies = []) {
1676
1650
  return { data, error, isLoading };
1677
1651
  }
1678
1652
  const MutationComparison = ({ width, height, ...innerProps }) => {
1679
- const size2 = { height, width };
1680
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(MutationComparisonInner, { ...innerProps }) }) });
1653
+ const size = { height, width };
1654
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationComparisonInner, { ...innerProps }) }) });
1681
1655
  };
1682
1656
  const MutationComparisonInner = ({
1683
1657
  lapisFilters,
@@ -1805,7 +1779,7 @@ const Toolbar$5 = ({
1805
1779
  filename: "mutation_comparison.csv"
1806
1780
  }
1807
1781
  ),
1808
- /* @__PURE__ */ u$1(Info, { height: "100px", children: "Info for mutation comparison" })
1782
+ /* @__PURE__ */ u$1(Info, { children: "Info for mutation comparison" })
1809
1783
  ] });
1810
1784
  };
1811
1785
  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 */';
@@ -2863,6 +2837,11 @@ html {
2863
2837
  visibility: visible;
2864
2838
  opacity: 1;
2865
2839
  }
2840
+ .modal-action {
2841
+ display: flex;
2842
+ margin-top: 1.5rem;
2843
+ justify-content: flex-end;
2844
+ }
2866
2845
  :root:has(:is(.modal-open, .modal:target, .modal-toggle:checked + .modal, .modal[open])) {
2867
2846
  overflow: hidden;
2868
2847
  scrollbar-gutter: stable;
@@ -3389,6 +3368,11 @@ input.tab:checked + .tab-content,
3389
3368
  --tw-scale-y: 1;
3390
3369
  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));
3391
3370
  }
3371
+ .modal-action > :not([hidden]) ~ :not([hidden]) {
3372
+ --tw-space-x-reverse: 0;
3373
+ margin-right: calc(0.5rem * var(--tw-space-x-reverse));
3374
+ margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
3375
+ }
3392
3376
  @keyframes modal-pop {
3393
3377
 
3394
3378
  0% {
@@ -3963,6 +3947,9 @@ input.tab:checked + .tab-content,
3963
3947
  border-end-end-radius: inherit;
3964
3948
  border-start-end-radius: inherit;
3965
3949
  }
3950
+ .modal-bottom {
3951
+ place-items: end;
3952
+ }
3966
3953
  .select-xs {
3967
3954
  height: 1.5rem;
3968
3955
  min-height: 1.5rem;
@@ -4202,6 +4189,9 @@ input.tab:checked + .tab-content,
4202
4189
  .visible {
4203
4190
  visibility: visible;
4204
4191
  }
4192
+ .invisible {
4193
+ visibility: hidden;
4194
+ }
4205
4195
  .static {
4206
4196
  position: static;
4207
4197
  }
@@ -4217,18 +4207,39 @@ input.tab:checked + .tab-content,
4217
4207
  .-top-3 {
4218
4208
  top: -0.75rem;
4219
4209
  }
4210
+ .bottom-full {
4211
+ bottom: 100%;
4212
+ }
4220
4213
  .left-0 {
4221
4214
  left: 0px;
4222
4215
  }
4216
+ .left-1\\/2 {
4217
+ left: 50%;
4218
+ }
4219
+ .left-full {
4220
+ left: 100%;
4221
+ }
4222
+ .right-0 {
4223
+ right: 0px;
4224
+ }
4223
4225
  .right-2 {
4224
4226
  right: 0.5rem;
4225
4227
  }
4228
+ .right-full {
4229
+ right: 100%;
4230
+ }
4226
4231
  .top-0 {
4227
4232
  top: 0px;
4228
4233
  }
4234
+ .top-1\\/2 {
4235
+ top: 50%;
4236
+ }
4229
4237
  .top-2 {
4230
4238
  top: 0.5rem;
4231
4239
  }
4240
+ .top-full {
4241
+ top: 100%;
4242
+ }
4232
4243
  .z-10 {
4233
4244
  z-index: 10;
4234
4245
  }
@@ -4245,6 +4256,10 @@ input.tab:checked + .tab-content,
4245
4256
  margin-left: 0.25rem;
4246
4257
  margin-right: 0.25rem;
4247
4258
  }
4259
+ .mx-2 {
4260
+ margin-left: 0.5rem;
4261
+ margin-right: 0.5rem;
4262
+ }
4248
4263
  .mx-auto {
4249
4264
  margin-left: auto;
4250
4265
  margin-right: auto;
@@ -4257,18 +4272,30 @@ input.tab:checked + .tab-content,
4257
4272
  margin-top: 1rem;
4258
4273
  margin-bottom: 1rem;
4259
4274
  }
4275
+ .mb-1 {
4276
+ margin-bottom: 0.25rem;
4277
+ }
4260
4278
  .mb-2 {
4261
4279
  margin-bottom: 0.5rem;
4262
4280
  }
4281
+ .ml-1 {
4282
+ margin-left: 0.25rem;
4283
+ }
4263
4284
  .ml-2\\.5 {
4264
4285
  margin-left: 0.625rem;
4265
4286
  }
4266
4287
  .ml-3 {
4267
4288
  margin-left: 0.75rem;
4268
4289
  }
4290
+ .mr-1 {
4291
+ margin-right: 0.25rem;
4292
+ }
4269
4293
  .mr-2 {
4270
4294
  margin-right: 0.5rem;
4271
4295
  }
4296
+ .mt-1 {
4297
+ margin-top: 0.25rem;
4298
+ }
4272
4299
  .mt-4 {
4273
4300
  margin-top: 1rem;
4274
4301
  }
@@ -4290,9 +4317,15 @@ input.tab:checked + .tab-content,
4290
4317
  .hidden {
4291
4318
  display: none;
4292
4319
  }
4320
+ .h-8 {
4321
+ height: 2rem;
4322
+ }
4293
4323
  .h-full {
4294
4324
  height: 100%;
4295
4325
  }
4326
+ .w-10 {
4327
+ width: 2.5rem;
4328
+ }
4296
4329
  .w-16 {
4297
4330
  width: 4rem;
4298
4331
  }
@@ -4327,6 +4360,14 @@ input.tab:checked + .tab-content,
4327
4360
  .grow {
4328
4361
  flex-grow: 1;
4329
4362
  }
4363
+ .translate-x-\\[-50\\%\\] {
4364
+ --tw-translate-x: -50%;
4365
+ 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));
4366
+ }
4367
+ .translate-y-\\[-50\\%\\] {
4368
+ --tw-translate-y: -50%;
4369
+ 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));
4370
+ }
4330
4371
  .resize {
4331
4372
  resize: both;
4332
4373
  }
@@ -4360,9 +4401,6 @@ input.tab:checked + .tab-content,
4360
4401
  .overflow-auto {
4361
4402
  overflow: auto;
4362
4403
  }
4363
- .overflow-y-auto {
4364
- overflow-y: auto;
4365
- }
4366
4404
  .whitespace-nowrap {
4367
4405
  white-space: nowrap;
4368
4406
  }
@@ -4427,6 +4465,10 @@ input.tab:checked + .tab-content,
4427
4465
  --tw-border-opacity: 1;
4428
4466
  border-color: rgb(239 68 68 / var(--tw-border-opacity));
4429
4467
  }
4468
+ .bg-red-200 {
4469
+ --tw-bg-opacity: 1;
4470
+ background-color: rgb(254 202 202 / var(--tw-bg-opacity));
4471
+ }
4430
4472
  .bg-white {
4431
4473
  --tw-bg-opacity: 1;
4432
4474
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -4525,9 +4567,6 @@ input.tab:checked + .tab-content,
4525
4567
  .underline {
4526
4568
  text-decoration-line: underline;
4527
4569
  }
4528
- .opacity-90 {
4529
- opacity: 0.9;
4530
- }
4531
4570
  .shadow {
4532
4571
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
4533
4572
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
@@ -4553,6 +4592,25 @@ input.tab:checked + .tab-content,
4553
4592
  .duration-150 {
4554
4593
  transition-duration: 150ms;
4555
4594
  }
4595
+ @media (min-width: 640px) {
4596
+
4597
+ .sm\\:modal-middle {
4598
+ place-items: center;
4599
+ }
4600
+
4601
+ .sm\\:modal-middle :where(.modal-box) {
4602
+ width: 91.666667%;
4603
+ max-width: 32rem;
4604
+ --tw-translate-y: 0px;
4605
+ --tw-scale-x: .9;
4606
+ --tw-scale-y: .9;
4607
+ 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));
4608
+ border-top-left-radius: var(--rounded-box, 1rem);
4609
+ border-top-right-radius: var(--rounded-box, 1rem);
4610
+ border-bottom-right-radius: var(--rounded-box, 1rem);
4611
+ border-bottom-left-radius: var(--rounded-box, 1rem);
4612
+ }
4613
+ }
4556
4614
  .focus-within\\:border-gray-400:focus-within {
4557
4615
  --tw-border-opacity: 1;
4558
4616
  border-color: rgb(156 163 175 / var(--tw-border-opacity));
@@ -4589,8 +4647,8 @@ input.tab:checked + .tab-content,
4589
4647
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
4590
4648
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
4591
4649
  }
4592
- .peer:hover ~ .peer-hover\\:block {
4593
- display: block;
4650
+ .peer:hover ~ .peer-hover\\:visible {
4651
+ visibility: visible;
4594
4652
  }`;
4595
4653
  var __defProp$c = Object.defineProperty;
4596
4654
  var __decorateClass$c = (decorators, target, key, kind) => {
@@ -4950,8 +5008,8 @@ function filterMutationsData(data, displayedSegments, displayedMutationTypes) {
4950
5008
  };
4951
5009
  }
4952
5010
  const Mutations = ({ width, height, ...innerProps }) => {
4953
- const size2 = { height, width };
4954
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(MutationsInner, { ...innerProps }) }) });
5011
+ const size = { height, width };
5012
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsInner, { ...innerProps }) }) });
4955
5013
  };
4956
5014
  const MutationsInner = ({
4957
5015
  lapisFilter,
@@ -5082,7 +5140,7 @@ const Toolbar$4 = ({
5082
5140
  filename: "insertions.csv"
5083
5141
  }
5084
5142
  ),
5085
- /* @__PURE__ */ u$1(Info, { height: "100px", children: "Info for mutations" })
5143
+ /* @__PURE__ */ u$1(Info, { children: "Info for mutations" })
5086
5144
  ] });
5087
5145
  };
5088
5146
  var __defProp$a = Object.defineProperty;
@@ -5892,6 +5950,7 @@ const isoWeek = function(o2, c2, d2) {
5892
5950
  };
5893
5951
  dayjs.extend(isoWeek);
5894
5952
  dayjs.extend(advancedFormat);
5953
+ const FORMAT_ISO_WEEK_YEAR_WEEK = "GGGG-[W]WW";
5895
5954
  const _TemporalCache = class _TemporalCache {
5896
5955
  constructor() {
5897
5956
  this.yearMonthDayCache = /* @__PURE__ */ new Map();
@@ -5960,7 +6019,7 @@ class YearMonthDay {
5960
6019
  return this.cache.getYearMonth(this.dayjs.format("YYYY-MM"));
5961
6020
  }
5962
6021
  get week() {
5963
- return this.cache.getYearWeek(this.dayjs.format("GGGG-WW"));
6022
+ return this.cache.getYearWeek(this.dayjs.format(FORMAT_ISO_WEEK_YEAR_WEEK));
5964
6023
  }
5965
6024
  addDays(days) {
5966
6025
  const date = this.dayjs.add(days, "day");
@@ -5982,7 +6041,7 @@ class YearWeek {
5982
6041
  this.cache = cache;
5983
6042
  }
5984
6043
  get text() {
5985
- return this.firstDay.dayjs.format("YYYY-WW");
6044
+ return this.firstDay.dayjs.format(FORMAT_ISO_WEEK_YEAR_WEEK);
5986
6045
  }
5987
6046
  toString() {
5988
6047
  return this.text;
@@ -6004,14 +6063,14 @@ class YearWeek {
6004
6063
  }
6005
6064
  addWeeks(weeks) {
6006
6065
  const date = this.firstDay.dayjs.add(weeks, "week");
6007
- const s2 = date.format("YYYY-WW");
6066
+ const s2 = date.format(FORMAT_ISO_WEEK_YEAR_WEEK);
6008
6067
  return this.cache.getYearWeek(s2);
6009
6068
  }
6010
6069
  minus(other) {
6011
6070
  return this.firstDay.dayjs.diff(other.firstDay.dayjs, "week");
6012
6071
  }
6013
6072
  static parse(s2, cache) {
6014
- const [year, week] = s2.split("-").map((s22) => parseInt(s22, 10));
6073
+ const [year, week] = s2.split("-W").map((s22) => parseInt(s22, 10));
6015
6074
  return new YearWeek(year, week, cache);
6016
6075
  }
6017
6076
  }
@@ -6766,8 +6825,8 @@ const ScalingSelector = ({
6766
6825
  );
6767
6826
  };
6768
6827
  const PrevalenceOverTime = ({ width, height, ...innerProps }) => {
6769
- const size2 = { height, width };
6770
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(PrevalenceOverTimeInner, { ...innerProps }) }) });
6828
+ const size = { height, width };
6829
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(PrevalenceOverTimeInner, { ...innerProps }) }) });
6771
6830
  };
6772
6831
  const PrevalenceOverTimeInner = ({
6773
6832
  numeratorFilter,
@@ -6920,7 +6979,7 @@ const Toolbar$3 = ({
6920
6979
  ] });
6921
6980
  };
6922
6981
  const PrevalenceOverTimeInfo = () => {
6923
- return /* @__PURE__ */ u$1(Info, { height: "100px", children: [
6982
+ return /* @__PURE__ */ u$1(Info, { children: [
6924
6983
  /* @__PURE__ */ u$1(InfoHeadline1, { children: "Prevalence over time" }),
6925
6984
  /* @__PURE__ */ u$1(InfoParagraph, { children: "Prevalence over time info." })
6926
6985
  ] });
@@ -7226,8 +7285,8 @@ const RelativeGrowthAdvantage = ({
7226
7285
  height,
7227
7286
  ...innerProps
7228
7287
  }) => {
7229
- const size2 = { height, width };
7230
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...innerProps }) }) });
7288
+ const size = { height, width };
7289
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(RelativeGrowthAdvantageInner, { ...innerProps }) }) });
7231
7290
  };
7232
7291
  const RelativeGrowthAdvantageInner = ({
7233
7292
  numeratorFilter,
@@ -7455,8 +7514,8 @@ const AggregateTable = ({ data, fields, pageSize }) => {
7455
7514
  return /* @__PURE__ */ u$1(Table, { data, columns: headers, pageSize });
7456
7515
  };
7457
7516
  const Aggregate = ({ width, height, ...innerProps }) => {
7458
- const size2 = { height, width };
7459
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(AggregateInner, { ...innerProps }) }) });
7517
+ const size = { height, width };
7518
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(AggregateInner, { ...innerProps }) }) });
7460
7519
  };
7461
7520
  const AggregateInner = ({
7462
7521
  fields,
@@ -7497,7 +7556,7 @@ const AggregatedDataTabs = ({ data, views, fields, pageSize }) => {
7497
7556
  const Toolbar$2 = ({ data }) => {
7498
7557
  return /* @__PURE__ */ u$1("div", { class: "flex flex-row", children: [
7499
7558
  /* @__PURE__ */ u$1(CsvDownloadButton, { className: "mx-1 btn btn-xs", getData: () => data, filename: "aggregate.csv" }),
7500
- /* @__PURE__ */ u$1(Info, { height: "100px", children: "Info for aggregate" })
7559
+ /* @__PURE__ */ u$1(Info, { children: "Info for aggregate" })
7501
7560
  ] });
7502
7561
  };
7503
7562
  var __defProp$7 = Object.defineProperty;
@@ -7722,8 +7781,8 @@ async function queryNumberOfSequencesOverTime(lapis, lapisFilter, lapisDateField
7722
7781
  return Promise.all(queries);
7723
7782
  }
7724
7783
  const NumberSequencesOverTime = ({ width, height, ...innerProps }) => {
7725
- const size2 = { height, width };
7726
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...innerProps }) }) });
7784
+ const size = { height, width };
7785
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(NumberSequencesOverTimeInner, { ...innerProps }) }) });
7727
7786
  };
7728
7787
  const NumberSequencesOverTimeInner = ({
7729
7788
  lapisFilter,
@@ -7809,7 +7868,7 @@ const Toolbar$1 = ({ activeTab, data, granularity, yAxisScaleType, setYAxisScale
7809
7868
  /* @__PURE__ */ u$1(NumberSequencesOverTimeInfo, {})
7810
7869
  ] });
7811
7870
  };
7812
- const NumberSequencesOverTimeInfo = () => /* @__PURE__ */ u$1(Info, { height: "100px", children: [
7871
+ const NumberSequencesOverTimeInfo = () => /* @__PURE__ */ u$1(Info, { children: [
7813
7872
  /* @__PURE__ */ u$1(InfoHeadline1, { children: "Number of sequences over time" }),
7814
7873
  /* @__PURE__ */ u$1(InfoParagraph, { children: /* @__PURE__ */ u$1("a", { href: "https://github.com/GenSpectrum/dashboard-components/issues/315", children: "TODO" }) })
7815
7874
  ] });
@@ -7917,20 +7976,105 @@ function filterProportion(data, proportionInterval) {
7917
7976
  }
7918
7977
  });
7919
7978
  }
7920
- const Tooltip = ({ children, content }) => {
7921
- const referenceRef = A(null);
7922
- const floatingRef = A(null);
7923
- useFloatingUi(referenceRef, floatingRef, [offset(5), shift(), flip()]);
7924
- return /* @__PURE__ */ u$1("div", { className: "relative", children: [
7925
- /* @__PURE__ */ u$1("div", { className: "peer", ref: referenceRef, children }),
7926
- /* @__PURE__ */ u$1("div", { ref: floatingRef, className: `${dropdownClass} hidden peer-hover:block`, children: content })
7979
+ const ColorScaleSelector = ({ colorScale, setColorScale }) => {
7980
+ const colorDisplayCss = `w-10 h-8 border border-gray-200 mx-2 text-xs flex items-center justify-center`;
7981
+ return /* @__PURE__ */ u$1("div", { className: "flex items-center", children: [
7982
+ /* @__PURE__ */ u$1(
7983
+ "div",
7984
+ {
7985
+ style: {
7986
+ backgroundColor: singleGraphColorRGBByName(colorScale.color, 0),
7987
+ color: "black"
7988
+ },
7989
+ className: colorDisplayCss,
7990
+ children: formatProportion(colorScale.min, 0)
7991
+ }
7992
+ ),
7993
+ /* @__PURE__ */ u$1("div", { className: "w-64", children: /* @__PURE__ */ u$1(
7994
+ MinMaxRangeSlider,
7995
+ {
7996
+ min: colorScale.min * 100,
7997
+ max: colorScale.max * 100,
7998
+ setMin: (percentage) => {
7999
+ setColorScale({ ...colorScale, min: percentage / 100 });
8000
+ },
8001
+ setMax: (percentage) => {
8002
+ setColorScale({ ...colorScale, max: percentage / 100 });
8003
+ }
8004
+ }
8005
+ ) }),
8006
+ /* @__PURE__ */ u$1(
8007
+ "div",
8008
+ {
8009
+ style: {
8010
+ backgroundColor: singleGraphColorRGBByName(colorScale.color, 1),
8011
+ color: "white"
8012
+ },
8013
+ className: colorDisplayCss,
8014
+ children: formatProportion(colorScale.max, 0)
8015
+ }
8016
+ )
8017
+ ] });
8018
+ };
8019
+ const getColorWithingScale = (value, colorScale) => {
8020
+ if (colorScale.min === colorScale.max) {
8021
+ return singleGraphColorRGBByName(colorScale.color, 0);
8022
+ }
8023
+ const colorRange = colorScale.max - colorScale.min;
8024
+ const alpha = (value - colorScale.min) / colorRange;
8025
+ return singleGraphColorRGBByName(colorScale.color, alpha);
8026
+ };
8027
+ const getTextColorForScale = (value, colorScale) => {
8028
+ if (colorScale.min === colorScale.max) {
8029
+ return "black";
8030
+ }
8031
+ const colorRange = colorScale.max - colorScale.min;
8032
+ const alpha = (value - colorScale.min) / colorRange;
8033
+ return alpha <= 0.5 ? "black" : "white";
8034
+ };
8035
+ function getPositionCss(position) {
8036
+ switch (position) {
8037
+ case "top":
8038
+ return "bottom-full translate-x-[-50%] left-1/2 mb-1";
8039
+ case "top-start":
8040
+ return "bottom-full mr-1 mb-1";
8041
+ case "top-end":
8042
+ return "bottom-full right-0 ml-1 mb-1";
8043
+ case "bottom":
8044
+ return "top-full translate-x-[-50%] left-1/2 mt-1";
8045
+ case "bottom-start":
8046
+ return "mr-1 mt-1";
8047
+ case "bottom-end":
8048
+ return "right-0 ml-1 mt-1";
8049
+ case "left":
8050
+ return "right-full translate-y-[-50%] top-1/2 mr-1";
8051
+ case "right":
8052
+ return "left-full translate-y-[-50%] top-1/2 ml-1";
8053
+ case void 0:
8054
+ return "";
8055
+ }
8056
+ }
8057
+ const Tooltip = ({ children, content, position = "bottom" }) => {
8058
+ return /* @__PURE__ */ u$1("div", { className: "relative w-full h-full", children: [
8059
+ /* @__PURE__ */ u$1("div", { className: "peer w-full h-full", children }),
8060
+ /* @__PURE__ */ u$1(
8061
+ "div",
8062
+ {
8063
+ className: `absolute z-10 w-max bg-white p-4 border border-gray-200 rounded-md invisible peer-hover:visible ${getPositionCss(position)}`,
8064
+ children: content
8065
+ }
8066
+ )
7927
8067
  ] });
7928
8068
  };
7929
8069
  const MAX_NUMBER_OF_GRID_ROWS = 100;
7930
- const MutationsOverTimeGrid = ({ data }) => {
8070
+ const MUTATION_CELL_WIDTH_REM = 8;
8071
+ const MutationsOverTimeGrid = ({ data, colorScale }) => {
7931
8072
  const allMutations = data.getFirstAxisKeys();
7932
8073
  const shownMutations = allMutations.slice(0, MAX_NUMBER_OF_GRID_ROWS);
7933
8074
  const dates = data.getSecondAxisKeys().sort((a2, b3) => compareTemporal(a2, b3));
8075
+ const [showProportionText, setShowProportionText] = h(false);
8076
+ const gridRef = A(null);
8077
+ useShowProportion(gridRef, dates.length, setShowProportionText);
7934
8078
  return /* @__PURE__ */ u$1(Fragment, { children: [
7935
8079
  allMutations.length > MAX_NUMBER_OF_GRID_ROWS && /* @__PURE__ */ u$1("div", { className: "pl-2", children: [
7936
8080
  "Showing ",
@@ -7942,28 +8086,45 @@ const MutationsOverTimeGrid = ({ data }) => {
7942
8086
  /* @__PURE__ */ u$1(
7943
8087
  "div",
7944
8088
  {
8089
+ ref: gridRef,
7945
8090
  style: {
7946
8091
  display: "grid",
7947
8092
  gridTemplateRows: `repeat(${shownMutations.length}, 24px)`,
7948
- gridTemplateColumns: `8rem repeat(${dates.length}, minmax(1.5rem, 1fr))`
8093
+ gridTemplateColumns: `${MUTATION_CELL_WIDTH_REM}rem repeat(${dates.length}, minmax(0.05rem, 1fr))`
7949
8094
  },
7950
- children: shownMutations.map((mutation, i2) => {
8095
+ children: shownMutations.map((mutation, rowIndex) => {
7951
8096
  return /* @__PURE__ */ u$1(Fragment, { children: [
7952
8097
  /* @__PURE__ */ u$1(
7953
8098
  "div",
7954
8099
  {
7955
- style: { gridRowStart: i2 + 1, gridColumnStart: 1 },
8100
+ style: { gridRowStart: rowIndex + 1, gridColumnStart: 1 },
7956
8101
  children: /* @__PURE__ */ u$1(MutationCell, { mutation })
7957
8102
  },
7958
8103
  `mutation-${mutation.toString()}`
7959
8104
  ),
7960
- dates.map((date, j2) => {
8105
+ dates.map((date, columnIndex) => {
7961
8106
  const value = data.get(mutation, date) ?? { proportion: 0, count: 0 };
8107
+ const tooltipPosition = getTooltipPosition(
8108
+ rowIndex,
8109
+ shownMutations.length,
8110
+ columnIndex,
8111
+ dates.length
8112
+ );
7962
8113
  return /* @__PURE__ */ u$1(
7963
8114
  "div",
7964
8115
  {
7965
- style: { gridRowStart: i2 + 1, gridColumnStart: j2 + 2 },
7966
- children: /* @__PURE__ */ u$1(ProportionCell, { value, date, mutation })
8116
+ style: { gridRowStart: rowIndex + 1, gridColumnStart: columnIndex + 2 },
8117
+ children: /* @__PURE__ */ u$1(
8118
+ ProportionCell,
8119
+ {
8120
+ value,
8121
+ date,
8122
+ mutation,
8123
+ tooltipPosition,
8124
+ showProportionText,
8125
+ colorScale
8126
+ }
8127
+ )
7967
8128
  },
7968
8129
  `${mutation.toString()}-${date.toString()}`
7969
8130
  );
@@ -7974,11 +8135,34 @@ const MutationsOverTimeGrid = ({ data }) => {
7974
8135
  )
7975
8136
  ] });
7976
8137
  };
7977
- const ProportionCell = ({ value, mutation, date }) => {
8138
+ function useShowProportion(gridRef, girdColumns, setShowProportionText) {
8139
+ y(() => {
8140
+ const checkWidth = () => {
8141
+ if (gridRef.current) {
8142
+ const width = gridRef.current.getBoundingClientRect().width;
8143
+ const widthPerDate = (width - remToPx(MUTATION_CELL_WIDTH_REM)) / girdColumns;
8144
+ const maxWidthProportionText = 28;
8145
+ setShowProportionText(widthPerDate > maxWidthProportionText);
8146
+ }
8147
+ };
8148
+ checkWidth();
8149
+ window.addEventListener("resize", checkWidth);
8150
+ return () => {
8151
+ window.removeEventListener("resize", checkWidth);
8152
+ };
8153
+ }, [girdColumns, gridRef, setShowProportionText]);
8154
+ }
8155
+ const remToPx = (rem) => rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
8156
+ function getTooltipPosition(rowIndex, rows, columnIndex, columns) {
8157
+ const tooltipX = rowIndex < rows / 2 ? "bottom" : "top";
8158
+ const tooltipY = columnIndex < columns / 2 ? "start" : "end";
8159
+ return `${tooltipX}-${tooltipY}`;
8160
+ }
8161
+ const ProportionCell = ({ value, mutation, date, tooltipPosition, showProportionText, colorScale }) => {
7978
8162
  const tooltipContent = /* @__PURE__ */ u$1("div", { children: [
8163
+ /* @__PURE__ */ u$1("p", { children: /* @__PURE__ */ u$1("span", { className: "font-bold", children: date.englishName() }) }),
7979
8164
  /* @__PURE__ */ u$1("p", { children: [
7980
- /* @__PURE__ */ u$1("span", { className: "font-bold", children: date.englishName() }),
7981
- " (",
8165
+ "(",
7982
8166
  timeIntervalDisplay(date),
7983
8167
  ")"
7984
8168
  ] }),
@@ -7992,17 +8176,17 @@ const ProportionCell = ({ value, mutation, date }) => {
7992
8176
  value.count
7993
8177
  ] })
7994
8178
  ] });
7995
- return /* @__PURE__ */ u$1(Fragment, { children: /* @__PURE__ */ u$1("div", { className: "py-1", children: /* @__PURE__ */ u$1(Tooltip, { content: tooltipContent, children: /* @__PURE__ */ u$1(
8179
+ return /* @__PURE__ */ u$1("div", { className: "py-1 w-full h-full", children: /* @__PURE__ */ u$1(Tooltip, { content: tooltipContent, position: tooltipPosition, children: /* @__PURE__ */ u$1(
7996
8180
  "div",
7997
8181
  {
7998
8182
  style: {
7999
- backgroundColor: backgroundColor(value.proportion),
8000
- color: textColor(value.proportion)
8183
+ backgroundColor: getColorWithingScale(value.proportion, colorScale),
8184
+ color: getTextColorForScale(value.proportion, colorScale)
8001
8185
  },
8002
- className: "text-center hover:font-bold text-xs",
8003
- children: formatProportion(value.proportion, 0)
8186
+ className: `w-full h-full text-center hover:font-bold text-xs group`,
8187
+ children: showProportionText ? formatProportion(value.proportion, 0) : void 0
8004
8188
  }
8005
- ) }) }) });
8189
+ ) }) });
8006
8190
  };
8007
8191
  const timeIntervalDisplay = (date) => {
8008
8192
  if (date instanceof YearMonthDay) {
@@ -8010,15 +8194,6 @@ const timeIntervalDisplay = (date) => {
8010
8194
  }
8011
8195
  return `${date.firstDay.toString()} - ${date.lastDay.toString()}`;
8012
8196
  };
8013
- const backgroundColor = (proportion) => {
8014
- const minAlpha = 0;
8015
- const maxAlpha = 1;
8016
- const alpha = minAlpha + (maxAlpha - minAlpha) * proportion;
8017
- return singleGraphColorRGBByName("indigo", alpha);
8018
- };
8019
- const textColor = (proportion) => {
8020
- return proportion > 0.5 ? "white" : "black";
8021
- };
8022
8197
  const MutationCell = ({ mutation }) => {
8023
8198
  return /* @__PURE__ */ u$1("div", { className: "text-center", children: mutation.toString() });
8024
8199
  };
@@ -8177,9 +8352,15 @@ function addZeroValuesForDatesWithNoMutationData(dataArray, data) {
8177
8352
  });
8178
8353
  }
8179
8354
  }
8355
+ const ColorScaleSelectorDropdown = ({
8356
+ colorScale,
8357
+ setColorScale
8358
+ }) => {
8359
+ return /* @__PURE__ */ u$1(Dropdown, { buttonTitle: `Color scale`, placement: "bottom-start", children: /* @__PURE__ */ u$1(ColorScaleSelector, { colorScale, setColorScale }) });
8360
+ };
8180
8361
  const MutationsOverTime = ({ width, height, ...innerProps }) => {
8181
- const size2 = { height, width };
8182
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(MutationsOverTimeInner, { ...innerProps }) }) });
8362
+ const size = { height, width };
8363
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(MutationsOverTimeInner, { ...innerProps }) }) });
8183
8364
  };
8184
8365
  const MutationsOverTimeInner = ({
8185
8366
  lapisFilter,
@@ -8209,6 +8390,7 @@ const MutationsOverTimeTabs = ({
8209
8390
  views
8210
8391
  }) => {
8211
8392
  const [proportionInterval, setProportionInterval] = h({ min: 0.05, max: 0.9 });
8393
+ const [colorScale, setColorScale] = h({ min: 0, max: 1, color: "indigo" });
8212
8394
  const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(sequenceType);
8213
8395
  const [displayedMutationTypes, setDisplayedMutationTypes] = h([
8214
8396
  { label: "Substitutions", checked: true, type: "substitution" },
@@ -8228,33 +8410,42 @@ const MutationsOverTimeTabs = ({
8228
8410
  case "grid":
8229
8411
  return {
8230
8412
  title: "Grid",
8231
- content: /* @__PURE__ */ u$1(MutationsOverTimeGrid, { data: filteredData })
8413
+ content: /* @__PURE__ */ u$1(MutationsOverTimeGrid, { data: filteredData, colorScale })
8232
8414
  };
8233
8415
  }
8234
8416
  };
8235
8417
  const tabs = views.map((view) => getTab(view));
8236
- const toolbar = () => /* @__PURE__ */ u$1(
8418
+ const toolbar = (activeTab) => /* @__PURE__ */ u$1(
8237
8419
  Toolbar,
8238
8420
  {
8421
+ activeTab,
8239
8422
  displayedSegments,
8240
8423
  setDisplayedSegments,
8241
8424
  displayedMutationTypes,
8242
8425
  setDisplayedMutationTypes,
8243
8426
  proportionInterval,
8244
- setProportionInterval
8427
+ setProportionInterval,
8428
+ filteredData,
8429
+ colorScale,
8430
+ setColorScale
8245
8431
  }
8246
8432
  );
8247
8433
  return /* @__PURE__ */ u$1(Tabs, { tabs, toolbar });
8248
8434
  };
8249
8435
  const Toolbar = ({
8436
+ activeTab,
8250
8437
  displayedSegments,
8251
8438
  setDisplayedSegments,
8252
8439
  displayedMutationTypes,
8253
8440
  setDisplayedMutationTypes,
8254
8441
  proportionInterval,
8255
- setProportionInterval
8442
+ setProportionInterval,
8443
+ filteredData,
8444
+ colorScale,
8445
+ setColorScale
8256
8446
  }) => {
8257
8447
  return /* @__PURE__ */ u$1(Fragment, { children: [
8448
+ activeTab === "Grid" && /* @__PURE__ */ u$1(ColorScaleSelectorDropdown, { colorScale, setColorScale }),
8258
8449
  /* @__PURE__ */ u$1(SegmentSelector, { displayedSegments, setDisplayedSegments }),
8259
8450
  /* @__PURE__ */ u$1(
8260
8451
  MutationTypeSelector,
@@ -8263,17 +8454,41 @@ const Toolbar = ({
8263
8454
  displayedMutationTypes
8264
8455
  }
8265
8456
  ),
8266
- /* @__PURE__ */ u$1(Fragment, { children: /* @__PURE__ */ u$1(
8457
+ /* @__PURE__ */ u$1(
8267
8458
  ProportionSelectorDropdown,
8268
8459
  {
8269
8460
  proportionInterval,
8270
8461
  setMinProportion: (min) => setProportionInterval((prev) => ({ ...prev, min })),
8271
8462
  setMaxProportion: (max) => setProportionInterval((prev) => ({ ...prev, max }))
8272
8463
  }
8273
- ) }),
8274
- /* @__PURE__ */ u$1(Info, { height: "100px", children: "Info for mutations over time" })
8464
+ ),
8465
+ /* @__PURE__ */ u$1(
8466
+ CsvDownloadButton,
8467
+ {
8468
+ className: "mx-1 btn btn-xs",
8469
+ getData: () => getDownloadData(filteredData),
8470
+ filename: "mutations_over_time.csv"
8471
+ }
8472
+ ),
8473
+ /* @__PURE__ */ u$1(Info, { children: "Info for mutations over time" })
8275
8474
  ] });
8276
8475
  };
8476
+ function getDownloadData(filteredData) {
8477
+ const dates = filteredData.getSecondAxisKeys().sort((a2, b3) => compareTemporal(a2, b3));
8478
+ return filteredData.getFirstAxisKeys().map((mutation) => {
8479
+ return dates.reduce(
8480
+ (accumulated, date) => {
8481
+ var _a;
8482
+ const proportion = ((_a = filteredData.get(mutation, date)) == null ? void 0 : _a.proportion) ?? 0;
8483
+ return {
8484
+ ...accumulated,
8485
+ [date.toString()]: proportion
8486
+ };
8487
+ },
8488
+ { mutation: mutation.toString() }
8489
+ );
8490
+ });
8491
+ }
8277
8492
  var __defProp$5 = Object.defineProperty;
8278
8493
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
8279
8494
  var __decorateClass$5 = (decorators, target, key, kind) => {
@@ -8450,8 +8665,8 @@ const DateRangeSelector = ({
8450
8665
  width,
8451
8666
  ...innerProps
8452
8667
  }) => {
8453
- const size2 = { width, height: "3rem" };
8454
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1("div", { style: { width }, children: /* @__PURE__ */ u$1(DateRangeSelectorInner, { ...innerProps }) }) });
8668
+ const size = { width, height: "3rem" };
8669
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1("div", { style: { width }, children: /* @__PURE__ */ u$1(DateRangeSelectorInner, { ...innerProps }) }) });
8455
8670
  };
8456
8671
  const DateRangeSelectorInner = ({
8457
8672
  customSelectOptions,
@@ -8698,8 +8913,8 @@ function compareLocationEntries(fields) {
8698
8913
  };
8699
8914
  }
8700
8915
  const LocationFilter = ({ width, ...innerProps }) => {
8701
- const size2 = { width, height: "3rem" };
8702
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(LocationFilterInner, { ...innerProps }) }) });
8916
+ const size = { width, height: "3rem" };
8917
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(LocationFilterInner, { ...innerProps }) }) });
8703
8918
  };
8704
8919
  const LocationFilterInner = ({ initialValue, fields, placeholderText }) => {
8705
8920
  const lapis = x(LapisUrlContext);
@@ -8818,8 +9033,8 @@ async function fetchAutocompleteList(lapis, field, signal) {
8818
9033
  return data.map((item) => item[field]);
8819
9034
  }
8820
9035
  const TextInput = ({ width, ...innerProps }) => {
8821
- const size2 = { width, height: "3rem" };
8822
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(TextInputInner, { ...innerProps }) }) });
9036
+ const size = { width, height: "3rem" };
9037
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(TextInputInner, { ...innerProps }) }) });
8823
9038
  };
8824
9039
  const TextInputInner = ({ lapisField, placeholderText, initialValue }) => {
8825
9040
  const lapis = x(LapisUrlContext);
@@ -8927,7 +9142,7 @@ function isNotInitialized(referenceGenome) {
8927
9142
  const MutationFilterInfo = () => {
8928
9143
  const referenceGenome = x(ReferenceGenomeContext);
8929
9144
  const firstGene = referenceGenome.genes[0].name;
8930
- return /* @__PURE__ */ u$1(Info, { height: "80vh", children: [
9145
+ return /* @__PURE__ */ u$1(Info, { children: [
8931
9146
  /* @__PURE__ */ u$1(InfoHeadline1, { children: " Mutation Filter" }),
8932
9147
  /* @__PURE__ */ u$1(InfoParagraph, { children: "This component allows you to filter for mutations at specific positions." }),
8933
9148
  /* @__PURE__ */ u$1(InfoHeadline2, { children: " Nucleotide Mutations and Insertions" }),
@@ -9187,21 +9402,6 @@ const parseAndValidateMutation = (value, referenceGenome) => {
9187
9402
  }
9188
9403
  return null;
9189
9404
  };
9190
- const DeleteIcon = () => {
9191
- return /* @__PURE__ */ u$1(
9192
- "svg",
9193
- {
9194
- fill: "currentColor",
9195
- "stroke-width": "0",
9196
- xmlns: "http://www.w3.org/2000/svg",
9197
- viewBox: "0 0 16 16",
9198
- style: "overflow: visible; color: currentcolor;",
9199
- height: "1em",
9200
- width: "1em",
9201
- children: /* @__PURE__ */ u$1("path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" })
9202
- }
9203
- );
9204
- };
9205
9405
  const MutationFilter = ({ initialValue, width }) => {
9206
9406
  return /* @__PURE__ */ u$1(ErrorBoundary, { size: { height: "3.375rem", width }, children: /* @__PURE__ */ u$1("div", { style: width, children: /* @__PURE__ */ u$1(MutationFilterInner, { initialValue }) }) });
9207
9407
  };
@@ -9370,71 +9570,71 @@ const SelectedMutationDisplay = ({ selectedFilters, setSelectedFilters, fireChan
9370
9570
  ] });
9371
9571
  };
9372
9572
  const SelectedAminoAcidInsertion = ({ insertion, onDelete }) => {
9373
- const backgroundColor2 = singleGraphColorRGBByName("teal", 0.3);
9374
- const textColor2 = singleGraphColorRGBByName("teal", 1);
9573
+ const backgroundColor = singleGraphColorRGBByName("teal", 0.3);
9574
+ const textColor = singleGraphColorRGBByName("teal", 1);
9375
9575
  return /* @__PURE__ */ u$1(
9376
9576
  SelectedFilter,
9377
9577
  {
9378
9578
  mutation: insertion,
9379
9579
  onDelete,
9380
- backgroundColor: backgroundColor2,
9381
- textColor: textColor2
9580
+ backgroundColor,
9581
+ textColor
9382
9582
  }
9383
9583
  );
9384
9584
  };
9385
9585
  const SelectedAminoAcidMutation = ({ mutation, onDelete }) => {
9386
- const backgroundColor2 = singleGraphColorRGBByName("rose", 0.3);
9387
- const textColor2 = singleGraphColorRGBByName("rose", 1);
9586
+ const backgroundColor = singleGraphColorRGBByName("rose", 0.3);
9587
+ const textColor = singleGraphColorRGBByName("rose", 1);
9388
9588
  return /* @__PURE__ */ u$1(
9389
9589
  SelectedFilter,
9390
9590
  {
9391
9591
  mutation,
9392
9592
  onDelete,
9393
- backgroundColor: backgroundColor2,
9394
- textColor: textColor2
9593
+ backgroundColor,
9594
+ textColor
9395
9595
  }
9396
9596
  );
9397
9597
  };
9398
9598
  const SelectedNucleotideMutation = ({ mutation, onDelete }) => {
9399
- const backgroundColor2 = singleGraphColorRGBByName("indigo", 0.3);
9400
- const textColor2 = singleGraphColorRGBByName("indigo", 1);
9599
+ const backgroundColor = singleGraphColorRGBByName("indigo", 0.3);
9600
+ const textColor = singleGraphColorRGBByName("indigo", 1);
9401
9601
  return /* @__PURE__ */ u$1(
9402
9602
  SelectedFilter,
9403
9603
  {
9404
9604
  mutation,
9405
9605
  onDelete,
9406
- backgroundColor: backgroundColor2,
9407
- textColor: textColor2
9606
+ backgroundColor,
9607
+ textColor
9408
9608
  }
9409
9609
  );
9410
9610
  };
9411
9611
  const SelectedNucleotideInsertion = ({ insertion, onDelete }) => {
9412
- const backgroundColor2 = singleGraphColorRGBByName("green", 0.3);
9413
- const textColor2 = singleGraphColorRGBByName("green", 1);
9612
+ const backgroundColor = singleGraphColorRGBByName("green", 0.3);
9613
+ const textColor = singleGraphColorRGBByName("green", 1);
9414
9614
  return /* @__PURE__ */ u$1(
9415
9615
  SelectedFilter,
9416
9616
  {
9417
9617
  mutation: insertion,
9418
9618
  onDelete,
9419
- backgroundColor: backgroundColor2,
9420
- textColor: textColor2
9619
+ backgroundColor,
9620
+ textColor
9421
9621
  }
9422
9622
  );
9423
9623
  };
9424
9624
  const SelectedFilter = ({
9425
9625
  mutation,
9426
9626
  onDelete,
9427
- backgroundColor: backgroundColor2,
9428
- textColor: textColor2
9627
+ backgroundColor,
9628
+ textColor
9429
9629
  }) => {
9430
9630
  return /* @__PURE__ */ u$1(
9431
9631
  "span",
9432
9632
  {
9433
9633
  class: "inline-block mx-1 px-2 py-1 font-medium text-xs rounded-full",
9434
- style: { backgroundColor: backgroundColor2, color: textColor2 },
9634
+ style: { backgroundColor, color: textColor },
9435
9635
  children: [
9436
9636
  mutation.toString(),
9437
- /* @__PURE__ */ u$1("button", { type: "button", onClick: () => onDelete(mutation), children: /* @__PURE__ */ u$1(DeleteIcon, {}) })
9637
+ /* @__PURE__ */ u$1("button", { className: "ml-1", type: "button", onClick: () => onDelete(mutation), children: "✕" })
9438
9638
  ]
9439
9639
  }
9440
9640
  );
@@ -9482,8 +9682,8 @@ async function fetchLineageAutocompleteList(lapis, field, signal) {
9482
9682
  return data.flatMap((item) => [item[field], `${item[field]}*`]).sort();
9483
9683
  }
9484
9684
  const LineageFilter = ({ width, ...innerProps }) => {
9485
- const size2 = { width, height: "3rem" };
9486
- return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(LineageFilterInner, { ...innerProps }) }) });
9685
+ const size = { width, height: "3rem" };
9686
+ return /* @__PURE__ */ u$1(ErrorBoundary, { size, children: /* @__PURE__ */ u$1(ResizeContainer, { size, children: /* @__PURE__ */ u$1(LineageFilterInner, { ...innerProps }) }) });
9487
9687
  };
9488
9688
  const LineageFilterInner = ({
9489
9689
  lapisField,