@haniffalab/cherita-react 1.4.1 → 1.4.2-dev.2025-10-29.81a6b906

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 (138) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/controls/Controls.js +38 -30
  3. package/dist/cjs/components/dotplot/Dotplot.js +67 -69
  4. package/dist/cjs/components/dotplot/DotplotControls.js +103 -83
  5. package/dist/cjs/components/full-page/FullPage.js +100 -74
  6. package/dist/cjs/components/full-page/PlotAlert.js +45 -0
  7. package/dist/cjs/components/full-page/PlotTypeSelector.js +89 -44
  8. package/dist/cjs/components/heatmap/Heatmap.js +65 -65
  9. package/dist/cjs/components/heatmap/HeatmapControls.js +6 -3
  10. package/dist/cjs/components/icons/DotPlotIcon.js +64 -0
  11. package/dist/cjs/components/icons/HeatmapIcon.js +45 -0
  12. package/dist/cjs/components/icons/MatrixPlotIcon.1.js +57 -0
  13. package/dist/cjs/components/icons/MatrixPlotIcon.js +59 -0
  14. package/dist/cjs/components/icons/ScatterplotIcon.1.js +164 -0
  15. package/dist/cjs/components/icons/ScatterplotIcon.js +144 -0
  16. package/dist/cjs/components/icons/ViolinPlotIcon.js +42 -0
  17. package/dist/cjs/components/matrixplot/Matrixplot.js +65 -66
  18. package/dist/cjs/components/matrixplot/MatrixplotControls.js +8 -5
  19. package/dist/cjs/components/obs-list/ObsItem.js +258 -210
  20. package/dist/cjs/components/obs-list/ObsList.js +161 -133
  21. package/dist/cjs/components/obs-list/ObsToolbar.js +2 -3
  22. package/dist/cjs/components/obsm-list/ObsmList.js +53 -38
  23. package/dist/cjs/components/offcanvas/index.js +61 -31
  24. package/dist/cjs/components/pseudospatial/Pseudospatial.js +132 -76
  25. package/dist/cjs/components/pseudospatial/PseudospatialToolbar.js +122 -74
  26. package/dist/cjs/components/scatterplot/Scatterplot.js +127 -99
  27. package/dist/cjs/components/scatterplot/ScatterplotControls.js +45 -31
  28. package/dist/cjs/components/scatterplot/SpatialControls.js +140 -113
  29. package/dist/cjs/components/scatterplot/Toolbox.js +41 -30
  30. package/dist/cjs/components/search-bar/SearchBar.js +168 -121
  31. package/dist/cjs/components/search-bar/SearchInfo.js +76 -50
  32. package/dist/cjs/components/search-bar/SearchResults.js +93 -71
  33. package/dist/cjs/components/toolbar/Toolbar.js +46 -37
  34. package/dist/cjs/components/var-list/VarItem.js +115 -88
  35. package/dist/cjs/components/var-list/VarList.js +85 -69
  36. package/dist/cjs/components/var-list/VarListToolbar.js +59 -54
  37. package/dist/cjs/components/var-list/VarSet.js +126 -108
  38. package/dist/cjs/components/violin/Violin.js +109 -107
  39. package/dist/cjs/components/violin/ViolinControls.js +8 -5
  40. package/dist/cjs/constants/colorscales.js +19 -19
  41. package/dist/cjs/constants/constants.js +47 -47
  42. package/dist/cjs/context/DatasetContext.js +24 -16
  43. package/dist/cjs/context/FilterContext.js +11 -9
  44. package/dist/cjs/context/SettingsContext.js +255 -89
  45. package/dist/cjs/context/ZarrDataContext.js +6 -5
  46. package/dist/cjs/helpers/color-helper.js +2 -2
  47. package/dist/cjs/helpers/zarr-helper.js +3 -3
  48. package/dist/cjs/utils/Filter.js +16 -11
  49. package/dist/cjs/utils/Histogram.js +35 -33
  50. package/dist/cjs/utils/ImageViewer.js +11 -8
  51. package/dist/cjs/utils/Legend.js +37 -30
  52. package/dist/cjs/utils/LoadingIndicators.js +15 -13
  53. package/dist/cjs/utils/Resolver.js +213 -0
  54. package/dist/cjs/utils/Skeleton.js +10 -10
  55. package/dist/cjs/utils/StyledTooltip.js +44 -0
  56. package/dist/cjs/utils/VirtualizedList.js +34 -27
  57. package/dist/cjs/utils/errors.js +15 -15
  58. package/dist/cjs/utils/requests.js +21 -9
  59. package/dist/cjs/utils/search.js +4 -4
  60. package/dist/cjs/utils/string.js +6 -6
  61. package/dist/cjs/utils/zarrData.js +20 -21
  62. package/dist/css/cherita.css +64 -42
  63. package/dist/css/cherita.css.map +1 -1
  64. package/dist/esm/components/controls/Controls.js +43 -35
  65. package/dist/esm/components/dotplot/Dotplot.js +77 -78
  66. package/dist/esm/components/dotplot/DotplotControls.js +106 -85
  67. package/dist/esm/components/full-page/FullPage.js +120 -93
  68. package/dist/esm/components/full-page/PlotAlert.js +39 -0
  69. package/dist/esm/components/full-page/PlotTypeSelector.js +90 -45
  70. package/dist/esm/components/heatmap/Heatmap.js +75 -74
  71. package/dist/esm/components/heatmap/HeatmapControls.js +8 -4
  72. package/dist/esm/components/icons/DotPlotIcon.js +58 -0
  73. package/dist/esm/components/icons/HeatmapIcon.js +39 -0
  74. package/dist/esm/components/icons/MatrixPlotIcon.1.js +51 -0
  75. package/dist/esm/components/icons/MatrixPlotIcon.js +53 -0
  76. package/dist/esm/components/icons/ScatterplotIcon.1.js +158 -0
  77. package/dist/esm/components/icons/ScatterplotIcon.js +138 -0
  78. package/dist/esm/components/icons/ViolinPlotIcon.js +36 -0
  79. package/dist/esm/components/matrixplot/Matrixplot.js +75 -75
  80. package/dist/esm/components/matrixplot/MatrixplotControls.js +10 -6
  81. package/dist/esm/components/obs-list/ObsItem.js +273 -222
  82. package/dist/esm/components/obs-list/ObsList.js +176 -147
  83. package/dist/esm/components/obs-list/ObsToolbar.js +3 -3
  84. package/dist/esm/components/obsm-list/ObsmList.js +60 -44
  85. package/dist/esm/components/offcanvas/index.js +67 -37
  86. package/dist/esm/components/pseudospatial/Pseudospatial.js +145 -88
  87. package/dist/esm/components/pseudospatial/PseudospatialToolbar.js +127 -78
  88. package/dist/esm/components/scatterplot/Scatterplot.js +148 -119
  89. package/dist/esm/components/scatterplot/ScatterplotControls.js +50 -35
  90. package/dist/esm/components/scatterplot/SpatialControls.js +153 -125
  91. package/dist/esm/components/scatterplot/Toolbox.js +44 -32
  92. package/dist/esm/components/search-bar/SearchBar.js +180 -132
  93. package/dist/esm/components/search-bar/SearchInfo.js +86 -59
  94. package/dist/esm/components/search-bar/SearchResults.js +100 -77
  95. package/dist/esm/components/toolbar/Toolbar.js +49 -39
  96. package/dist/esm/components/var-list/VarItem.js +126 -98
  97. package/dist/esm/components/var-list/VarList.js +99 -82
  98. package/dist/esm/components/var-list/VarListToolbar.js +64 -58
  99. package/dist/esm/components/var-list/VarSet.js +134 -115
  100. package/dist/esm/components/violin/Violin.js +121 -118
  101. package/dist/esm/components/violin/ViolinControls.js +10 -6
  102. package/dist/esm/constants/colorscales.js +19 -19
  103. package/dist/esm/constants/constants.js +47 -47
  104. package/dist/esm/context/DatasetContext.js +31 -22
  105. package/dist/esm/context/FilterContext.js +11 -8
  106. package/dist/esm/context/SettingsContext.js +257 -90
  107. package/dist/esm/context/ZarrDataContext.js +8 -6
  108. package/dist/esm/helpers/color-helper.js +5 -5
  109. package/dist/esm/helpers/map-helper.js +2 -2
  110. package/dist/esm/helpers/zarr-helper.js +6 -6
  111. package/dist/esm/index.js +22 -22
  112. package/dist/esm/utils/Filter.js +22 -17
  113. package/dist/esm/utils/Histogram.js +39 -37
  114. package/dist/esm/utils/ImageViewer.js +12 -8
  115. package/dist/esm/utils/Legend.js +44 -36
  116. package/dist/esm/utils/LoadingIndicators.js +16 -13
  117. package/dist/esm/utils/Resolver.js +201 -0
  118. package/dist/esm/utils/Skeleton.js +11 -10
  119. package/dist/esm/utils/StyledTooltip.js +38 -0
  120. package/dist/esm/utils/VirtualizedList.js +35 -27
  121. package/dist/esm/utils/errors.js +15 -15
  122. package/dist/esm/utils/requests.js +24 -12
  123. package/dist/esm/utils/search.js +7 -7
  124. package/dist/esm/utils/string.js +7 -7
  125. package/dist/esm/utils/zarrData.js +27 -28
  126. package/package.json +21 -9
  127. package/scss/cherita-bootstrap.scss +2 -2
  128. package/scss/cherita.scss +43 -17
  129. package/scss/components/accordions.scss +4 -1
  130. package/scss/components/layouts.scss +15 -33
  131. package/scss/components/lists.scss +8 -4
  132. package/scss/components/plotly.scss +38 -26
  133. package/scss/components/plots.scss +14 -1
  134. package/dist/assets/images/plots/dotplot.svg +0 -152
  135. package/dist/assets/images/plots/heatmap.svg +0 -193
  136. package/dist/assets/images/plots/matrixplot.svg +0 -275
  137. package/dist/assets/images/plots/scatterplot.svg +0 -198
  138. package/dist/assets/images/plots/violin.svg +0 -50
@@ -1,8 +1,12 @@
1
- import React from "react";
2
- import { Form } from "react-bootstrap";
3
- import { ScaleSelect } from "../controls/Controls";
1
+ import { Form } from 'react-bootstrap';
2
+ import { ScaleSelect } from '../controls/Controls';
3
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
4
4
  export function ViolinControls() {
5
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(ScaleSelect, {
6
- plot: "violinplot"
7
- })));
5
+ return /*#__PURE__*/_jsx(_Fragment, {
6
+ children: /*#__PURE__*/_jsx(Form, {
7
+ children: /*#__PURE__*/_jsx(ScaleSelect, {
8
+ plot: "violinplot"
9
+ })
10
+ })
11
+ });
8
12
  }
@@ -1,22 +1,22 @@
1
1
  // From plotly https://github.com/plotly/plotly.js/blob/5bc25b490702e5ed61265207833dbd58e8ab27f1/src/components/colorscale/scales.js
2
2
  export const COLORSCALES = {
3
- Greys: ["#000000", "#ffffff"],
4
- YlGnBu: ["#081d58", "#253494", "#225ea8", "#1d91c0", "#41b6c4", "#7fcdbb", "#c7e9b4", "#edf8d9", "#ffffd9"],
5
- Greens: ["#00441b", "#006d2c", "#238b45", "#41ab5d", "#74c476", "#a1d9a5", "#c7e9c0", "#e5f5e0", "#f7fcf5"],
6
- YlOrRd: ["#800026", "#bd0026", "#e31a1c", "#fc4e2a", "#fd8d3c", "#feb24c", "#fed976", "#ffed9f", "#ffffcc"],
7
- Bluered: ["#0000ff", "#ff0000"],
8
- RdBu: ["#050aac", "#6a89f7", "#bebebe", "#dcaa84", "#e6915a", "#b20a1c"],
9
- Reds: ["#dcdcdc", "#f5c39d", "#f5a069", "#b20a1c"],
10
- Blues: ["#050aac", "#283cba", "#4664f5", "#5a78f5", "#6a89f7", "#dcdcdc"],
11
- Picnic: ["#0000ff", "#3399ff", "#66ccff", "#99ccff", "#ccccff", "#ffffff", "#ffccff", "#ff99ff", "#ff66cc", "#ff6666", "#ff0000"],
12
- Rainbow: ["#96005a", "#0000c8", "#0019ff", "#0098ff", "#2cff96", "#97ff00", "#ffe600", "#ff6f00", "#ff0000"],
13
- Portland: ["#0c3383", "#0a88ba", "#f2d338", "#f28f38", "#d91e1e"],
14
- Jet: ["#000083", "#003caa", "#05ffff", "#ffff00", "#fa0000", "#800000"],
15
- Hot: ["#000000", "#e60000", "#ffd200", "#ffffff"],
16
- Blackbody: ["#000000", "#e60000", "#e6d200", "#ffffff", "#a0c8ff"],
17
- Earth: ["#000082", "#00b4b4", "#28d228", "#e6e632", "#784614", "#ffffff"],
18
- Electric: ["#000000", "#1e0064", "#780064", "#a05a00", "#e6c800", "#fffadc"],
19
- Viridis: ["#440154", "#48186a", "#472d7b", "#424086", "#3b528b", "#33638d", "#2c728e", "#26828e", "#21918c", "#1fa088", "#28ae80", "#3fbc73", "#5ec962", "#84d44b", "#addc30", "#d8e219", "#fde725"],
20
- Cividis: ["#00204c", "#002a66", "#00346e", "#273f6c", "#3c4a6c", "#4c556b", "#5b5f6d", "#686a70", "#757575", "#838178", "#929c78", "#a19676", "#b0a572", "#c0af6d", "#d1ba65", "#e1c75c", "#f3db4f", "#ffe945"],
21
- Accent: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17", "#666666"]
3
+ Greys: ['#000000', '#ffffff'],
4
+ YlGnBu: ['#081d58', '#253494', '#225ea8', '#1d91c0', '#41b6c4', '#7fcdbb', '#c7e9b4', '#edf8d9', '#ffffd9'],
5
+ Greens: ['#00441b', '#006d2c', '#238b45', '#41ab5d', '#74c476', '#a1d9a5', '#c7e9c0', '#e5f5e0', '#f7fcf5'],
6
+ YlOrRd: ['#800026', '#bd0026', '#e31a1c', '#fc4e2a', '#fd8d3c', '#feb24c', '#fed976', '#ffed9f', '#ffffcc'],
7
+ Bluered: ['#0000ff', '#ff0000'],
8
+ RdBu: ['#050aac', '#6a89f7', '#bebebe', '#dcaa84', '#e6915a', '#b20a1c'],
9
+ Reds: ['#dcdcdc', '#f5c39d', '#f5a069', '#b20a1c'],
10
+ Blues: ['#050aac', '#283cba', '#4664f5', '#5a78f5', '#6a89f7', '#dcdcdc'],
11
+ Picnic: ['#0000ff', '#3399ff', '#66ccff', '#99ccff', '#ccccff', '#ffffff', '#ffccff', '#ff99ff', '#ff66cc', '#ff6666', '#ff0000'],
12
+ Rainbow: ['#96005a', '#0000c8', '#0019ff', '#0098ff', '#2cff96', '#97ff00', '#ffe600', '#ff6f00', '#ff0000'],
13
+ Portland: ['#0c3383', '#0a88ba', '#f2d338', '#f28f38', '#d91e1e'],
14
+ Jet: ['#000083', '#003caa', '#05ffff', '#ffff00', '#fa0000', '#800000'],
15
+ Hot: ['#000000', '#e60000', '#ffd200', '#ffffff'],
16
+ Blackbody: ['#000000', '#e60000', '#e6d200', '#ffffff', '#a0c8ff'],
17
+ Earth: ['#000082', '#00b4b4', '#28d228', '#e6e632', '#784614', '#ffffff'],
18
+ Electric: ['#000000', '#1e0064', '#780064', '#a05a00', '#e6c800', '#fffadc'],
19
+ Viridis: ['#440154', '#48186a', '#472d7b', '#424086', '#3b528b', '#33638d', '#2c728e', '#26828e', '#21918c', '#1fa088', '#28ae80', '#3fbc73', '#5ec962', '#84d44b', '#addc30', '#d8e219', '#fde725'],
20
+ Cividis: ['#00204c', '#002a66', '#00346e', '#273f6c', '#3c4a6c', '#4c556b', '#5b5f6d', '#686a70', '#757575', '#838178', '#929c78', '#a19676', '#b0a572', '#c0af6d', '#d1ba65', '#e1c75c', '#f3db4f', '#ffe945'],
21
+ Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666']
22
22
  };
@@ -1,103 +1,103 @@
1
- export const LOCAL_STORAGE_KEY = "CHERITA";
1
+ export const LOCAL_STORAGE_KEY = 'CHERITA';
2
2
  export const PLOT_TYPES = {
3
- SCATTERPLOT: "scatterplot",
4
- DOTPLOT: "dotplot",
5
- HEATMAP: "heatmap",
6
- MATRIXPLOT: "matrixplot",
7
- VIOLINPLOT: "violinplot"
3
+ SCATTERPLOT: 'scatterplot',
4
+ DOTPLOT: 'dotplot',
5
+ HEATMAP: 'heatmap',
6
+ MATRIXPLOT: 'matrixplot',
7
+ VIOLINPLOT: 'violinplot'
8
8
  };
9
9
  export const COLOR_ENCODINGS = {
10
- VAR: "var",
11
- OBS: "obs"
10
+ VAR: 'var',
11
+ OBS: 'obs'
12
12
  };
13
13
  export const OBS_TYPES = {
14
- CATEGORICAL: "categorical",
15
- DISCRETE: "discrete",
16
- CONTINUOUS: "continuous",
17
- BOOLEAN: "boolean"
14
+ CATEGORICAL: 'categorical',
15
+ DISCRETE: 'discrete',
16
+ CONTINUOUS: 'continuous',
17
+ BOOLEAN: 'boolean'
18
18
  };
19
19
  export const VAR_SORT = {
20
20
  NONE: null,
21
- NAME: "name",
22
- MATRIX: "matrix"
21
+ NAME: 'name',
22
+ MATRIX: 'matrix'
23
23
  };
24
24
  export const VAR_SORT_ORDER = {
25
- ASC: "asc",
26
- DESC: "desc"
25
+ ASC: 'asc',
26
+ DESC: 'desc'
27
27
  };
28
28
  export const SELECTED_POLYGON_FILLCOLOR = [107, 170, 209, 255 / 2];
29
29
  export const UNSELECTED_POLYGON_FILLCOLOR = [167, 191, 211, 255 / 3];
30
30
  export const SELECTION_MODES = {
31
- SINGLE: "single",
32
- MULTIPLE: "multiple"
31
+ SINGLE: 'single',
32
+ MULTIPLE: 'multiple'
33
33
  };
34
34
  export const VIOLIN_MODES = {
35
- MULTIKEY: "multikey",
36
- GROUPBY: "groupby"
35
+ MULTIKEY: 'multikey',
36
+ GROUPBY: 'groupby'
37
37
  };
38
38
  export const MATRIXPLOT_SCALES = {
39
39
  NONE: {
40
40
  value: null,
41
- name: "None"
41
+ name: 'None'
42
42
  },
43
43
  GROUP: {
44
- value: "group",
45
- name: "Group"
44
+ value: 'group',
45
+ name: 'Group'
46
46
  },
47
47
  VAR: {
48
- value: "var",
49
- name: "Var"
48
+ value: 'var',
49
+ name: 'Var'
50
50
  }
51
51
  };
52
52
  export const DOTPLOT_SCALES = {
53
53
  NONE: {
54
54
  value: null,
55
- name: "None"
55
+ name: 'None'
56
56
  },
57
57
  GROUP: {
58
- value: "group",
59
- name: "Group"
58
+ value: 'group',
59
+ name: 'Group'
60
60
  },
61
61
  VAR: {
62
- value: "var",
63
- name: "Var"
62
+ value: 'var',
63
+ name: 'Var'
64
64
  }
65
65
  };
66
66
  export const VIOLINPLOT_SCALES = {
67
67
  WIDTH: {
68
- value: "width",
69
- name: "Width"
68
+ value: 'width',
69
+ name: 'Width'
70
70
  },
71
71
  COUNT: {
72
- value: "count",
73
- name: "Count"
72
+ value: 'count',
73
+ name: 'Count'
74
74
  }
75
75
  };
76
76
  export const PSEUDOSPATIAL_PLOT_TYPES = {
77
- GENE: "gene",
78
- CATEGORICAL: "categorical",
79
- CONTINUOUS: "continuous",
80
- MASKS: "masks"
77
+ GENE: 'gene',
78
+ CATEGORICAL: 'categorical',
79
+ CONTINUOUS: 'continuous',
80
+ MASKS: 'masks'
81
81
  };
82
82
  export const PSEUDOSPATIAL_CATEGORICAL_MODES = {
83
83
  ACROSS: {
84
- value: "across",
85
- name: "% across sections"
84
+ value: 'across',
85
+ name: '% across sections'
86
86
  },
87
87
  WITHIN: {
88
- value: "within",
89
- name: "% within section"
88
+ value: 'within',
89
+ name: '% within section'
90
90
  }
91
91
  };
92
92
 
93
93
  // `default` cols to be shown out of accordion, at top of obslist
94
94
  // default values from cellxgene schema
95
- export const DEFAULT_OBS_GROUP = ["assay", "cell_type", "development_stage", "disease", "donor_id", "organism", "self_reported_ethnicity", "sex", "suspension_type", "tissue", "tissue_type"];
96
- export const PLOTLY_MODEBAR_BUTTONS = ["toImage", "zoom2d", "pan2d", "zoomIn2d", "zoomOut2d", "autoScale2d", "resetScale2d"];
95
+ export const DEFAULT_OBS_GROUP = ['assay', 'cell_type', 'development_stage', 'disease', 'donor_id', 'organism', 'self_reported_ethnicity', 'sex', 'suspension_type', 'tissue', 'tissue_type'];
96
+ export const PLOTLY_MODEBAR_BUTTONS = ['toImage', 'zoom2d', 'pan2d', 'zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'];
97
97
  export const BREAKPOINTS = {
98
- LG: "(max-width: 991.98px)",
99
- XL: "(max-width: 1199.98px)"
98
+ LG: '(max-width: 991.98px)',
99
+ XL: '(max-width: 1199.98px)'
100
100
  };
101
101
 
102
102
  // In order of priority
103
- export const DEFAULT_OBSM_KEYS = ["x_umap", "x_tsne", "x_scvi", "x_pca"];
103
+ export const DEFAULT_OBSM_KEYS = ['x_umap', 'x_tsne', 'x_scvi', 'x_pca'];
@@ -6,14 +6,15 @@ 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 React, { createContext, useContext } from "react";
10
- import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister";
11
- import { QueryClient, QueryCache } from "@tanstack/react-query";
12
- import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client";
13
- import _ from "lodash";
14
- import { FilterProvider } from "./FilterContext";
15
- import { SettingsProvider } from "./SettingsContext";
16
- import { ZarrDataProvider } from "./ZarrDataContext";
9
+ import { createContext, useContext } from 'react';
10
+ import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister';
11
+ import { QueryClient, QueryCache } from '@tanstack/react-query';
12
+ import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client';
13
+ import _ from 'lodash';
14
+ import { FilterProvider } from './FilterContext';
15
+ import { SettingsProvider } from './SettingsContext';
16
+ import { ZarrDataProvider } from './ZarrDataContext';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
17
18
  export const DatasetContext = /*#__PURE__*/createContext(null);
18
19
  const queryClient = new QueryClient({
19
20
  defaultOptions: {
@@ -33,7 +34,7 @@ const queryClient = new QueryClient({
33
34
  })
34
35
  });
35
36
  // Type of queries to store responses
36
- const persistKeys = ["obs/cols", "var/names", "obsm/keys", "obs/bins", "obs/distribution"];
37
+ const persistKeys = ['obs/cols', 'var/names', 'obsm/keys', 'obs/bins', 'obs/distribution'];
37
38
  const persistOptions = {
38
39
  persister: createSyncStoragePersister({
39
40
  storage: window.localStorage
@@ -44,13 +45,13 @@ const persistOptions = {
44
45
  queryKey,
45
46
  state
46
47
  } = _ref;
47
- if (state.status === "success") {
48
+ if (state.status === 'success') {
48
49
  return persistKeys.includes(queryKey === null || queryKey === void 0 ? void 0 : queryKey[0]);
49
50
  }
50
51
  return false;
51
52
  }
52
53
  },
53
- buster: "1.4.1" || "0.0.0"
54
+ buster: "1.4.2-dev.2025-10-29.81a6b906" || '0.0.0'
54
55
  // @TODO: add maxAge and api version numbers as buster
55
56
  };
56
57
  const initialDataset = {
@@ -61,7 +62,8 @@ const initialDataset = {
61
62
  imageUrl: null,
62
63
  defaultSettings: {},
63
64
  canOverrideSettings: true,
64
- useUnsColors: false
65
+ useUnsColors: false,
66
+ isPseudospatial: false
65
67
  };
66
68
  export function DatasetProvider(_ref2) {
67
69
  let {
@@ -72,16 +74,23 @@ export function DatasetProvider(_ref2) {
72
74
  const dataset = _.assign(initialDataset, _objectSpread({
73
75
  url: dataset_url
74
76
  }, dataset_params));
75
- return /*#__PURE__*/React.createElement(DatasetContext.Provider, {
76
- value: dataset
77
- }, /*#__PURE__*/React.createElement(SettingsProvider, {
78
- dataset_url: dataset.url,
79
- defaultSettings: dataset.defaultSettings,
80
- canOverrideSettings: dataset.canOverrideSettings
81
- }, /*#__PURE__*/React.createElement(PersistQueryClientProvider, {
82
- client: queryClient,
83
- persistOptions: persistOptions
84
- }, /*#__PURE__*/React.createElement(FilterProvider, null, /*#__PURE__*/React.createElement(ZarrDataProvider, null, children)))));
77
+ return /*#__PURE__*/_jsx(DatasetContext.Provider, {
78
+ value: dataset,
79
+ children: /*#__PURE__*/_jsx(PersistQueryClientProvider, {
80
+ client: queryClient,
81
+ persistOptions: persistOptions,
82
+ children: /*#__PURE__*/_jsx(SettingsProvider, {
83
+ dataset_url: dataset.url,
84
+ defaultSettings: dataset.defaultSettings,
85
+ canOverrideSettings: dataset.canOverrideSettings,
86
+ children: /*#__PURE__*/_jsx(FilterProvider, {
87
+ children: /*#__PURE__*/_jsx(ZarrDataProvider, {
88
+ children: children
89
+ })
90
+ })
91
+ })
92
+ })
93
+ });
85
94
  }
86
95
  export function useDataset() {
87
96
  return useContext(DatasetContext);
@@ -3,7 +3,8 @@ 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 React, { useReducer, createContext, useContext } from "react";
6
+ import { useReducer, createContext, useContext } from 'react';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
7
8
  export const FilteredDataContext = /*#__PURE__*/createContext(null);
8
9
  export const FilteredDataDispatchContext = /*#__PURE__*/createContext(null);
9
10
  const initialFilterData = {
@@ -18,11 +19,13 @@ export function FilterProvider(_ref) {
18
19
  children
19
20
  } = _ref;
20
21
  const [filteredData, dispatch] = useReducer(filterReducer, _objectSpread({}, initialFilterData));
21
- return /*#__PURE__*/React.createElement(FilteredDataContext.Provider, {
22
- value: filteredData
23
- }, /*#__PURE__*/React.createElement(FilteredDataDispatchContext.Provider, {
24
- value: dispatch
25
- }, children));
22
+ return /*#__PURE__*/_jsx(FilteredDataContext.Provider, {
23
+ value: filteredData,
24
+ children: /*#__PURE__*/_jsx(FilteredDataDispatchContext.Provider, {
25
+ value: dispatch,
26
+ children: children
27
+ })
28
+ });
26
29
  }
27
30
  export function useFilteredData() {
28
31
  return useContext(FilteredDataContext);
@@ -32,7 +35,7 @@ export function useFilteredDataDispatch() {
32
35
  }
33
36
  function filterReducer(filteredData, action) {
34
37
  switch (action.type) {
35
- case "set.obs.indices":
38
+ case 'set.obs.indices':
36
39
  {
37
40
  return _objectSpread(_objectSpread({}, filteredData), {}, {
38
41
  obsIndices: action.indices,
@@ -44,7 +47,7 @@ function filterReducer(filteredData, action) {
44
47
  }
45
48
  default:
46
49
  {
47
- throw Error("Unknown action: " + action.type);
50
+ throw Error('Unknown action: ' + action.type);
48
51
  }
49
52
  }
50
53
  }