@genspectrum/dashboard-components 0.8.2 → 0.8.3

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.
@@ -1001,21 +1001,20 @@ const GsChart = ({ configuration }) => {
1001
1001
  return;
1002
1002
  }
1003
1003
  chartRef.current = new Chart(ctx, configuration);
1004
- resizeChartAfterFullscreenChange(chartRef, ctx, configuration);
1004
+ const resizeChartAfterFullscreenChange = () => {
1005
+ var _a;
1006
+ (_a = chartRef.current) == null ? void 0 : _a.destroy();
1007
+ chartRef.current = new Chart(ctx, configuration);
1008
+ };
1009
+ document.addEventListener("fullscreenchange", resizeChartAfterFullscreenChange);
1005
1010
  return () => {
1006
1011
  var _a;
1012
+ document.removeEventListener("fullscreenchange", resizeChartAfterFullscreenChange);
1007
1013
  (_a = chartRef.current) == null ? void 0 : _a.destroy();
1008
1014
  };
1009
1015
  }, [canvasRef, configuration]);
1010
1016
  return /* @__PURE__ */ u$1("canvas", { ref: canvasRef });
1011
1017
  };
1012
- const resizeChartAfterFullscreenChange = (chartRef, ctx, configuration) => {
1013
- document.addEventListener("fullscreenchange", () => {
1014
- var _a;
1015
- (_a = chartRef.current) == null ? void 0 : _a.destroy();
1016
- chartRef.current = new Chart(ctx, configuration);
1017
- });
1018
- };
1019
1018
  Chart.register(...registerables, VennDiagramController, ArcSlice);
1020
1019
  const MutationComparisonVenn = ({
1021
1020
  data,
@@ -2195,7 +2194,7 @@ const tailwindStyle = `*, ::before, ::after {
2195
2194
  --tw-contain-paint: ;
2196
2195
  --tw-contain-style: ;
2197
2196
  }/*
2198
- ! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com
2197
+ ! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com
2199
2198
  *//*
2200
2199
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2201
2200
  2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
@@ -4907,35 +4906,35 @@ input.tab:checked + .tab-content,
4907
4906
  }
4908
4907
  .border-error {
4909
4908
  --tw-border-opacity: 1;
4910
- border-color: var(--fallback-er,oklch(var(--er)/var(--tw-border-opacity)));
4909
+ border-color: var(--fallback-er,oklch(var(--er)/var(--tw-border-opacity, 1)));
4911
4910
  }
4912
4911
  .border-gray-100 {
4913
4912
  --tw-border-opacity: 1;
4914
- border-color: rgb(243 244 246 / var(--tw-border-opacity));
4913
+ border-color: rgb(243 244 246 / var(--tw-border-opacity, 1));
4915
4914
  }
4916
4915
  .border-gray-200 {
4917
4916
  --tw-border-opacity: 1;
4918
- border-color: rgb(229 231 235 / var(--tw-border-opacity));
4917
+ border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));
4919
4918
  }
4920
4919
  .border-gray-300 {
4921
4920
  --tw-border-opacity: 1;
4922
- border-color: rgb(209 213 219 / var(--tw-border-opacity));
4921
+ border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
4923
4922
  }
4924
4923
  .border-gray-400 {
4925
4924
  --tw-border-opacity: 1;
4926
- border-color: rgb(156 163 175 / var(--tw-border-opacity));
4925
+ border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));
4927
4926
  }
4928
4927
  .border-red-500 {
4929
4928
  --tw-border-opacity: 1;
4930
- border-color: rgb(239 68 68 / var(--tw-border-opacity));
4929
+ border-color: rgb(239 68 68 / var(--tw-border-opacity, 1));
4931
4930
  }
4932
4931
  .bg-red-200 {
4933
4932
  --tw-bg-opacity: 1;
4934
- background-color: rgb(254 202 202 / var(--tw-bg-opacity));
4933
+ background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));
4935
4934
  }
4936
4935
  .bg-white {
4937
4936
  --tw-bg-opacity: 1;
4938
- background-color: rgb(255 255 255 / var(--tw-bg-opacity));
4937
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
4939
4938
  }
4940
4939
  .p-1 {
4941
4940
  padding: 0.25rem;
@@ -5014,23 +5013,23 @@ input.tab:checked + .tab-content,
5014
5013
  }
5015
5014
  .text-\\[\\#606060\\] {
5016
5015
  --tw-text-opacity: 1;
5017
- color: rgb(96 96 96 / var(--tw-text-opacity));
5016
+ color: rgb(96 96 96 / var(--tw-text-opacity, 1));
5018
5017
  }
5019
5018
  .text-blue-600 {
5020
5019
  --tw-text-opacity: 1;
5021
- color: rgb(37 99 235 / var(--tw-text-opacity));
5020
+ color: rgb(37 99 235 / var(--tw-text-opacity, 1));
5022
5021
  }
5023
5022
  .text-gray-600 {
5024
5023
  --tw-text-opacity: 1;
5025
- color: rgb(75 85 99 / var(--tw-text-opacity));
5024
+ color: rgb(75 85 99 / var(--tw-text-opacity, 1));
5026
5025
  }
5027
5026
  .text-neutral-500 {
5028
5027
  --tw-text-opacity: 1;
5029
- color: rgb(115 115 115 / var(--tw-text-opacity));
5028
+ color: rgb(115 115 115 / var(--tw-text-opacity, 1));
5030
5029
  }
5031
5030
  .text-red-700 {
5032
5031
  --tw-text-opacity: 1;
5033
- color: rgb(185 28 28 / var(--tw-text-opacity));
5032
+ color: rgb(185 28 28 / var(--tw-text-opacity, 1));
5034
5033
  }
5035
5034
  .underline {
5036
5035
  text-decoration-line: underline;
@@ -5060,6 +5059,9 @@ input.tab:checked + .tab-content,
5060
5059
  .duration-150 {
5061
5060
  transition-duration: 150ms;
5062
5061
  }
5062
+ .\\@container {
5063
+ container-type: inline-size;
5064
+ }
5063
5065
  .mdi--fullscreen {
5064
5066
  --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");
5065
5067
  }
@@ -5090,7 +5092,7 @@ input.tab:checked + .tab-content,
5090
5092
  }
5091
5093
  .focus-within\\:border-gray-400:focus-within {
5092
5094
  --tw-border-opacity: 1;
5093
- border-color: rgb(156 163 175 / var(--tw-border-opacity));
5095
+ border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));
5094
5096
  }
5095
5097
  .hover\\:scale-110:hover {
5096
5098
  --tw-scale-x: 1.1;
@@ -5104,26 +5106,26 @@ input.tab:checked + .tab-content,
5104
5106
  }
5105
5107
  .hover\\:bg-gray-100:hover {
5106
5108
  --tw-bg-opacity: 1;
5107
- background-color: rgb(243 244 246 / var(--tw-bg-opacity));
5109
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
5108
5110
  }
5109
5111
  .hover\\:font-bold:hover {
5110
5112
  font-weight: 700;
5111
5113
  }
5112
5114
  .hover\\:text-blue-700:hover {
5113
5115
  --tw-text-opacity: 1;
5114
- color: rgb(29 78 216 / var(--tw-text-opacity));
5116
+ color: rgb(29 78 216 / var(--tw-text-opacity, 1));
5115
5117
  }
5116
5118
  .hover\\:text-blue-800:hover {
5117
5119
  --tw-text-opacity: 1;
5118
- color: rgb(30 64 175 / var(--tw-text-opacity));
5120
+ color: rgb(30 64 175 / var(--tw-text-opacity, 1));
5119
5121
  }
5120
5122
  .hover\\:text-gray-400:hover {
5121
5123
  --tw-text-opacity: 1;
5122
- color: rgb(156 163 175 / var(--tw-text-opacity));
5124
+ color: rgb(156 163 175 / var(--tw-text-opacity, 1));
5123
5125
  }
5124
5126
  .hover\\:text-gray-700:hover {
5125
5127
  --tw-text-opacity: 1;
5126
- color: rgb(55 65 81 / var(--tw-text-opacity));
5128
+ color: rgb(55 65 81 / var(--tw-text-opacity, 1));
5127
5129
  }
5128
5130
  .focus\\:outline-none:focus {
5129
5131
  outline: 2px solid transparent;
@@ -5137,6 +5139,12 @@ input.tab:checked + .tab-content,
5137
5139
  .peer:hover ~ .peer-hover\\:visible {
5138
5140
  visibility: visible;
5139
5141
  }
5142
+ @container (min-width: 30rem) {
5143
+
5144
+ .\\@\\[30rem\\]\\:visible {
5145
+ visibility: visible;
5146
+ }
5147
+ }
5140
5148
  @media (min-width: 640px) {
5141
5149
 
5142
5150
  .sm\\:max-w-5xl {
@@ -8801,9 +8809,7 @@ const MutationsOverTimeGrid = ({ data, colorScale }) => {
8801
8809
  const allMutations = data.getFirstAxisKeys();
8802
8810
  const shownMutations = allMutations.slice(0, MAX_NUMBER_OF_GRID_ROWS);
8803
8811
  const dates = data.getSecondAxisKeys();
8804
- const [showProportionText, setShowProportionText] = h(false);
8805
8812
  const gridRef = A(null);
8806
- useShowProportion(gridRef, dates.length, setShowProportionText);
8807
8813
  return /* @__PURE__ */ u$1(Fragment, { children: [
8808
8814
  allMutations.length > MAX_NUMBER_OF_GRID_ROWS && /* @__PURE__ */ u$1("div", { className: "pl-2", children: [
8809
8815
  "Showing ",
@@ -8822,6 +8828,7 @@ const MutationsOverTimeGrid = ({ data, colorScale }) => {
8822
8828
  gridTemplateRows: `repeat(${shownMutations.length}, 24px)`,
8823
8829
  gridTemplateColumns: `${MUTATION_CELL_WIDTH_REM}rem repeat(${dates.length}, minmax(0.05rem, 1fr))`
8824
8830
  },
8831
+ className: "@container",
8825
8832
  children: shownMutations.map((mutation, rowIndex) => {
8826
8833
  return /* @__PURE__ */ u$1(Fragment, { children: [
8827
8834
  /* @__PURE__ */ u$1(
@@ -8851,7 +8858,6 @@ const MutationsOverTimeGrid = ({ data, colorScale }) => {
8851
8858
  date,
8852
8859
  mutation,
8853
8860
  tooltipPosition,
8854
- showProportionText,
8855
8861
  colorScale
8856
8862
  }
8857
8863
  )
@@ -8865,30 +8871,12 @@ const MutationsOverTimeGrid = ({ data, colorScale }) => {
8865
8871
  )
8866
8872
  ] });
8867
8873
  };
8868
- function useShowProportion(gridRef, girdColumns, setShowProportionText) {
8869
- y(() => {
8870
- const checkWidth = () => {
8871
- if (gridRef.current) {
8872
- const width = gridRef.current.getBoundingClientRect().width;
8873
- const widthPerDate = (width - remToPx(MUTATION_CELL_WIDTH_REM)) / girdColumns;
8874
- const maxWidthProportionText = 28;
8875
- setShowProportionText(widthPerDate > maxWidthProportionText);
8876
- }
8877
- };
8878
- checkWidth();
8879
- window.addEventListener("resize", checkWidth);
8880
- return () => {
8881
- window.removeEventListener("resize", checkWidth);
8882
- };
8883
- }, [girdColumns, gridRef, setShowProportionText]);
8884
- }
8885
- const remToPx = (rem) => rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
8886
8874
  function getTooltipPosition(rowIndex, rows, columnIndex, columns) {
8887
8875
  const tooltipX = rowIndex < rows / 2 ? "bottom" : "top";
8888
8876
  const tooltipY = columnIndex < columns / 2 ? "start" : "end";
8889
8877
  return `${tooltipX}-${tooltipY}`;
8890
8878
  }
8891
- const ProportionCell = ({ value, mutation, date, tooltipPosition, showProportionText, colorScale }) => {
8879
+ const ProportionCell = ({ value, mutation, date, tooltipPosition, colorScale }) => {
8892
8880
  const dateClass = toTemporalClass(date);
8893
8881
  const tooltipContent = /* @__PURE__ */ u$1("div", { children: [
8894
8882
  /* @__PURE__ */ u$1("p", { children: /* @__PURE__ */ u$1("span", { className: "font-bold", children: dateClass.englishName() }) }),
@@ -8918,7 +8906,7 @@ const ProportionCell = ({ value, mutation, date, tooltipPosition, showProportion
8918
8906
  color: getTextColorForScale(value.proportion, colorScale)
8919
8907
  },
8920
8908
  className: `w-full h-full text-center hover:font-bold text-xs group`,
8921
- children: showProportionText ? formatProportion(value.proportion, 0) : void 0
8909
+ children: /* @__PURE__ */ u$1("span", { className: "invisible @[30rem]:visible", children: formatProportion(value.proportion, 0) })
8922
8910
  }
8923
8911
  ) }) });
8924
8912
  };