@vitessce/heatmap 3.8.10 → 3.9.0

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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-CIYB_Yf2.js";
2
+ import { B as BaseDecoder } from "./index-DYmO2OXo.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -720,6 +720,17 @@ const DEFAULT_LIGHT2_COLOR = [235, 235, 235];
720
720
  function getDefaultColor(theme) {
721
721
  return theme === "dark" ? DEFAULT_DARK_COLOR : theme === "light" ? DEFAULT_LIGHT_COLOR$3 : DEFAULT_LIGHT2_COLOR;
722
722
  }
723
+ const PALETTE = [
724
+ [68, 119, 170],
725
+ [136, 204, 238],
726
+ [68, 170, 153],
727
+ [17, 119, 51],
728
+ [153, 153, 51],
729
+ [221, 204, 119],
730
+ [204, 102, 119],
731
+ [136, 34, 85],
732
+ [170, 68, 153]
733
+ ];
723
734
  const DEFAULT_GL_OPTIONS = { webgl2: true };
724
735
  function createDefaultUpdateCellsHover(componentName) {
725
736
  return (hoverInfo) => log$5.warn(`${componentName} updateCellsHover: ${hoverInfo.cellId}`);
@@ -788,6 +799,34 @@ class Pool {
788
799
  }
789
800
  }
790
801
  }
802
+ function extent$1(values2, valueof) {
803
+ let min;
804
+ let max2;
805
+ {
806
+ for (const value of values2) {
807
+ if (value != null) {
808
+ if (min === void 0) {
809
+ if (value >= value) min = max2 = value;
810
+ } else {
811
+ if (min > value) min = value;
812
+ if (max2 < value) max2 = value;
813
+ }
814
+ }
815
+ }
816
+ }
817
+ return [min, max2];
818
+ }
819
+ function max(values2, valueof) {
820
+ let max2;
821
+ {
822
+ for (const value of values2) {
823
+ if (value != null && (max2 < value || max2 === void 0 && value >= value)) {
824
+ max2 = value;
825
+ }
826
+ }
827
+ }
828
+ return max2;
829
+ }
791
830
  let getRandomValues$1;
792
831
  const rnds8$1 = new Uint8Array(16);
793
832
  function rng$1() {
@@ -9732,6 +9771,7 @@ const CoordinationType$1 = {
9732
9771
  OBS_SET_HIGHLIGHT: "obsSetHighlight",
9733
9772
  OBS_SET_EXPANSION: "obsSetExpansion",
9734
9773
  OBS_SET_COLOR: "obsSetColor",
9774
+ FEATURE_COLOR: "featureColor",
9735
9775
  FEATURE_HIGHLIGHT: "featureHighlight",
9736
9776
  FEATURE_SELECTION: "featureSelection",
9737
9777
  FEATURE_SET_SELECTION: "featureSetSelection",
@@ -9787,6 +9827,8 @@ const CoordinationType$1 = {
9787
9827
  // Per-spatial-layer
9788
9828
  SPATIAL_MAX_RESOLUTION: "spatialMaxResolution",
9789
9829
  // Per-image-channel (for spatial-accelerated)
9830
+ SPATIAL_LOD_FACTOR: "spatialLodFactor",
9831
+ // LOD factor for 3D volume rendering
9790
9832
  // For clipping plane sliders
9791
9833
  SPATIAL_SLICE_X: "spatialSliceX",
9792
9834
  SPATIAL_SLICE_Y: "spatialSliceY",
@@ -10307,6 +10349,8 @@ const COMPONENT_COORDINATION_TYPES = {
10307
10349
  CoordinationType$1.OBS_SET_FILTER,
10308
10350
  CoordinationType$1.OBS_SET_HIGHLIGHT,
10309
10351
  CoordinationType$1.OBS_SET_COLOR,
10352
+ CoordinationType$1.FEATURE_COLOR,
10353
+ CoordinationType$1.FEATURE_FILTER_MODE,
10310
10354
  CoordinationType$1.FEATURE_HIGHLIGHT,
10311
10355
  CoordinationType$1.FEATURE_SELECTION,
10312
10356
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
@@ -10521,6 +10565,8 @@ const COMPONENT_COORDINATION_TYPES = {
10521
10565
  CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
10522
10566
  CoordinationType$1.SPATIAL_LAYER_COLOR,
10523
10567
  CoordinationType$1.OBS_COLOR_ENCODING,
10568
+ CoordinationType$1.FEATURE_COLOR,
10569
+ CoordinationType$1.FEATURE_FILTER_MODE,
10524
10570
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
10525
10571
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
10526
10572
  CoordinationType$1.FEATURE_SELECTION,
@@ -25090,11 +25136,6 @@ const { tss } = createTss({
25090
25136
  "usePlugin": useMuiThemeStyleOverridesPlugin
25091
25137
  });
25092
25138
  const useStyles$3 = tss.create({});
25093
- function chainPropTypes(propType1, propType2) {
25094
- return function validate2(...args) {
25095
- return propType1(...args) || propType2(...args);
25096
- };
25097
- }
25098
25139
  const memoTheme = unstable_memoTheme;
25099
25140
  ({
25100
25141
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -25113,332 +25154,6 @@ const memoTheme = unstable_memoTheme;
25113
25154
  function useDefaultProps(params) {
25114
25155
  return useDefaultProps$1(params);
25115
25156
  }
25116
- function _extends$1() {
25117
- return _extends$1 = Object.assign ? Object.assign.bind() : function(n2) {
25118
- for (var e3 = 1; e3 < arguments.length; e3++) {
25119
- var t = arguments[e3];
25120
- for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]);
25121
- }
25122
- return n2;
25123
- }, _extends$1.apply(null, arguments);
25124
- }
25125
- function _objectWithoutPropertiesLoose(r2, e3) {
25126
- if (null == r2) return {};
25127
- var t = {};
25128
- for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) {
25129
- if (-1 !== e3.indexOf(n2)) continue;
25130
- t[n2] = r2[n2];
25131
- }
25132
- return t;
25133
- }
25134
- function _setPrototypeOf(t, e3) {
25135
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e4) {
25136
- return t2.__proto__ = e4, t2;
25137
- }, _setPrototypeOf(t, e3);
25138
- }
25139
- function _inheritsLoose(t, o2) {
25140
- t.prototype = Object.create(o2.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o2);
25141
- }
25142
- const TransitionGroupContext = React__default.createContext(null);
25143
- function _assertThisInitialized(e3) {
25144
- if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
25145
- return e3;
25146
- }
25147
- function getChildMapping(children2, mapFn) {
25148
- var mapper = function mapper2(child) {
25149
- return mapFn && isValidElement(child) ? mapFn(child) : child;
25150
- };
25151
- var result = /* @__PURE__ */ Object.create(null);
25152
- if (children2) Children.map(children2, function(c) {
25153
- return c;
25154
- }).forEach(function(child) {
25155
- result[child.key] = mapper(child);
25156
- });
25157
- return result;
25158
- }
25159
- function mergeChildMappings(prev2, next2) {
25160
- prev2 = prev2 || {};
25161
- next2 = next2 || {};
25162
- function getValueForKey(key) {
25163
- return key in next2 ? next2[key] : prev2[key];
25164
- }
25165
- var nextKeysPending = /* @__PURE__ */ Object.create(null);
25166
- var pendingKeys = [];
25167
- for (var prevKey in prev2) {
25168
- if (prevKey in next2) {
25169
- if (pendingKeys.length) {
25170
- nextKeysPending[prevKey] = pendingKeys;
25171
- pendingKeys = [];
25172
- }
25173
- } else {
25174
- pendingKeys.push(prevKey);
25175
- }
25176
- }
25177
- var i2;
25178
- var childMapping = {};
25179
- for (var nextKey in next2) {
25180
- if (nextKeysPending[nextKey]) {
25181
- for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
25182
- var pendingNextKey = nextKeysPending[nextKey][i2];
25183
- childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
25184
- }
25185
- }
25186
- childMapping[nextKey] = getValueForKey(nextKey);
25187
- }
25188
- for (i2 = 0; i2 < pendingKeys.length; i2++) {
25189
- childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
25190
- }
25191
- return childMapping;
25192
- }
25193
- function getProp(child, prop, props) {
25194
- return props[prop] != null ? props[prop] : child.props[prop];
25195
- }
25196
- function getInitialChildMapping(props, onExited) {
25197
- return getChildMapping(props.children, function(child) {
25198
- return cloneElement(child, {
25199
- onExited: onExited.bind(null, child),
25200
- in: true,
25201
- appear: getProp(child, "appear", props),
25202
- enter: getProp(child, "enter", props),
25203
- exit: getProp(child, "exit", props)
25204
- });
25205
- });
25206
- }
25207
- function getNextChildMapping(nextProps, prevChildMapping, onExited) {
25208
- var nextChildMapping = getChildMapping(nextProps.children);
25209
- var children2 = mergeChildMappings(prevChildMapping, nextChildMapping);
25210
- Object.keys(children2).forEach(function(key) {
25211
- var child = children2[key];
25212
- if (!isValidElement(child)) return;
25213
- var hasPrev = key in prevChildMapping;
25214
- var hasNext = key in nextChildMapping;
25215
- var prevChild = prevChildMapping[key];
25216
- var isLeaving = isValidElement(prevChild) && !prevChild.props.in;
25217
- if (hasNext && (!hasPrev || isLeaving)) {
25218
- children2[key] = cloneElement(child, {
25219
- onExited: onExited.bind(null, child),
25220
- in: true,
25221
- exit: getProp(child, "exit", nextProps),
25222
- enter: getProp(child, "enter", nextProps)
25223
- });
25224
- } else if (!hasNext && hasPrev && !isLeaving) {
25225
- children2[key] = cloneElement(child, {
25226
- in: false
25227
- });
25228
- } else if (hasNext && hasPrev && isValidElement(prevChild)) {
25229
- children2[key] = cloneElement(child, {
25230
- onExited: onExited.bind(null, child),
25231
- in: prevChild.props.in,
25232
- exit: getProp(child, "exit", nextProps),
25233
- enter: getProp(child, "enter", nextProps)
25234
- });
25235
- }
25236
- });
25237
- return children2;
25238
- }
25239
- var values = Object.values || function(obj) {
25240
- return Object.keys(obj).map(function(k) {
25241
- return obj[k];
25242
- });
25243
- };
25244
- var defaultProps$P = {
25245
- component: "div",
25246
- childFactory: function childFactory(child) {
25247
- return child;
25248
- }
25249
- };
25250
- var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
25251
- _inheritsLoose(TransitionGroup2, _React$Component);
25252
- function TransitionGroup2(props, context) {
25253
- var _this;
25254
- _this = _React$Component.call(this, props, context) || this;
25255
- var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
25256
- _this.state = {
25257
- contextValue: {
25258
- isMounting: true
25259
- },
25260
- handleExited,
25261
- firstRender: true
25262
- };
25263
- return _this;
25264
- }
25265
- var _proto = TransitionGroup2.prototype;
25266
- _proto.componentDidMount = function componentDidMount() {
25267
- this.mounted = true;
25268
- this.setState({
25269
- contextValue: {
25270
- isMounting: false
25271
- }
25272
- });
25273
- };
25274
- _proto.componentWillUnmount = function componentWillUnmount() {
25275
- this.mounted = false;
25276
- };
25277
- TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
25278
- var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
25279
- return {
25280
- children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
25281
- firstRender: false
25282
- };
25283
- };
25284
- _proto.handleExited = function handleExited(child, node2) {
25285
- var currentChildMapping = getChildMapping(this.props.children);
25286
- if (child.key in currentChildMapping) return;
25287
- if (child.props.onExited) {
25288
- child.props.onExited(node2);
25289
- }
25290
- if (this.mounted) {
25291
- this.setState(function(state) {
25292
- var children2 = _extends$1({}, state.children);
25293
- delete children2[child.key];
25294
- return {
25295
- children: children2
25296
- };
25297
- });
25298
- }
25299
- };
25300
- _proto.render = function render() {
25301
- var _this$props = this.props, Component2 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
25302
- var contextValue = this.state.contextValue;
25303
- var children2 = values(this.state.children).map(childFactory2);
25304
- delete props.appear;
25305
- delete props.enter;
25306
- delete props.exit;
25307
- if (Component2 === null) {
25308
- return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
25309
- value: contextValue
25310
- }, children2);
25311
- }
25312
- return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
25313
- value: contextValue
25314
- }, /* @__PURE__ */ React__default.createElement(Component2, props, children2));
25315
- };
25316
- return TransitionGroup2;
25317
- }(React__default.Component);
25318
- TransitionGroup.propTypes = {
25319
- /**
25320
- * `<TransitionGroup>` renders a `<div>` by default. You can change this
25321
- * behavior by providing a `component` prop.
25322
- * If you use React v16+ and would like to avoid a wrapping `<div>` element
25323
- * you can pass in `component={null}`. This is useful if the wrapping div
25324
- * borks your css styles.
25325
- */
25326
- component: PropTypes.any,
25327
- /**
25328
- * A set of `<Transition>` components, that are toggled `in` and out as they
25329
- * leave. the `<TransitionGroup>` will inject specific transition props, so
25330
- * remember to spread them through if you are wrapping the `<Transition>` as
25331
- * with our `<Fade>` example.
25332
- *
25333
- * While this component is meant for multiple `Transition` or `CSSTransition`
25334
- * children, sometimes you may want to have a single transition child with
25335
- * content that you want to be transitioned out and in when you change it
25336
- * (e.g. routes, images etc.) In that case you can change the `key` prop of
25337
- * the transition child as you change its content, this will cause
25338
- * `TransitionGroup` to transition the child out and back in.
25339
- */
25340
- children: PropTypes.node,
25341
- /**
25342
- * A convenience prop that enables or disables appear animations
25343
- * for all children. Note that specifying this will override any defaults set
25344
- * on individual children Transitions.
25345
- */
25346
- appear: PropTypes.bool,
25347
- /**
25348
- * A convenience prop that enables or disables enter animations
25349
- * for all children. Note that specifying this will override any defaults set
25350
- * on individual children Transitions.
25351
- */
25352
- enter: PropTypes.bool,
25353
- /**
25354
- * A convenience prop that enables or disables exit animations
25355
- * for all children. Note that specifying this will override any defaults set
25356
- * on individual children Transitions.
25357
- */
25358
- exit: PropTypes.bool,
25359
- /**
25360
- * You may need to apply reactive updates to a child as it is exiting.
25361
- * This is generally done by using `cloneElement` however in the case of an exiting
25362
- * child the element has already been removed and not accessible to the consumer.
25363
- *
25364
- * If you do need to update a child as it leaves you can provide a `childFactory`
25365
- * to wrap every child, even the ones that are leaving.
25366
- *
25367
- * @type Function(child: ReactElement) -> ReactElement
25368
- */
25369
- childFactory: PropTypes.func
25370
- };
25371
- TransitionGroup.defaultProps = defaultProps$P;
25372
- const UNINITIALIZED = {};
25373
- function useLazyRef(init, initArg) {
25374
- const ref = React.useRef(UNINITIALIZED);
25375
- if (ref.current === UNINITIALIZED) {
25376
- ref.current = init(initArg);
25377
- }
25378
- return ref;
25379
- }
25380
- const EMPTY$1 = [];
25381
- function useOnMount(fn) {
25382
- React.useEffect(fn, EMPTY$1);
25383
- }
25384
- class Timeout {
25385
- constructor() {
25386
- __publicField(this, "currentId", null);
25387
- __publicField(this, "clear", () => {
25388
- if (this.currentId !== null) {
25389
- clearTimeout(this.currentId);
25390
- this.currentId = null;
25391
- }
25392
- });
25393
- __publicField(this, "disposeEffect", () => {
25394
- return this.clear;
25395
- });
25396
- }
25397
- static create() {
25398
- return new Timeout();
25399
- }
25400
- /**
25401
- * Executes `fn` after `delay`, clearing any previously scheduled call.
25402
- */
25403
- start(delay, fn) {
25404
- this.clear();
25405
- this.currentId = setTimeout(() => {
25406
- this.currentId = null;
25407
- fn();
25408
- }, delay);
25409
- }
25410
- }
25411
- function useTimeout() {
25412
- const timeout = useLazyRef(Timeout.create).current;
25413
- useOnMount(timeout.disposeEffect);
25414
- return timeout;
25415
- }
25416
- function isClassComponent(elementType) {
25417
- const {
25418
- prototype = {}
25419
- } = elementType;
25420
- return Boolean(prototype.isReactComponent);
25421
- }
25422
- function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
25423
- const propValue = props[propName];
25424
- const safePropName = propFullName || propName;
25425
- if (propValue == null || // When server-side rendering React doesn't warn either.
25426
- // This is not an accurate check for SSR.
25427
- // This is only in place for emotion compat.
25428
- // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
25429
- typeof window === "undefined") {
25430
- return null;
25431
- }
25432
- let warningHint;
25433
- if (typeof propValue === "function" && !isClassComponent(propValue)) {
25434
- warningHint = "Did you accidentally provide a plain function component instead?";
25435
- }
25436
- if (warningHint !== void 0) {
25437
- return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
25438
- }
25439
- return null;
25440
- }
25441
- const elementTypeAcceptingRef$1 = chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef);
25442
25157
  function getSvgIconUtilityClass(slot) {
25443
25158
  return generateUtilityClass("MuiSvgIcon", slot);
25444
25159
  }
@@ -25855,6 +25570,337 @@ function mergeSlotProps$1(externalSlotProps, defaultSlotProps) {
25855
25570
  }
25856
25571
  };
25857
25572
  }
25573
+ function chainPropTypes(propType1, propType2) {
25574
+ return function validate2(...args) {
25575
+ return propType1(...args) || propType2(...args);
25576
+ };
25577
+ }
25578
+ function _extends$1() {
25579
+ return _extends$1 = Object.assign ? Object.assign.bind() : function(n2) {
25580
+ for (var e3 = 1; e3 < arguments.length; e3++) {
25581
+ var t = arguments[e3];
25582
+ for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]);
25583
+ }
25584
+ return n2;
25585
+ }, _extends$1.apply(null, arguments);
25586
+ }
25587
+ function _objectWithoutPropertiesLoose(r2, e3) {
25588
+ if (null == r2) return {};
25589
+ var t = {};
25590
+ for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) {
25591
+ if (-1 !== e3.indexOf(n2)) continue;
25592
+ t[n2] = r2[n2];
25593
+ }
25594
+ return t;
25595
+ }
25596
+ function _setPrototypeOf(t, e3) {
25597
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e4) {
25598
+ return t2.__proto__ = e4, t2;
25599
+ }, _setPrototypeOf(t, e3);
25600
+ }
25601
+ function _inheritsLoose(t, o2) {
25602
+ t.prototype = Object.create(o2.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o2);
25603
+ }
25604
+ const TransitionGroupContext = React__default.createContext(null);
25605
+ function _assertThisInitialized(e3) {
25606
+ if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
25607
+ return e3;
25608
+ }
25609
+ function getChildMapping(children2, mapFn) {
25610
+ var mapper = function mapper2(child) {
25611
+ return mapFn && isValidElement(child) ? mapFn(child) : child;
25612
+ };
25613
+ var result = /* @__PURE__ */ Object.create(null);
25614
+ if (children2) Children.map(children2, function(c) {
25615
+ return c;
25616
+ }).forEach(function(child) {
25617
+ result[child.key] = mapper(child);
25618
+ });
25619
+ return result;
25620
+ }
25621
+ function mergeChildMappings(prev2, next2) {
25622
+ prev2 = prev2 || {};
25623
+ next2 = next2 || {};
25624
+ function getValueForKey(key) {
25625
+ return key in next2 ? next2[key] : prev2[key];
25626
+ }
25627
+ var nextKeysPending = /* @__PURE__ */ Object.create(null);
25628
+ var pendingKeys = [];
25629
+ for (var prevKey in prev2) {
25630
+ if (prevKey in next2) {
25631
+ if (pendingKeys.length) {
25632
+ nextKeysPending[prevKey] = pendingKeys;
25633
+ pendingKeys = [];
25634
+ }
25635
+ } else {
25636
+ pendingKeys.push(prevKey);
25637
+ }
25638
+ }
25639
+ var i2;
25640
+ var childMapping = {};
25641
+ for (var nextKey in next2) {
25642
+ if (nextKeysPending[nextKey]) {
25643
+ for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
25644
+ var pendingNextKey = nextKeysPending[nextKey][i2];
25645
+ childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
25646
+ }
25647
+ }
25648
+ childMapping[nextKey] = getValueForKey(nextKey);
25649
+ }
25650
+ for (i2 = 0; i2 < pendingKeys.length; i2++) {
25651
+ childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
25652
+ }
25653
+ return childMapping;
25654
+ }
25655
+ function getProp(child, prop, props) {
25656
+ return props[prop] != null ? props[prop] : child.props[prop];
25657
+ }
25658
+ function getInitialChildMapping(props, onExited) {
25659
+ return getChildMapping(props.children, function(child) {
25660
+ return cloneElement(child, {
25661
+ onExited: onExited.bind(null, child),
25662
+ in: true,
25663
+ appear: getProp(child, "appear", props),
25664
+ enter: getProp(child, "enter", props),
25665
+ exit: getProp(child, "exit", props)
25666
+ });
25667
+ });
25668
+ }
25669
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
25670
+ var nextChildMapping = getChildMapping(nextProps.children);
25671
+ var children2 = mergeChildMappings(prevChildMapping, nextChildMapping);
25672
+ Object.keys(children2).forEach(function(key) {
25673
+ var child = children2[key];
25674
+ if (!isValidElement(child)) return;
25675
+ var hasPrev = key in prevChildMapping;
25676
+ var hasNext = key in nextChildMapping;
25677
+ var prevChild = prevChildMapping[key];
25678
+ var isLeaving = isValidElement(prevChild) && !prevChild.props.in;
25679
+ if (hasNext && (!hasPrev || isLeaving)) {
25680
+ children2[key] = cloneElement(child, {
25681
+ onExited: onExited.bind(null, child),
25682
+ in: true,
25683
+ exit: getProp(child, "exit", nextProps),
25684
+ enter: getProp(child, "enter", nextProps)
25685
+ });
25686
+ } else if (!hasNext && hasPrev && !isLeaving) {
25687
+ children2[key] = cloneElement(child, {
25688
+ in: false
25689
+ });
25690
+ } else if (hasNext && hasPrev && isValidElement(prevChild)) {
25691
+ children2[key] = cloneElement(child, {
25692
+ onExited: onExited.bind(null, child),
25693
+ in: prevChild.props.in,
25694
+ exit: getProp(child, "exit", nextProps),
25695
+ enter: getProp(child, "enter", nextProps)
25696
+ });
25697
+ }
25698
+ });
25699
+ return children2;
25700
+ }
25701
+ var values = Object.values || function(obj) {
25702
+ return Object.keys(obj).map(function(k) {
25703
+ return obj[k];
25704
+ });
25705
+ };
25706
+ var defaultProps$P = {
25707
+ component: "div",
25708
+ childFactory: function childFactory(child) {
25709
+ return child;
25710
+ }
25711
+ };
25712
+ var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
25713
+ _inheritsLoose(TransitionGroup2, _React$Component);
25714
+ function TransitionGroup2(props, context) {
25715
+ var _this;
25716
+ _this = _React$Component.call(this, props, context) || this;
25717
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
25718
+ _this.state = {
25719
+ contextValue: {
25720
+ isMounting: true
25721
+ },
25722
+ handleExited,
25723
+ firstRender: true
25724
+ };
25725
+ return _this;
25726
+ }
25727
+ var _proto = TransitionGroup2.prototype;
25728
+ _proto.componentDidMount = function componentDidMount() {
25729
+ this.mounted = true;
25730
+ this.setState({
25731
+ contextValue: {
25732
+ isMounting: false
25733
+ }
25734
+ });
25735
+ };
25736
+ _proto.componentWillUnmount = function componentWillUnmount() {
25737
+ this.mounted = false;
25738
+ };
25739
+ TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
25740
+ var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
25741
+ return {
25742
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
25743
+ firstRender: false
25744
+ };
25745
+ };
25746
+ _proto.handleExited = function handleExited(child, node2) {
25747
+ var currentChildMapping = getChildMapping(this.props.children);
25748
+ if (child.key in currentChildMapping) return;
25749
+ if (child.props.onExited) {
25750
+ child.props.onExited(node2);
25751
+ }
25752
+ if (this.mounted) {
25753
+ this.setState(function(state) {
25754
+ var children2 = _extends$1({}, state.children);
25755
+ delete children2[child.key];
25756
+ return {
25757
+ children: children2
25758
+ };
25759
+ });
25760
+ }
25761
+ };
25762
+ _proto.render = function render() {
25763
+ var _this$props = this.props, Component2 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
25764
+ var contextValue = this.state.contextValue;
25765
+ var children2 = values(this.state.children).map(childFactory2);
25766
+ delete props.appear;
25767
+ delete props.enter;
25768
+ delete props.exit;
25769
+ if (Component2 === null) {
25770
+ return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
25771
+ value: contextValue
25772
+ }, children2);
25773
+ }
25774
+ return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
25775
+ value: contextValue
25776
+ }, /* @__PURE__ */ React__default.createElement(Component2, props, children2));
25777
+ };
25778
+ return TransitionGroup2;
25779
+ }(React__default.Component);
25780
+ TransitionGroup.propTypes = {
25781
+ /**
25782
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
25783
+ * behavior by providing a `component` prop.
25784
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
25785
+ * you can pass in `component={null}`. This is useful if the wrapping div
25786
+ * borks your css styles.
25787
+ */
25788
+ component: PropTypes.any,
25789
+ /**
25790
+ * A set of `<Transition>` components, that are toggled `in` and out as they
25791
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
25792
+ * remember to spread them through if you are wrapping the `<Transition>` as
25793
+ * with our `<Fade>` example.
25794
+ *
25795
+ * While this component is meant for multiple `Transition` or `CSSTransition`
25796
+ * children, sometimes you may want to have a single transition child with
25797
+ * content that you want to be transitioned out and in when you change it
25798
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
25799
+ * the transition child as you change its content, this will cause
25800
+ * `TransitionGroup` to transition the child out and back in.
25801
+ */
25802
+ children: PropTypes.node,
25803
+ /**
25804
+ * A convenience prop that enables or disables appear animations
25805
+ * for all children. Note that specifying this will override any defaults set
25806
+ * on individual children Transitions.
25807
+ */
25808
+ appear: PropTypes.bool,
25809
+ /**
25810
+ * A convenience prop that enables or disables enter animations
25811
+ * for all children. Note that specifying this will override any defaults set
25812
+ * on individual children Transitions.
25813
+ */
25814
+ enter: PropTypes.bool,
25815
+ /**
25816
+ * A convenience prop that enables or disables exit animations
25817
+ * for all children. Note that specifying this will override any defaults set
25818
+ * on individual children Transitions.
25819
+ */
25820
+ exit: PropTypes.bool,
25821
+ /**
25822
+ * You may need to apply reactive updates to a child as it is exiting.
25823
+ * This is generally done by using `cloneElement` however in the case of an exiting
25824
+ * child the element has already been removed and not accessible to the consumer.
25825
+ *
25826
+ * If you do need to update a child as it leaves you can provide a `childFactory`
25827
+ * to wrap every child, even the ones that are leaving.
25828
+ *
25829
+ * @type Function(child: ReactElement) -> ReactElement
25830
+ */
25831
+ childFactory: PropTypes.func
25832
+ };
25833
+ TransitionGroup.defaultProps = defaultProps$P;
25834
+ const UNINITIALIZED = {};
25835
+ function useLazyRef(init, initArg) {
25836
+ const ref = React.useRef(UNINITIALIZED);
25837
+ if (ref.current === UNINITIALIZED) {
25838
+ ref.current = init(initArg);
25839
+ }
25840
+ return ref;
25841
+ }
25842
+ const EMPTY$1 = [];
25843
+ function useOnMount(fn) {
25844
+ React.useEffect(fn, EMPTY$1);
25845
+ }
25846
+ class Timeout {
25847
+ constructor() {
25848
+ __publicField(this, "currentId", null);
25849
+ __publicField(this, "clear", () => {
25850
+ if (this.currentId !== null) {
25851
+ clearTimeout(this.currentId);
25852
+ this.currentId = null;
25853
+ }
25854
+ });
25855
+ __publicField(this, "disposeEffect", () => {
25856
+ return this.clear;
25857
+ });
25858
+ }
25859
+ static create() {
25860
+ return new Timeout();
25861
+ }
25862
+ /**
25863
+ * Executes `fn` after `delay`, clearing any previously scheduled call.
25864
+ */
25865
+ start(delay, fn) {
25866
+ this.clear();
25867
+ this.currentId = setTimeout(() => {
25868
+ this.currentId = null;
25869
+ fn();
25870
+ }, delay);
25871
+ }
25872
+ }
25873
+ function useTimeout() {
25874
+ const timeout = useLazyRef(Timeout.create).current;
25875
+ useOnMount(timeout.disposeEffect);
25876
+ return timeout;
25877
+ }
25878
+ function isClassComponent(elementType) {
25879
+ const {
25880
+ prototype = {}
25881
+ } = elementType;
25882
+ return Boolean(prototype.isReactComponent);
25883
+ }
25884
+ function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
25885
+ const propValue = props[propName];
25886
+ const safePropName = propFullName || propName;
25887
+ if (propValue == null || // When server-side rendering React doesn't warn either.
25888
+ // This is not an accurate check for SSR.
25889
+ // This is only in place for emotion compat.
25890
+ // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
25891
+ typeof window === "undefined") {
25892
+ return null;
25893
+ }
25894
+ let warningHint;
25895
+ if (typeof propValue === "function" && !isClassComponent(propValue)) {
25896
+ warningHint = "Did you accidentally provide a plain function component instead?";
25897
+ }
25898
+ if (warningHint !== void 0) {
25899
+ return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
25900
+ }
25901
+ return null;
25902
+ }
25903
+ const elementTypeAcceptingRef$1 = chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef);
25858
25904
  function getTypeByValue(value) {
25859
25905
  const valueType = typeof value;
25860
25906
  switch (valueType) {
@@ -33746,6 +33792,7 @@ function Legend(props) {
33746
33792
  positionRelative = false,
33747
33793
  highContrast = false,
33748
33794
  obsType,
33795
+ isPointsLayer = false,
33749
33796
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
33750
33797
  featureType: _featureType = void 0,
33751
33798
  // Unused but accepted for API compatibility
@@ -33753,6 +33800,9 @@ function Legend(props) {
33753
33800
  considerSelections = true,
33754
33801
  obsColorEncoding,
33755
33802
  featureSelection,
33803
+ featureFilterMode,
33804
+ featureColor,
33805
+ featureIndex,
33756
33806
  featureLabelsMap,
33757
33807
  featureValueColormap,
33758
33808
  featureValueColormapRange,
@@ -33796,15 +33846,95 @@ function Legend(props) {
33796
33846
  debouncedSetRange(rangeValue);
33797
33847
  }
33798
33848
  }, [debouncedSetRange]);
33849
+ const obsLabel = capitalize$2(obsType ?? null);
33799
33850
  const isDarkTheme = theme === "dark";
33800
- const isStaticColor = obsColorEncoding === "spatialChannelColor" || obsColorEncoding === "spatialLayerColor";
33801
- const isSetColor = obsColorEncoding === "cellSetSelection";
33851
+ const isStaticColor = !isPointsLayer && (obsColorEncoding === "spatialChannelColor" || obsColorEncoding === "spatialLayerColor");
33852
+ const isSetColor = !isPointsLayer && obsColorEncoding === "cellSetSelection";
33802
33853
  const layerColor = Array.isArray(spatialLayerColor) && spatialLayerColor.length === 3 ? spatialLayerColor : getDefaultColor(theme ?? "light");
33803
33854
  const channelColor = Array.isArray(spatialChannelColor) && spatialChannelColor.length === 3 ? spatialChannelColor : getDefaultColor(theme ?? "light");
33804
33855
  const staticColor = obsColorEncoding === "spatialChannelColor" ? channelColor : layerColor;
33805
- const visible = visibleProp && (!considerSelections || ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && featureSelection && Array.isArray(featureSelection) && featureSelection.length >= 1 || isSetColor && ((obsSetSelection == null ? void 0 : obsSetSelection.length) ?? 0) > 0 && ((obsSetColor == null ? void 0 : obsSetColor.length) ?? 0) > 0 || isStaticColor);
33856
+ const visible = visibleProp && (!considerSelections || ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && featureSelection && Array.isArray(featureSelection) && featureSelection.length >= 1 || isSetColor && ((obsSetSelection == null ? void 0 : obsSetSelection.length) ?? 0) > 0 && ((obsSetColor == null ? void 0 : obsSetColor.length) ?? 0) > 0 || isStaticColor || isPointsLayer);
33857
+ const pointsLegendElements = [];
33858
+ if (isPointsLayer) {
33859
+ const MAX_NUM_COLORS = 10;
33860
+ const hasFeatureSelection = Array.isArray(featureSelection) && featureSelection.length > 0;
33861
+ const showUnselected = featureFilterMode !== "featureSelection";
33862
+ if (obsColorEncoding === "spatialLayerColor") {
33863
+ if (!hasFeatureSelection) {
33864
+ pointsLegendElements.push({
33865
+ name: obsLabel,
33866
+ color: staticColor
33867
+ });
33868
+ } else {
33869
+ const limitedFeatureSelection = featureSelection.slice(0, MAX_NUM_COLORS);
33870
+ limitedFeatureSelection.forEach((featureName) => {
33871
+ pointsLegendElements.push({
33872
+ name: featureName,
33873
+ color: staticColor
33874
+ });
33875
+ });
33876
+ }
33877
+ } else if (obsColorEncoding === "geneSelection") {
33878
+ if (!hasFeatureSelection) {
33879
+ pointsLegendElements.push({
33880
+ name: obsLabel,
33881
+ color: staticColor
33882
+ });
33883
+ } else {
33884
+ const limitedFeatureSelection = featureSelection.slice(0, MAX_NUM_COLORS);
33885
+ limitedFeatureSelection.forEach((featureName) => {
33886
+ var _a3;
33887
+ const featureColorMatch = Array.isArray(featureColor) ? (_a3 = featureColor.find((fc) => fc.name === featureName)) == null ? void 0 : _a3.color : null;
33888
+ pointsLegendElements.push({
33889
+ name: featureName,
33890
+ // If no color is specified for this feature, use staticColor.
33891
+ color: featureColorMatch ?? staticColor
33892
+ });
33893
+ });
33894
+ }
33895
+ } else if (obsColorEncoding === "randomByFeature") {
33896
+ if (!hasFeatureSelection) {
33897
+ pointsLegendElements.push({
33898
+ name: obsLabel,
33899
+ // For now, using black and white for this.
33900
+ // (It should not match any color in PALETTE)
33901
+ color: isDarkTheme ? [255, 255, 255] : [0, 0, 0]
33902
+ });
33903
+ } else {
33904
+ const limitedFeatureSelection = featureSelection.slice(0, MAX_NUM_COLORS);
33905
+ limitedFeatureSelection.forEach((featureName) => {
33906
+ const varIndex = (featureIndex ?? []).indexOf(featureName);
33907
+ const featureColorMatch = varIndex >= 0 ? PALETTE[varIndex % PALETTE.length] : null;
33908
+ pointsLegendElements.push({
33909
+ name: featureName,
33910
+ // If no color is specified for this feature, use staticColor.
33911
+ color: featureColorMatch ?? staticColor
33912
+ });
33913
+ });
33914
+ }
33915
+ } else if (obsColorEncoding === "random") {
33916
+ pointsLegendElements.push({
33917
+ name: obsLabel,
33918
+ // For now, using black and white for this.
33919
+ // (It should not match any color in PALETTE)
33920
+ color: isDarkTheme ? [255, 255, 255] : [0, 0, 0]
33921
+ });
33922
+ }
33923
+ if (showUnselected) {
33924
+ pointsLegendElements.push({
33925
+ name: "Unselected",
33926
+ color: getDefaultColor(theme ?? "light")
33927
+ });
33928
+ }
33929
+ }
33806
33930
  const levelZeroNames = useMemo(() => Array.from(new Set((obsSetSelection == null ? void 0 : obsSetSelection.map((setPath) => setPath[0])) || [])), [obsSetSelection]);
33807
- const dynamicHeight = isSetColor && obsSetSelection ? levelZeroNames.length * titleHeight + ((obsSetSelection == null ? void 0 : obsSetSelection.length) ?? 0) * (rectHeight + rectMarginY) : height2 + (!pointsVisible && contoursVisible ? 25 : 0);
33931
+ const dynamicHeight = isPointsLayer ? (
33932
+ // Height logic for points layers.
33933
+ pointsLegendElements.length * (rectHeight + rectMarginY) + titleHeight
33934
+ ) : (
33935
+ // Height logic for non-points layers.
33936
+ isSetColor && obsSetSelection ? levelZeroNames.length * titleHeight + ((obsSetSelection == null ? void 0 : obsSetSelection.length) ?? 0) * (rectHeight + rectMarginY) : height2 + (!pointsVisible && contoursVisible ? 25 : 0)
33937
+ );
33808
33938
  const availHeight = maxHeight2 !== null ? Math.max(0, maxHeight2 - 4) : Infinity;
33809
33939
  const needsScroll = Number.isFinite(availHeight) && dynamicHeight > availHeight + 1;
33810
33940
  useEffect(() => {
@@ -33816,8 +33946,8 @@ function Legend(props) {
33816
33946
  svg.selectAll("g").remove();
33817
33947
  svg.attr("width", width2).attr("height", dynamicHeight);
33818
33948
  const g2 = svg.append("g").attr("width", width2).attr("height", dynamicHeight);
33819
- const showInteractiveSlider2 = setFeatureValueColormapRange && ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && pointsVisible && featureValueColormap;
33820
- if (!considerSelections || ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "")) {
33949
+ const showInteractiveSlider2 = !isPointsLayer && setFeatureValueColormapRange && ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && pointsVisible && featureValueColormap;
33950
+ if (!isPointsLayer && (!considerSelections || ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? ""))) {
33821
33951
  const combinedExtent = combineExtents(extent2 ?? null, featureAggregationStrategy ?? null) || [0, 1];
33822
33952
  const [xMin, xMax] = combinedExtent;
33823
33953
  if (featureValueColormap && pointsVisible) {
@@ -33877,10 +34007,10 @@ function Legend(props) {
33877
34007
  });
33878
34008
  }
33879
34009
  }
33880
- if (isStaticColor) {
33881
- g2.append("rect").attr("x", 0).attr("y", titleHeight).attr("width", width2).attr("height", rectHeight).attr("fill", `rgb(${staticColor[0]},${staticColor[1]},${staticColor[2]})`);
34010
+ if (!isPointsLayer && isStaticColor) {
34011
+ g2.append("rect").attr("x", 0).attr("y", titleHeight).attr("width", width2 - 4).attr("height", rectHeight).attr("fill", `rgb(${staticColor[0]},${staticColor[1]},${staticColor[2]})`);
33882
34012
  }
33883
- if (isSetColor && obsSetSelection && obsSetColor) {
34013
+ if (!isPointsLayer && isSetColor && obsSetSelection && obsSetColor) {
33884
34014
  const obsSetSelectionByLevelZero = {};
33885
34015
  obsSetSelection.forEach((setPath) => {
33886
34016
  const levelZeroName = setPath[0];
@@ -33902,6 +34032,16 @@ function Legend(props) {
33902
34032
  });
33903
34033
  });
33904
34034
  }
34035
+ if (isPointsLayer) {
34036
+ let y = 0;
34037
+ g2.append("text").attr("text-anchor", "start").attr("dominant-baseline", "hanging").attr("x", 0).attr("y", y).text("Points").style("font-size", "9px").style("fill", foregroundColor);
34038
+ y += titleHeight;
34039
+ pointsLegendElements.forEach(({ name: name2, color: color2 }) => {
34040
+ g2.append("rect").attr("x", 0).attr("y", y).attr("width", rectHeight).attr("height", rectHeight).attr("fill", `rgb(${color2[0]},${color2[1]},${color2[2]})`);
34041
+ g2.append("text").attr("text-anchor", "start").attr("dominant-baseline", "hanging").attr("x", rectHeight + rectMarginX).attr("y", y).text(name2).style("font-size", "9px").style("fill", foregroundColor);
34042
+ y += rectHeight + rectMarginY;
34043
+ });
34044
+ }
33905
34045
  const featureSelectionLabelRaw = featureSelection && featureSelection.length >= 1 && !isStaticColor ? featureSelection.map((geneName) => (featureLabelsMap == null ? void 0 : featureLabelsMap.get(geneName)) || (featureLabelsMap == null ? void 0 : featureLabelsMap.get(cleanFeatureId(geneName))) || geneName) : null;
33906
34046
  let featureSelectionLabelRawStr = "";
33907
34047
  if (featureAggregationStrategy === "first") {
@@ -33912,23 +34052,30 @@ function Legend(props) {
33912
34052
  const i2 = featureAggregationStrategy;
33913
34053
  featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[i2];
33914
34054
  } else if (featureAggregationStrategy === "sum") {
33915
- featureSelectionLabelRawStr = "Sum of features";
34055
+ if (Array.isArray(featureSelection) && featureSelection.length === 1) {
34056
+ featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
34057
+ } else {
34058
+ featureSelectionLabelRawStr = "Sum of features";
34059
+ }
33916
34060
  } else if (featureAggregationStrategy === "mean") {
33917
- featureSelectionLabelRawStr = "Mean of features";
34061
+ if (Array.isArray(featureSelection) && featureSelection.length === 1) {
34062
+ featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
34063
+ } else {
34064
+ featureSelectionLabelRawStr = "Mean of features";
34065
+ }
33918
34066
  } else {
33919
34067
  featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
33920
34068
  }
33921
34069
  const combinedMissing = combineMissings(missing ?? null, featureAggregationStrategy ?? null);
33922
34070
  const featureSelectionLabel = combinedMissing ? `${featureSelectionLabelRawStr} (${Math.round(combinedMissing * 100)}% NaN)` : featureSelectionLabelRawStr;
33923
- const obsLabel = capitalize$2(obsType ?? null);
33924
34071
  const featureLabel = considerSelections ? featureSelectionLabel || capitalize$2(featureValueType ?? null) : capitalize$2(featureValueType ?? null);
33925
34072
  const mainLabel = showObsLabel ? obsLabel : featureLabel;
33926
34073
  const subLabel = showObsLabel ? featureLabel : null;
33927
34074
  const hasSubLabel = subLabel !== null;
33928
- if (!isSetColor) {
34075
+ if (!isPointsLayer && !isSetColor) {
33929
34076
  g2.append("text").attr("text-anchor", hasSubLabel ? "start" : "end").attr("dominant-baseline", "hanging").attr("x", hasSubLabel ? 0 : width2 - 4).attr("y", 0).text(mainLabel ?? "").style("font-size", "10px").style("fill", foregroundColor);
33930
34077
  if (hasSubLabel) {
33931
- g2.append("text").attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("x", width2).attr("y", titleHeight + rectHeight).text(subLabel ?? "").style("font-size", "9px").style("fill", foregroundColor);
34078
+ g2.append("text").attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("x", width2 - 5).attr("y", titleHeight + rectHeight).text(subLabel ?? "").style("font-size", "9px").style("fill", foregroundColor);
33932
34079
  }
33933
34080
  }
33934
34081
  }, [
@@ -33964,7 +34111,7 @@ function Legend(props) {
33964
34111
  showObsLabel,
33965
34112
  staticColor
33966
34113
  ]);
33967
- const showInteractiveSlider = setFeatureValueColormapRange && ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && pointsVisible && featureValueColormap;
34114
+ const showInteractiveSlider = !isPointsLayer && setFeatureValueColormapRange && ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && pointsVisible && featureValueColormap;
33968
34115
  const globalExtent = useMemo(() => {
33969
34116
  const combined = combineExtents(extent2 ?? null, featureAggregationStrategy ?? null);
33970
34117
  return combined || [0, 1];
@@ -112869,7 +113016,7 @@ function clipExtent(x02, y02, x12, y12) {
112869
113016
  return clipStream;
112870
113017
  };
112871
113018
  }
112872
- function extent$1() {
113019
+ function extent() {
112873
113020
  var x02 = 0, y02 = 0, x12 = 960, y12 = 500, cache2, cacheStream, clip2;
112874
113021
  return clip2 = {
112875
113022
  stream: function(stream) {
@@ -114203,7 +114350,7 @@ const d3Geo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
114203
114350
  geoBounds: bounds,
114204
114351
  geoCentroid: centroid,
114205
114352
  geoCircle: circle$1,
114206
- geoClipExtent: extent$1,
114353
+ geoClipExtent: extent,
114207
114354
  geoConicConformal: conicConformal,
114208
114355
  geoConicConformalRaw: conicConformalRaw,
114209
114356
  geoConicEqualArea: conicEqualArea,
@@ -138034,22 +138181,22 @@ function addDecoder(cases, importFn) {
138034
138181
  }
138035
138182
  cases.forEach((c) => registry$1.set(c, importFn));
138036
138183
  }
138037
- addDecoder([void 0, 1], () => import("./raw-CVpDtOvK.js").then((m) => m.default));
138038
- addDecoder(5, () => import("./lzw-Bk7eILPv.js").then((m) => m.default));
138184
+ addDecoder([void 0, 1], () => import("./raw-X9wB5QOd.js").then((m) => m.default));
138185
+ addDecoder(5, () => import("./lzw-CqQYDnuj.js").then((m) => m.default));
138039
138186
  addDecoder(6, () => {
138040
138187
  throw new Error("old style JPEG compression is not supported.");
138041
138188
  });
138042
- addDecoder(7, () => import("./jpeg-BwtBYp_n.js").then((m) => m.default));
138043
- addDecoder([8, 32946], () => import("./deflate-BCK9hcdb.js").then((m) => m.default));
138044
- addDecoder(32773, () => import("./packbits-DwgrK_HN.js").then((m) => m.default));
138189
+ addDecoder(7, () => import("./jpeg-BgSqSBcW.js").then((m) => m.default));
138190
+ addDecoder([8, 32946], () => import("./deflate-BkVXwIOr.js").then((m) => m.default));
138191
+ addDecoder(32773, () => import("./packbits-DLjqHTtn.js").then((m) => m.default));
138045
138192
  addDecoder(
138046
138193
  34887,
138047
- () => import("./lerc-C6yVuiGq.js").then(async (m) => {
138194
+ () => import("./lerc-Bh37u7Qj.js").then(async (m) => {
138048
138195
  await m.zstd.init();
138049
138196
  return m;
138050
138197
  }).then((m) => m.default)
138051
138198
  );
138052
- addDecoder(50001, () => import("./webimage-DpgOps3O.js").then((m) => m.default));
138199
+ addDecoder(50001, () => import("./webimage-CgODQeEE.js").then((m) => m.default));
138053
138200
  function decodeRowAcc(row, stride) {
138054
138201
  let length2 = row.length - stride;
138055
138202
  let offset2 = 0;
@@ -148018,36 +148165,8 @@ void main() {
148018
148165
  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
148019
148166
  }
148020
148167
  `;
148021
- function extent(values2, valueof) {
148022
- let min;
148023
- let max2;
148024
- {
148025
- for (const value of values2) {
148026
- if (value != null) {
148027
- if (min === void 0) {
148028
- if (value >= value) min = max2 = value;
148029
- } else {
148030
- if (min > value) min = value;
148031
- if (max2 < value) max2 = value;
148032
- }
148033
- }
148034
- }
148035
- }
148036
- return [min, max2];
148037
- }
148038
- function max(values2, valueof) {
148039
- let max2;
148040
- {
148041
- for (const value of values2) {
148042
- if (value != null && (max2 < value || max2 === void 0 && value >= value)) {
148043
- max2 = value;
148044
- }
148045
- }
148046
- }
148047
- return max2;
148048
- }
148049
148168
  function normalize(arr) {
148050
- const [min, max2] = extent(arr);
148169
+ const [min, max2] = extent$1(arr);
148051
148170
  const ratio = 255 / (max2 - min);
148052
148171
  const data = new Uint8Array(arr.map((i2) => Math.floor((i2 - min) * ratio)));
148053
148172
  return data;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, H } from "./index-CIYB_Yf2.js";
1
+ import { a, H } from "./index-DYmO2OXo.js";
2
2
  export {
3
3
  a as Heatmap,
4
4
  H as HeatmapSubscriber
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-CIYB_Yf2.js";
1
+ import { B as BaseDecoder } from "./index-DYmO2OXo.js";
2
2
  const dctZigZag = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-CIYB_Yf2.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-DYmO2OXo.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-CIYB_Yf2.js";
1
+ import { B as BaseDecoder } from "./index-DYmO2OXo.js";
2
2
  const MIN_BITS = 9;
3
3
  const CLEAR_CODE = 256;
4
4
  const EOI_CODE = 257;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-CIYB_Yf2.js";
1
+ import { B as BaseDecoder } from "./index-DYmO2OXo.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-CIYB_Yf2.js";
1
+ import { B as BaseDecoder } from "./index-DYmO2OXo.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-CIYB_Yf2.js";
1
+ import { B as BaseDecoder } from "./index-DYmO2OXo.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/heatmap",
3
- "version": "3.8.10",
3
+ "version": "3.9.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,15 +19,15 @@
19
19
  "lodash-es": "^4.17.21",
20
20
  "uuid": "^9.0.0",
21
21
  "react-aria": "^3.28.0",
22
- "@vitessce/styles": "3.8.10",
23
- "@vitessce/constants-internal": "3.8.10",
24
- "@vitessce/gl": "3.8.10",
25
- "@vitessce/legend": "3.8.10",
26
- "@vitessce/sets-utils": "3.8.10",
27
- "@vitessce/tooltip": "3.8.10",
28
- "@vitessce/utils": "3.8.10",
29
- "@vitessce/vit-s": "3.8.10",
30
- "@vitessce/workers": "3.8.10"
22
+ "@vitessce/constants-internal": "3.9.0",
23
+ "@vitessce/gl": "3.9.0",
24
+ "@vitessce/styles": "3.9.0",
25
+ "@vitessce/legend": "3.9.0",
26
+ "@vitessce/sets-utils": "3.9.0",
27
+ "@vitessce/tooltip": "3.9.0",
28
+ "@vitessce/workers": "3.9.0",
29
+ "@vitessce/vit-s": "3.9.0",
30
+ "@vitessce/utils": "3.9.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "^6.6.3",