@haniffalab/cherita-react 1.4.1-dev.2025-10-23.e95b5a90 → 1.4.1-dev.2025-10-23.55fbe6ff

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 (126) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/controls/Controls.js +4 -4
  3. package/dist/cjs/components/dotplot/Dotplot.js +8 -8
  4. package/dist/cjs/components/dotplot/DotplotControls.js +5 -5
  5. package/dist/cjs/components/full-page/FullPage.js +1 -2
  6. package/dist/cjs/components/full-page/PlotAlert.js +1 -1
  7. package/dist/cjs/components/full-page/PlotTypeSelector.js +13 -13
  8. package/dist/cjs/components/heatmap/Heatmap.js +7 -7
  9. package/dist/cjs/components/icons/DotPlotIcon.js +1 -1
  10. package/dist/cjs/components/icons/HeatmapIcon.js +1 -1
  11. package/dist/cjs/components/icons/MatrixPlotIcon.1.js +1 -1
  12. package/dist/cjs/components/icons/MatrixPlotIcon.js +1 -1
  13. package/dist/cjs/components/icons/ScatterplotIcon.1.js +1 -1
  14. package/dist/cjs/components/icons/ScatterplotIcon.js +1 -1
  15. package/dist/cjs/components/icons/ViolinPlotIcon.js +1 -1
  16. package/dist/cjs/components/matrixplot/Matrixplot.js +7 -7
  17. package/dist/cjs/components/obs-list/ObsItem.js +19 -19
  18. package/dist/cjs/components/obs-list/ObsList.js +17 -17
  19. package/dist/cjs/components/obsm-list/ObsmList.js +7 -7
  20. package/dist/cjs/components/pseudospatial/Pseudospatial.js +16 -16
  21. package/dist/cjs/components/pseudospatial/PseudospatialToolbar.js +10 -10
  22. package/dist/cjs/components/scatterplot/Scatterplot.js +16 -16
  23. package/dist/cjs/components/scatterplot/ScatterplotControls.js +1 -1
  24. package/dist/cjs/components/scatterplot/SpatialControls.js +9 -9
  25. package/dist/cjs/components/scatterplot/Toolbox.js +4 -4
  26. package/dist/cjs/components/search-bar/SearchBar.js +14 -14
  27. package/dist/cjs/components/search-bar/SearchInfo.js +3 -3
  28. package/dist/cjs/components/search-bar/SearchResults.js +2 -2
  29. package/dist/cjs/components/toolbar/Toolbar.js +3 -3
  30. package/dist/cjs/components/var-list/VarItem.js +15 -15
  31. package/dist/cjs/components/var-list/VarList.js +5 -5
  32. package/dist/cjs/components/var-list/VarListToolbar.js +4 -4
  33. package/dist/cjs/components/var-list/VarSet.js +13 -13
  34. package/dist/cjs/components/violin/Violin.js +10 -10
  35. package/dist/cjs/constants/colorscales.js +19 -19
  36. package/dist/cjs/constants/constants.js +47 -47
  37. package/dist/cjs/context/DatasetContext.js +3 -3
  38. package/dist/cjs/context/FilterContext.js +2 -2
  39. package/dist/cjs/context/SettingsContext.js +57 -57
  40. package/dist/cjs/helpers/color-helper.js +2 -2
  41. package/dist/cjs/helpers/zarr-helper.js +3 -3
  42. package/dist/cjs/utils/Filter.js +1 -1
  43. package/dist/cjs/utils/Histogram.js +2 -2
  44. package/dist/cjs/utils/ImageViewer.js +2 -2
  45. package/dist/cjs/utils/Legend.js +1 -1
  46. package/dist/cjs/utils/LoadingIndicators.js +1 -1
  47. package/dist/cjs/utils/Resolver.js +7 -7
  48. package/dist/cjs/utils/Skeleton.js +1 -1
  49. package/dist/cjs/utils/StyledTooltip.js +5 -5
  50. package/dist/cjs/utils/VirtualizedList.js +7 -7
  51. package/dist/cjs/utils/errors.js +15 -15
  52. package/dist/cjs/utils/requests.js +5 -5
  53. package/dist/cjs/utils/search.js +4 -4
  54. package/dist/cjs/utils/string.js +6 -6
  55. package/dist/cjs/utils/zarrData.js +5 -5
  56. package/dist/css/cherita.css +21 -20
  57. package/dist/css/cherita.css.map +1 -1
  58. package/dist/esm/components/controls/Controls.js +9 -9
  59. package/dist/esm/components/dotplot/Dotplot.js +21 -21
  60. package/dist/esm/components/dotplot/DotplotControls.js +9 -9
  61. package/dist/esm/components/full-page/FullPage.js +22 -23
  62. package/dist/esm/components/full-page/PlotAlert.js +5 -5
  63. package/dist/esm/components/full-page/PlotTypeSelector.js +21 -21
  64. package/dist/esm/components/heatmap/Heatmap.js +20 -20
  65. package/dist/esm/components/heatmap/HeatmapControls.js +2 -2
  66. package/dist/esm/components/icons/DotPlotIcon.js +1 -1
  67. package/dist/esm/components/icons/HeatmapIcon.js +1 -1
  68. package/dist/esm/components/icons/MatrixPlotIcon.1.js +1 -1
  69. package/dist/esm/components/icons/MatrixPlotIcon.js +1 -1
  70. package/dist/esm/components/icons/ScatterplotIcon.1.js +1 -1
  71. package/dist/esm/components/icons/ScatterplotIcon.js +1 -1
  72. package/dist/esm/components/icons/ViolinPlotIcon.js +1 -1
  73. package/dist/esm/components/matrixplot/Matrixplot.js +20 -20
  74. package/dist/esm/components/matrixplot/MatrixplotControls.js +2 -2
  75. package/dist/esm/components/obs-list/ObsItem.js +37 -37
  76. package/dist/esm/components/obs-list/ObsList.js +34 -34
  77. package/dist/esm/components/obs-list/ObsToolbar.js +1 -1
  78. package/dist/esm/components/obsm-list/ObsmList.js +15 -15
  79. package/dist/esm/components/offcanvas/index.js +6 -6
  80. package/dist/esm/components/pseudospatial/Pseudospatial.js +31 -31
  81. package/dist/esm/components/pseudospatial/PseudospatialToolbar.js +17 -17
  82. package/dist/esm/components/scatterplot/Scatterplot.js +38 -38
  83. package/dist/esm/components/scatterplot/ScatterplotControls.js +9 -9
  84. package/dist/esm/components/scatterplot/SpatialControls.js +23 -23
  85. package/dist/esm/components/scatterplot/Toolbox.js +7 -7
  86. package/dist/esm/components/search-bar/SearchBar.js +27 -27
  87. package/dist/esm/components/search-bar/SearchInfo.js +14 -14
  88. package/dist/esm/components/search-bar/SearchResults.js +10 -10
  89. package/dist/esm/components/toolbar/Toolbar.js +6 -6
  90. package/dist/esm/components/var-list/VarItem.js +27 -27
  91. package/dist/esm/components/var-list/VarList.js +21 -21
  92. package/dist/esm/components/var-list/VarListToolbar.js +10 -10
  93. package/dist/esm/components/var-list/VarSet.js +22 -22
  94. package/dist/esm/components/violin/Violin.js +26 -26
  95. package/dist/esm/components/violin/ViolinControls.js +2 -2
  96. package/dist/esm/constants/colorscales.js +19 -19
  97. package/dist/esm/constants/constants.js +47 -47
  98. package/dist/esm/context/DatasetContext.js +11 -11
  99. package/dist/esm/context/FilterContext.js +3 -3
  100. package/dist/esm/context/SettingsContext.js +61 -61
  101. package/dist/esm/context/ZarrDataContext.js +3 -3
  102. package/dist/esm/helpers/color-helper.js +5 -5
  103. package/dist/esm/helpers/map-helper.js +2 -2
  104. package/dist/esm/helpers/zarr-helper.js +6 -6
  105. package/dist/esm/index.js +22 -22
  106. package/dist/esm/utils/Filter.js +8 -8
  107. package/dist/esm/utils/Histogram.js +6 -6
  108. package/dist/esm/utils/ImageViewer.js +4 -4
  109. package/dist/esm/utils/Legend.js +9 -9
  110. package/dist/esm/utils/LoadingIndicators.js +2 -2
  111. package/dist/esm/utils/Resolver.js +13 -13
  112. package/dist/esm/utils/Skeleton.js +2 -2
  113. package/dist/esm/utils/StyledTooltip.js +6 -6
  114. package/dist/esm/utils/VirtualizedList.js +9 -9
  115. package/dist/esm/utils/errors.js +15 -15
  116. package/dist/esm/utils/requests.js +8 -8
  117. package/dist/esm/utils/search.js +7 -7
  118. package/dist/esm/utils/string.js +7 -7
  119. package/dist/esm/utils/zarrData.js +13 -13
  120. package/package.json +11 -7
  121. package/scss/cherita-bootstrap.scss +2 -2
  122. package/scss/cherita.scss +24 -17
  123. package/scss/components/accordions.scss +4 -1
  124. package/scss/components/layouts.scss +13 -12
  125. package/scss/components/lists.scss +8 -4
  126. package/scss/components/plotly.scss +1 -0
@@ -1,11 +1,11 @@
1
- import { useMemo } from "react";
2
- import { faDroplet } from "@fortawesome/free-solid-svg-icons";
3
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
4
- import _ from "lodash";
5
- import { formatNumerical, FORMATS } from "./string";
6
- import { COLOR_ENCODINGS } from "../constants/constants";
7
- import { useSettings } from "../context/SettingsContext";
8
- import { rgbToHex, useColor } from "../helpers/color-helper";
1
+ import { useMemo } from 'react';
2
+ import { faDroplet } from '@fortawesome/free-solid-svg-icons';
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
+ import _ from 'lodash';
5
+ import { formatNumerical, FORMATS } from './string';
6
+ import { COLOR_ENCODINGS } from '../constants/constants';
7
+ import { useSettings } from '../context/SettingsContext';
8
+ import { rgbToHex, useColor } from '../helpers/color-helper';
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  export function Legend(_ref) {
11
11
  let {
@@ -13,7 +13,7 @@ export function Legend(_ref) {
13
13
  min = 0,
14
14
  max = 1,
15
15
  colorscale = null,
16
- addText = ""
16
+ addText = ''
17
17
  } = _ref;
18
18
  const settings = useSettings();
19
19
  const {
@@ -1,4 +1,4 @@
1
- import { Box, CircularProgress, LinearProgress } from "@mui/material";
1
+ import { Box, CircularProgress, LinearProgress } from '@mui/material';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  export const LoadingSpinner = _ref => {
4
4
  let {
@@ -18,7 +18,7 @@ export const LoadingSpinner = _ref => {
18
18
  export const LoadingLinear = () => {
19
19
  return /*#__PURE__*/_jsx(Box, {
20
20
  sx: {
21
- width: "100%"
21
+ width: '100%'
22
22
  },
23
23
  children: /*#__PURE__*/_jsx(LinearProgress, {})
24
24
  });
@@ -3,12 +3,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
3
3
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- import { useState, useEffect, useMemo } from "react";
7
- import _ from "lodash";
8
- import { useFetch } from "./requests";
9
- import { PSEUDOSPATIAL_CATEGORICAL_MODES } from "../constants/constants";
10
- import { useDataset } from "../context/DatasetContext";
11
- import { useSettings } from "../context/SettingsContext";
6
+ import { useState, useEffect, useMemo } from 'react';
7
+ import _ from 'lodash';
8
+ import { useFetch } from './requests';
9
+ import { PSEUDOSPATIAL_CATEGORICAL_MODES } from '../constants/constants';
10
+ import { useDataset } from '../context/DatasetContext';
11
+ import { useSettings } from '../context/SettingsContext';
12
12
  const cleanSettings = settings => {
13
13
  var _settings$data$pseudo;
14
14
  // Remove obs and vars from settings that are not in data
@@ -69,7 +69,7 @@ export const useResolver = initSettings => {
69
69
  // all obs should be in initSettings.selectedObs and initSettings.labelObs
70
70
  const initObs = _.uniqBy(_.compact([initSettings.selectedObs, ..._.map(initSettings.labelObs, o => ({
71
71
  name: o
72
- }))]), "name");
72
+ }))]), 'name');
73
73
  const initObsNames = _.map(initObs, o => o.name);
74
74
  const [obsParams] = useState({
75
75
  url: dataset.url,
@@ -82,7 +82,7 @@ export const useResolver = initSettings => {
82
82
  fetchedData: obsData,
83
83
  isPending: obsDataPending,
84
84
  serverError: obsDataError
85
- } = useFetch("obs/cols", obsParams, {
85
+ } = useFetch('obs/cols', obsParams, {
86
86
  enabled: !!initObsNames.length
87
87
  });
88
88
 
@@ -99,7 +99,7 @@ export const useResolver = initSettings => {
99
99
  fetchedData: varData,
100
100
  isPending: varDataPending,
101
101
  serverError: varDataError
102
- } = useFetch("var/cols/names", varParams, {
102
+ } = useFetch('var/cols/names', varParams, {
103
103
  enabled: !!varParams.names.length
104
104
  });
105
105
 
@@ -112,7 +112,7 @@ export const useResolver = initSettings => {
112
112
  fetchedData: pseudospatialData,
113
113
  isPending: pseudospatialDataPending,
114
114
  serverError: pseudospatialDataError
115
- } = useFetch("masks", pseudospatialParams, {
115
+ } = useFetch('masks', pseudospatialParams, {
116
116
  enabled: pseudospatialEnabled,
117
117
  retry: false
118
118
  });
@@ -129,13 +129,13 @@ export const useResolver = initSettings => {
129
129
  return;
130
130
  }
131
131
  if (obsDataError) {
132
- console.error("Error fetching obs data:", obsDataError);
132
+ console.error('Error fetching obs data:', obsDataError);
133
133
  }
134
134
  if (varDataError) {
135
- console.error("Error fetching var data:", varDataError);
135
+ console.error('Error fetching var data:', varDataError);
136
136
  }
137
137
  if (pseudospatialDataError) {
138
- console.error("Error fetching pseudospatial masks data:", pseudospatialDataError);
138
+ console.error('Error fetching pseudospatial masks data:', pseudospatialDataError);
139
139
  }
140
140
  const data = {
141
141
  obs: obsData ? _.fromPairs(_.map(obsData, o => [o.name, o])) : {},
@@ -1,4 +1,4 @@
1
- import { Button, Placeholder } from "react-bootstrap";
1
+ import { Button, Placeholder } from 'react-bootstrap';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  export const ObsmKeysListBtn = () => {
4
4
  return /*#__PURE__*/_jsx(Placeholder, {
@@ -7,7 +7,7 @@ export const ObsmKeysListBtn = () => {
7
7
  children: /*#__PURE__*/_jsx(Placeholder, {
8
8
  xs: 6,
9
9
  style: {
10
- width: "40px"
10
+ width: '40px'
11
11
  }
12
12
  })
13
13
  });
@@ -6,7 +6,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8
8
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
9
- import { styled, Tooltip, tooltipClasses } from "@mui/material";
9
+ import { styled, Tooltip, tooltipClasses } from '@mui/material';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  export const StyledTooltip = styled(_ref => {
12
12
  let {
@@ -24,15 +24,15 @@ export const StyledTooltip = styled(_ref => {
24
24
  } = _ref2;
25
25
  return {
26
26
  ["& .".concat(tooltipClasses.tooltip)]: {
27
- backgroundColor: "#000",
28
- color: "#fff",
27
+ backgroundColor: '#000',
28
+ color: '#fff',
29
29
  maxWidth: 220,
30
30
  fontSize: 13,
31
31
  borderRadius: 4,
32
32
  padding: theme.spacing(0.5, 1),
33
- whiteSpace: "pre-line",
34
- textAlign: "center",
35
- boxShadow: "0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)"
33
+ whiteSpace: 'pre-line',
34
+ textAlign: 'center',
35
+ boxShadow: '0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)'
36
36
  }
37
37
  };
38
38
  });
@@ -6,8 +6,8 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8
8
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
9
- import { useCallback, useEffect, useState } from "react";
10
- import { useVirtualizer } from "@tanstack/react-virtual";
9
+ import { useCallback, useEffect, useState } from 'react';
10
+ import { useVirtualizer } from '@tanstack/react-virtual';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  export function VirtualizedList(_ref) {
13
13
  var _virtualItems$0$start, _virtualItems$;
@@ -17,7 +17,7 @@ export function VirtualizedList(_ref) {
17
17
  ItemComponent,
18
18
  estimateSize = () => 45,
19
19
  overscan = 25,
20
- maxHeight = "65vh"
20
+ maxHeight = '65vh'
21
21
  } = _ref,
22
22
  props = _objectWithoutProperties(_ref, _excluded);
23
23
  const [parentNode, setParentNode] = useState(null);
@@ -37,23 +37,23 @@ export function VirtualizedList(_ref) {
37
37
  return /*#__PURE__*/_jsx("div", {
38
38
  ref: refCallback,
39
39
  style: {
40
- overflowY: "auto",
40
+ overflowY: 'auto',
41
41
  maxHeight: maxHeight
42
42
  },
43
43
  className: "modern-scrollbars",
44
44
  children: /*#__PURE__*/_jsx("div", {
45
45
  style: {
46
46
  height: "".concat(itemVirtualizer.getTotalSize(), "px"),
47
- width: "100%",
48
- position: "relative",
49
- willChange: "transform"
47
+ width: '100%',
48
+ position: 'relative',
49
+ willChange: 'transform'
50
50
  },
51
51
  children: /*#__PURE__*/_jsx("div", {
52
52
  style: {
53
- position: "absolute",
53
+ position: 'absolute',
54
54
  top: 0,
55
55
  left: 0,
56
- width: "100%",
56
+ width: '100%',
57
57
  transform: "translateY(".concat((_virtualItems$0$start = (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.start) !== null && _virtualItems$0$start !== void 0 ? _virtualItems$0$start : 0, "px)")
58
58
  },
59
59
  children: virtualItems.map(virtualItem => /*#__PURE__*/_jsx("div", {
@@ -6,38 +6,38 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
6
6
  export const parseError = err => {
7
7
  if (err === DOMException.TIMEOUT_ERR) {
8
8
  return {
9
- message: "Timeout error",
9
+ message: 'Timeout error',
10
10
  name: err
11
11
  };
12
12
  }
13
13
  switch (err === null || err === void 0 ? void 0 : err.name) {
14
- case "TypeError":
14
+ case 'TypeError':
15
15
  return _objectSpread(_objectSpread({}, err), {}, {
16
- message: "Failed to fetch data from server"
16
+ message: 'Failed to fetch data from server'
17
17
  });
18
- case "ReadZarrError":
18
+ case 'ReadZarrError':
19
19
  return _objectSpread(_objectSpread({}, err), {}, {
20
- message: "Failed to read AnnData-Zarr"
20
+ message: 'Failed to read AnnData-Zarr'
21
21
  });
22
- case "InvalidObs":
22
+ case 'InvalidObs':
23
23
  return _objectSpread(_objectSpread({}, err), {}, {
24
- message: "Observation not found in dataset"
24
+ message: 'Observation not found in dataset'
25
25
  });
26
- case "InvalidVar":
26
+ case 'InvalidVar':
27
27
  return _objectSpread(_objectSpread({}, err), {}, {
28
- message: "Feature not found in dataset"
28
+ message: 'Feature not found in dataset'
29
29
  });
30
- case "InvalidKey":
30
+ case 'InvalidKey':
31
31
  return _objectSpread(_objectSpread({}, err), {}, {
32
- message: "Key not found in dataset"
32
+ message: 'Key not found in dataset'
33
33
  });
34
- case "BadRequest":
34
+ case 'BadRequest':
35
35
  return _objectSpread(_objectSpread({}, err), {}, {
36
- message: "Invalid request to server"
36
+ message: 'Invalid request to server'
37
37
  });
38
- case "InternalServerError":
38
+ case 'InternalServerError':
39
39
  return _objectSpread(_objectSpread({}, err), {}, {
40
- message: "Server error"
40
+ message: 'Server error'
41
41
  });
42
42
  default:
43
43
  return err;
@@ -3,9 +3,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
3
3
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- import { useQuery } from "@tanstack/react-query";
7
- import { useDebounce } from "@uidotdev/usehooks";
8
- import { parseError } from "./errors";
6
+ import { useQuery } from '@tanstack/react-query';
7
+ import { useDebounce } from '@uidotdev/usehooks';
8
+ import { parseError } from './errors';
9
9
  export async function fetchData(endpoint, params) {
10
10
  let signal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
11
11
  let ms = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 300000;
@@ -15,13 +15,13 @@ export async function fetchData(endpoint, params) {
15
15
  const timeout = setTimeout(() => {
16
16
  controller.abort(DOMException.TIMEOUT_ERR);
17
17
  }, ms || 300000);
18
- if (signal) signal.addEventListener("abort", () => controller.abort());
18
+ if (signal) signal.addEventListener('abort', () => controller.abort());
19
19
  const response = await fetch(new URL(endpoint, apiUrl), {
20
- method: "POST",
21
- mode: "cors",
20
+ method: 'POST',
21
+ mode: 'cors',
22
22
  headers: {
23
- "Content-Type": "application/json",
24
- Accept: "application/json"
23
+ 'Content-Type': 'application/json',
24
+ Accept: 'application/json'
25
25
  },
26
26
  body: JSON.stringify(params),
27
27
  signal: controller.signal
@@ -1,13 +1,13 @@
1
- import { useState } from "react";
2
- import { useFetch } from "./requests";
3
- import { useDataset } from "../context/DatasetContext";
1
+ import { useState } from 'react';
2
+ import { useFetch } from './requests';
3
+ import { useDataset } from '../context/DatasetContext';
4
4
  export const useDiseaseSearch = () => {
5
- const ENDPOINT = "diseases";
5
+ const ENDPOINT = 'diseases';
6
6
  const dataset = useDataset();
7
7
  const [params, setParams] = useState({
8
8
  url: dataset.url,
9
9
  diseaseDatasets: dataset.diseaseDatasets,
10
- text: ""
10
+ text: ''
11
11
  });
12
12
  const data = useFetch(ENDPOINT, params, {
13
13
  enabled: !!params.text.length,
@@ -20,12 +20,12 @@ export const useDiseaseSearch = () => {
20
20
  };
21
21
  };
22
22
  export const useVarSearch = () => {
23
- const ENDPOINT = "var/names";
23
+ const ENDPOINT = 'var/names';
24
24
  const dataset = useDataset();
25
25
  const [params, setParams] = useState({
26
26
  url: dataset.url,
27
27
  col: dataset.varNamesCol,
28
- text: ""
28
+ text: ''
29
29
  });
30
30
  const data = useFetch(ENDPOINT, params, {
31
31
  enabled: !!params.text.length,
@@ -1,8 +1,8 @@
1
- import numbro from "numbro";
1
+ import numbro from 'numbro';
2
2
  export const FORMATS = {
3
- EXPONENTIAL: "exponential",
4
- ABBREVIATION: "abbreviation",
5
- THOUSAND: "thousand"
3
+ EXPONENTIAL: 'exponential',
4
+ ABBREVIATION: 'abbreviation',
5
+ THOUSAND: 'thousand'
6
6
  };
7
7
  function formatThousand(n) {
8
8
  let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
@@ -32,9 +32,9 @@ export function formatNumerical(n) {
32
32
  let format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : FORMATS.THOUSAND;
33
33
  let precision = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
34
34
  if (n === 0) {
35
- return "0";
35
+ return '0';
36
36
  } else if (!n || n === undefined || isNaN(n)) {
37
- return "NaN";
37
+ return 'NaN';
38
38
  }
39
39
  switch (format) {
40
40
  case FORMATS.EXPONENTIAL:
@@ -55,5 +55,5 @@ export function formatNumerical(n) {
55
55
  }
56
56
  }
57
57
  export function formatString(s) {
58
- return s.trim().replace(/_/g, " ");
58
+ return s.trim().replace(/_/g, ' ');
59
59
  }
@@ -1,11 +1,11 @@
1
- import { useMemo } from "react";
2
- import _ from "lodash";
3
- import { slice } from "zarr";
4
- import { useSelectedObs, useSelectedVar } from "./Resolver";
5
- import { OBS_TYPES } from "../constants/constants";
6
- import { useDataset } from "../context/DatasetContext";
7
- import { useSettings } from "../context/SettingsContext";
8
- import { GET_OPTIONS, useZarr, useMultipleZarr } from "../helpers/zarr-helper";
1
+ import { useMemo } from 'react';
2
+ import _ from 'lodash';
3
+ import { slice } from 'zarr';
4
+ import { useSelectedObs, useSelectedVar } from './Resolver';
5
+ import { OBS_TYPES } from '../constants/constants';
6
+ import { useDataset } from '../context/DatasetContext';
7
+ import { useSettings } from '../context/SettingsContext';
8
+ import { GET_OPTIONS, useZarr, useMultipleZarr } from '../helpers/zarr-helper';
9
9
 
10
10
  // @TODO: support specifying slice to load from context
11
11
  export const useObsmData = function () {
@@ -15,7 +15,7 @@ export const useObsmData = function () {
15
15
  obsm = obsm || settings.selectedObsm;
16
16
  const obsmParams = useMemo(() => ({
17
17
  url: dataset.url,
18
- path: "obsm/" + obsm,
18
+ path: 'obsm/' + obsm,
19
19
  s: [null, slice(null, 2)] // load only [:, :2]
20
20
  }), [dataset.url, obsm]);
21
21
  return useZarr(obsmParams, GET_OPTIONS, {
@@ -36,12 +36,12 @@ export const useXData = function () {
36
36
  const selectedVar = useSelectedVar();
37
37
  const xParams = useMemo(() => !selectedVar ? [] : !(selectedVar !== null && selectedVar !== void 0 && selectedVar.isSet) ? [{
38
38
  url: dataset.url,
39
- path: "X",
39
+ path: 'X',
40
40
  s: [null, selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.matrix_index]
41
41
  }] : _.map(selectedVar === null || selectedVar === void 0 ? void 0 : selectedVar.vars, v => {
42
42
  return {
43
43
  url: dataset.url,
44
- path: "X",
44
+ path: 'X',
45
45
  s: [null, v.matrix_index]
46
46
  };
47
47
  }), [dataset.url, selectedVar]);
@@ -59,7 +59,7 @@ export const useObsData = function () {
59
59
  var _obs, _obs2;
60
60
  return {
61
61
  url: dataset.url,
62
- path: "obs/" + ((_obs = obs) === null || _obs === void 0 ? void 0 : _obs.name) + (((_obs2 = obs) === null || _obs2 === void 0 ? void 0 : _obs2.type) === OBS_TYPES.CATEGORICAL ? "/codes" : "")
62
+ path: 'obs/' + ((_obs = obs) === null || _obs === void 0 ? void 0 : _obs.name) + (((_obs2 = obs) === null || _obs2 === void 0 ? void 0 : _obs2.type) === OBS_TYPES.CATEGORICAL ? '/codes' : '')
63
63
  };
64
64
  }, [dataset.url, (_obs3 = obs) === null || _obs3 === void 0 ? void 0 : _obs3.name, (_obs4 = obs) === null || _obs4 === void 0 ? void 0 : _obs4.type]);
65
65
  return useZarr(obsParams, GET_OPTIONS, {
@@ -73,7 +73,7 @@ export const useLabelObsData = () => {
73
73
  const obs = settings.data.obs[obsName] || null;
74
74
  return {
75
75
  url: dataset.url,
76
- path: "obs/" + obs.name + (obs.type === OBS_TYPES.CATEGORICAL ? "/codes" : ""),
76
+ path: 'obs/' + obs.name + (obs.type === OBS_TYPES.CATEGORICAL ? '/codes' : ''),
77
77
  key: obs.name
78
78
  };
79
79
  }), [dataset.url, settings.data.obs, settings.labelObs]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haniffalab/cherita-react",
3
- "version": "1.4.1-dev.2025-10-23.e95b5a90",
3
+ "version": "1.4.1-dev.2025-10-23.55fbe6ff",
4
4
  "author": "Haniffa Lab",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -71,19 +71,23 @@
71
71
  "babel-plugin-transform-define": "^2.1.4",
72
72
  "cpx": "^1.5.0",
73
73
  "eslint": "^8.57.1",
74
- "eslint-config-prettier": "^8.10.0",
74
+ "eslint-config-prettier": "^8.10.2",
75
75
  "eslint-config-react-app": "^7.0.1",
76
- "eslint-plugin-import": "^2.29.1",
77
- "eslint-plugin-prettier": "^5.2.3",
76
+ "eslint-import-resolver-alias": "^1.1.2",
77
+ "eslint-plugin-import": "^2.32.0",
78
+ "eslint-plugin-prettier": "^5.5.4",
79
+ "eslint-plugin-react": "^7.37.5",
80
+ "eslint-plugin-unused-imports": "^4.3.0",
78
81
  "jest": "^29.7.0",
79
82
  "jest-environment-jsdom": "^29.7.0",
80
- "prettier": "^3.5.3",
83
+ "prettier": "^3.6.2",
81
84
  "react": "^18.2.0",
82
85
  "react-dom": "^18.2.0",
83
86
  "sass": "1.77.6",
84
87
  "stylelint": "^16.10.0",
85
88
  "stylelint-config-prettier": "^9.0.5",
86
- "stylelint-config-standard-scss": "^13.1.0"
89
+ "stylelint-config-standard-scss": "^13.1.0",
90
+ "stylelint-prettier": "^5.0.3"
87
91
  },
88
92
  "scripts": {
89
93
  "build:esm": "babel src/lib --out-dir dist/esm --copy-files --env-name esm",
@@ -128,5 +132,5 @@
128
132
  "url": "https://github.com/haniffalab/cherita-react/issues"
129
133
  },
130
134
  "homepage": "https://github.com/haniffalab/cherita-react#readme",
131
- "prereleaseSha": "e95b5a903f92bf1e0c03c34b0b16f6dfaeab333c"
135
+ "prereleaseSha": "55fbe6ff40ba1d947590cb8a5f927117bab4763f"
132
136
  }
@@ -1,2 +1,2 @@
1
- @use "bootstrap/scss/bootstrap";
2
- @import "cherita";
1
+ @use 'bootstrap/scss/bootstrap';
2
+ @import 'cherita';
package/scss/cherita.scss CHANGED
@@ -1,12 +1,12 @@
1
1
  // Define $prefix only if it hasn't been set already
2
- $prefix: "bs-" !default;
2
+ $prefix: 'bs-' !default;
3
3
 
4
- @import "components/accordions";
5
- @import "components/lists";
6
- @import "components/layouts";
7
- @import "components/plotly";
8
- @import "components/plots";
9
- @import "components/scrollbars";
4
+ @import 'components/accordions';
5
+ @import 'components/lists';
6
+ @import 'components/layouts';
7
+ @import 'components/plotly';
8
+ @import 'components/plots';
9
+ @import 'components/scrollbars';
10
10
 
11
11
  .loading-spinner {
12
12
  @extend .bg-light;
@@ -119,6 +119,7 @@ $prefix: "bs-" !default;
119
119
  white-space: nowrap;
120
120
  text-overflow: ellipsis;
121
121
  pointer-events: auto;
122
+
122
123
  .legend-text {
123
124
  overflow: hidden;
124
125
  text-overflow: ellipsis;
@@ -128,7 +129,7 @@ $prefix: "bs-" !default;
128
129
  }
129
130
  }
130
131
 
131
- @media (max-width: 600px) {
132
+ @media (width <= 600px) {
132
133
  .cherita-spatial-footer {
133
134
  flex-direction: column;
134
135
  align-items: center;
@@ -232,13 +233,14 @@ $prefix: "bs-" !default;
232
233
  }
233
234
 
234
235
  .value-count-badge {
235
- color: #000000 !important;
236
+ color: #000 !important;
236
237
  background-color: #dedede !important;
237
238
  font-weight: lighter;
238
239
  }
239
240
 
240
241
  .filtered-value-count-badge {
241
- color: #ffffff !important;
242
+ color: #fff !important;
243
+
242
244
  // background-color: $alt-color !important;
243
245
  font-weight: normal;
244
246
  }
@@ -269,28 +271,32 @@ $gauge-padding: 0.15rem;
269
271
 
270
272
  .feature-histogram {
271
273
  @extend .feature-histogram-container;
272
- border-radius: 5px;
273
274
 
275
+ border-radius: 5px;
274
276
  background-color: #dedede;
275
277
  }
276
278
 
279
+ .feature-histogram-tooltip td > p {
280
+ font-size: 0.85rem !important;
281
+ }
282
+
283
+ /* stylelint-disable-next-line selector-class-pattern */
277
284
  .feature-histogram-tooltip .MuiChartsTooltip-markCell,
285
+ /* stylelint-disable-next-line selector-class-pattern */
278
286
  .MuiChartsTooltip-labelCell {
279
287
  display: none;
280
288
  }
281
289
 
290
+ /* stylelint-disable-next-line selector-class-pattern */
282
291
  .feature-histogram-tooltip .MuiChartsTooltip-valueCell {
283
292
  padding: 0.5rem !important;
284
293
  }
285
294
 
295
+ /* stylelint-disable-next-line selector-class-pattern */
286
296
  .feature-histogram-tooltip .MuiChartsTooltip-valueCell > p {
287
297
  font-size: 0.85rem !important;
288
298
  }
289
299
 
290
- .feature-histogram-tooltip td > p {
291
- font-size: 0.85rem !important;
292
- }
293
-
294
300
  .feature-disease-info-list {
295
301
  max-height: 300px;
296
302
  overflow-y: auto;
@@ -420,13 +426,14 @@ $gauge-padding: 0.15rem;
420
426
 
421
427
  .var-item-name {
422
428
  @extend .me-auto;
429
+
423
430
  padding-right: 0.5rem;
424
431
  white-space: nowrap;
425
432
  overflow: hidden;
426
433
  text-overflow: ellipsis;
427
434
  }
428
435
 
429
- input[type="checkbox"] {
436
+ input[type='checkbox'] {
430
437
  cursor: pointer;
431
438
  }
432
439
 
@@ -441,7 +448,7 @@ input[type="checkbox"] {
441
448
  z-index: 10;
442
449
  width: max-content;
443
450
 
444
- @media (min-width: 991px) {
451
+ @media (width >= 991px) {
445
452
  top: 16px;
446
453
  left: 16px;
447
454
  bottom: auto;
@@ -19,6 +19,7 @@
19
19
  height: 20px;
20
20
  margin-right: 10px;
21
21
  }
22
+
22
23
  .obs-accordion-header-span {
23
24
  font-size: 1rem;
24
25
  width: 100%;
@@ -36,6 +37,7 @@
36
37
  @extend .flex-nowrap;
37
38
  }
38
39
  }
40
+
39
41
  .active-icon {
40
42
  color: #0c63e4;
41
43
  }
@@ -43,5 +45,6 @@
43
45
 
44
46
  .obs-group-accordion-body {
45
47
  @extend .accordion-flush;
48
+
46
49
  padding: 0;
47
- }
50
+ }