@vitessce/scatterplot-embedding 3.8.9 → 3.8.13
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.
- package/dist/{deflate-YIIHzd8y.js → deflate-ClaAmriP.js} +1 -1
- package/dist/{index-DYO3tfis.js → index-BK98jzeZ.js} +634 -411
- package/dist/index.js +1 -1
- package/dist/{jpeg-BBSvSY8b.js → jpeg-Ci-wqRKm.js} +1 -1
- package/dist/{lerc-DsiDEIic.js → lerc-S2pXAGyz.js} +1 -1
- package/dist/{lzw-B2nz96hr.js → lzw--H4kL7kE.js} +1 -1
- package/dist/{packbits-JodEChjB.js → packbits-zSU7Xz9P.js} +1 -1
- package/dist/{raw-xM2f2nBA.js → raw-CDyxv3KP.js} +1 -1
- package/dist/{webimage-Bk5jq0He.js → webimage-dTZh6fML.js} +1 -1
- package/dist-tsc/EmbeddingScatterplotSubscriber.d.ts.map +1 -1
- package/dist-tsc/EmbeddingScatterplotSubscriber.js +2 -2
- package/package.json +8 -8
- package/src/EmbeddingScatterplotSubscriber.js +2 -1
|
@@ -3134,7 +3134,7 @@ function aggregateFeatureArrays(arrays, strategy) {
|
|
|
3134
3134
|
resultArray[i2] /= numArrays;
|
|
3135
3135
|
}
|
|
3136
3136
|
}
|
|
3137
|
-
return resultArray;
|
|
3137
|
+
return Array.from(resultArray);
|
|
3138
3138
|
}
|
|
3139
3139
|
if (strategy === "difference") {
|
|
3140
3140
|
if (numArrays !== 2) {
|
|
@@ -3147,7 +3147,7 @@ function aggregateFeatureArrays(arrays, strategy) {
|
|
|
3147
3147
|
for (let i2 = 0; i2 < firstArrayLength; i2++) {
|
|
3148
3148
|
resultArray[i2] = arr0[i2] - arr1[i2];
|
|
3149
3149
|
}
|
|
3150
|
-
return resultArray;
|
|
3150
|
+
return Array.from(resultArray);
|
|
3151
3151
|
}
|
|
3152
3152
|
throw new Error(`Unknown aggregation strategy: ${strategy}`);
|
|
3153
3153
|
}
|
|
@@ -9910,6 +9910,8 @@ const CoordinationType$1 = {
|
|
|
9910
9910
|
// Per-spatial-layer
|
|
9911
9911
|
SPATIAL_MAX_RESOLUTION: "spatialMaxResolution",
|
|
9912
9912
|
// Per-image-channel (for spatial-accelerated)
|
|
9913
|
+
SPATIAL_LOD_FACTOR: "spatialLodFactor",
|
|
9914
|
+
// LOD factor for 3D volume rendering
|
|
9913
9915
|
// For clipping plane sliders
|
|
9914
9916
|
SPATIAL_SLICE_X: "spatialSliceX",
|
|
9915
9917
|
SPATIAL_SLICE_Y: "spatialSliceY",
|
|
@@ -123401,22 +123403,22 @@ function addDecoder(cases, importFn) {
|
|
|
123401
123403
|
}
|
|
123402
123404
|
cases.forEach((c2) => registry$1.set(c2, importFn));
|
|
123403
123405
|
}
|
|
123404
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
123405
|
-
addDecoder(5, () => import("./lzw
|
|
123406
|
+
addDecoder([void 0, 1], () => import("./raw-CDyxv3KP.js").then((m2) => m2.default));
|
|
123407
|
+
addDecoder(5, () => import("./lzw--H4kL7kE.js").then((m2) => m2.default));
|
|
123406
123408
|
addDecoder(6, () => {
|
|
123407
123409
|
throw new Error("old style JPEG compression is not supported.");
|
|
123408
123410
|
});
|
|
123409
|
-
addDecoder(7, () => import("./jpeg-
|
|
123410
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
123411
|
-
addDecoder(32773, () => import("./packbits-
|
|
123411
|
+
addDecoder(7, () => import("./jpeg-Ci-wqRKm.js").then((m2) => m2.default));
|
|
123412
|
+
addDecoder([8, 32946], () => import("./deflate-ClaAmriP.js").then((m2) => m2.default));
|
|
123413
|
+
addDecoder(32773, () => import("./packbits-zSU7Xz9P.js").then((m2) => m2.default));
|
|
123412
123414
|
addDecoder(
|
|
123413
123415
|
34887,
|
|
123414
|
-
() => import("./lerc-
|
|
123416
|
+
() => import("./lerc-S2pXAGyz.js").then(async (m2) => {
|
|
123415
123417
|
await m2.zstd.init();
|
|
123416
123418
|
return m2;
|
|
123417
123419
|
}).then((m2) => m2.default)
|
|
123418
123420
|
);
|
|
123419
|
-
addDecoder(50001, () => import("./webimage-
|
|
123421
|
+
addDecoder(50001, () => import("./webimage-dTZh6fML.js").then((m2) => m2.default));
|
|
123420
123422
|
function decodeRowAcc(row, stride) {
|
|
123421
123423
|
let length2 = row.length - stride;
|
|
123422
123424
|
let offset2 = 0;
|
|
@@ -143466,11 +143468,6 @@ const { tss } = createTss({
|
|
|
143466
143468
|
"usePlugin": useMuiThemeStyleOverridesPlugin
|
|
143467
143469
|
});
|
|
143468
143470
|
const useStyles$4 = tss.create({});
|
|
143469
|
-
function chainPropTypes(propType1, propType2) {
|
|
143470
|
-
return function validate2(...args) {
|
|
143471
|
-
return propType1(...args) || propType2(...args);
|
|
143472
|
-
};
|
|
143473
|
-
}
|
|
143474
143471
|
const memoTheme = unstable_memoTheme;
|
|
143475
143472
|
({
|
|
143476
143473
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -143489,332 +143486,6 @@ const memoTheme = unstable_memoTheme;
|
|
|
143489
143486
|
function useDefaultProps(params) {
|
|
143490
143487
|
return useDefaultProps$1(params);
|
|
143491
143488
|
}
|
|
143492
|
-
function _extends$1() {
|
|
143493
|
-
return _extends$1 = Object.assign ? Object.assign.bind() : function(n2) {
|
|
143494
|
-
for (var e3 = 1; e3 < arguments.length; e3++) {
|
|
143495
|
-
var t = arguments[e3];
|
|
143496
|
-
for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]);
|
|
143497
|
-
}
|
|
143498
|
-
return n2;
|
|
143499
|
-
}, _extends$1.apply(null, arguments);
|
|
143500
|
-
}
|
|
143501
|
-
function _objectWithoutPropertiesLoose(r2, e3) {
|
|
143502
|
-
if (null == r2) return {};
|
|
143503
|
-
var t = {};
|
|
143504
|
-
for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) {
|
|
143505
|
-
if (-1 !== e3.indexOf(n2)) continue;
|
|
143506
|
-
t[n2] = r2[n2];
|
|
143507
|
-
}
|
|
143508
|
-
return t;
|
|
143509
|
-
}
|
|
143510
|
-
function _setPrototypeOf(t, e3) {
|
|
143511
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e4) {
|
|
143512
|
-
return t2.__proto__ = e4, t2;
|
|
143513
|
-
}, _setPrototypeOf(t, e3);
|
|
143514
|
-
}
|
|
143515
|
-
function _inheritsLoose(t, o2) {
|
|
143516
|
-
t.prototype = Object.create(o2.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o2);
|
|
143517
|
-
}
|
|
143518
|
-
const TransitionGroupContext = React__default.createContext(null);
|
|
143519
|
-
function _assertThisInitialized(e3) {
|
|
143520
|
-
if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
143521
|
-
return e3;
|
|
143522
|
-
}
|
|
143523
|
-
function getChildMapping(children2, mapFn) {
|
|
143524
|
-
var mapper = function mapper2(child) {
|
|
143525
|
-
return mapFn && isValidElement(child) ? mapFn(child) : child;
|
|
143526
|
-
};
|
|
143527
|
-
var result = /* @__PURE__ */ Object.create(null);
|
|
143528
|
-
if (children2) Children.map(children2, function(c2) {
|
|
143529
|
-
return c2;
|
|
143530
|
-
}).forEach(function(child) {
|
|
143531
|
-
result[child.key] = mapper(child);
|
|
143532
|
-
});
|
|
143533
|
-
return result;
|
|
143534
|
-
}
|
|
143535
|
-
function mergeChildMappings(prev2, next2) {
|
|
143536
|
-
prev2 = prev2 || {};
|
|
143537
|
-
next2 = next2 || {};
|
|
143538
|
-
function getValueForKey(key) {
|
|
143539
|
-
return key in next2 ? next2[key] : prev2[key];
|
|
143540
|
-
}
|
|
143541
|
-
var nextKeysPending = /* @__PURE__ */ Object.create(null);
|
|
143542
|
-
var pendingKeys = [];
|
|
143543
|
-
for (var prevKey in prev2) {
|
|
143544
|
-
if (prevKey in next2) {
|
|
143545
|
-
if (pendingKeys.length) {
|
|
143546
|
-
nextKeysPending[prevKey] = pendingKeys;
|
|
143547
|
-
pendingKeys = [];
|
|
143548
|
-
}
|
|
143549
|
-
} else {
|
|
143550
|
-
pendingKeys.push(prevKey);
|
|
143551
|
-
}
|
|
143552
|
-
}
|
|
143553
|
-
var i2;
|
|
143554
|
-
var childMapping = {};
|
|
143555
|
-
for (var nextKey in next2) {
|
|
143556
|
-
if (nextKeysPending[nextKey]) {
|
|
143557
|
-
for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
|
|
143558
|
-
var pendingNextKey = nextKeysPending[nextKey][i2];
|
|
143559
|
-
childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
|
|
143560
|
-
}
|
|
143561
|
-
}
|
|
143562
|
-
childMapping[nextKey] = getValueForKey(nextKey);
|
|
143563
|
-
}
|
|
143564
|
-
for (i2 = 0; i2 < pendingKeys.length; i2++) {
|
|
143565
|
-
childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
|
|
143566
|
-
}
|
|
143567
|
-
return childMapping;
|
|
143568
|
-
}
|
|
143569
|
-
function getProp(child, prop, props) {
|
|
143570
|
-
return props[prop] != null ? props[prop] : child.props[prop];
|
|
143571
|
-
}
|
|
143572
|
-
function getInitialChildMapping(props, onExited) {
|
|
143573
|
-
return getChildMapping(props.children, function(child) {
|
|
143574
|
-
return cloneElement(child, {
|
|
143575
|
-
onExited: onExited.bind(null, child),
|
|
143576
|
-
in: true,
|
|
143577
|
-
appear: getProp(child, "appear", props),
|
|
143578
|
-
enter: getProp(child, "enter", props),
|
|
143579
|
-
exit: getProp(child, "exit", props)
|
|
143580
|
-
});
|
|
143581
|
-
});
|
|
143582
|
-
}
|
|
143583
|
-
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
|
|
143584
|
-
var nextChildMapping = getChildMapping(nextProps.children);
|
|
143585
|
-
var children2 = mergeChildMappings(prevChildMapping, nextChildMapping);
|
|
143586
|
-
Object.keys(children2).forEach(function(key) {
|
|
143587
|
-
var child = children2[key];
|
|
143588
|
-
if (!isValidElement(child)) return;
|
|
143589
|
-
var hasPrev = key in prevChildMapping;
|
|
143590
|
-
var hasNext = key in nextChildMapping;
|
|
143591
|
-
var prevChild = prevChildMapping[key];
|
|
143592
|
-
var isLeaving = isValidElement(prevChild) && !prevChild.props.in;
|
|
143593
|
-
if (hasNext && (!hasPrev || isLeaving)) {
|
|
143594
|
-
children2[key] = cloneElement(child, {
|
|
143595
|
-
onExited: onExited.bind(null, child),
|
|
143596
|
-
in: true,
|
|
143597
|
-
exit: getProp(child, "exit", nextProps),
|
|
143598
|
-
enter: getProp(child, "enter", nextProps)
|
|
143599
|
-
});
|
|
143600
|
-
} else if (!hasNext && hasPrev && !isLeaving) {
|
|
143601
|
-
children2[key] = cloneElement(child, {
|
|
143602
|
-
in: false
|
|
143603
|
-
});
|
|
143604
|
-
} else if (hasNext && hasPrev && isValidElement(prevChild)) {
|
|
143605
|
-
children2[key] = cloneElement(child, {
|
|
143606
|
-
onExited: onExited.bind(null, child),
|
|
143607
|
-
in: prevChild.props.in,
|
|
143608
|
-
exit: getProp(child, "exit", nextProps),
|
|
143609
|
-
enter: getProp(child, "enter", nextProps)
|
|
143610
|
-
});
|
|
143611
|
-
}
|
|
143612
|
-
});
|
|
143613
|
-
return children2;
|
|
143614
|
-
}
|
|
143615
|
-
var values = Object.values || function(obj) {
|
|
143616
|
-
return Object.keys(obj).map(function(k) {
|
|
143617
|
-
return obj[k];
|
|
143618
|
-
});
|
|
143619
|
-
};
|
|
143620
|
-
var defaultProps = {
|
|
143621
|
-
component: "div",
|
|
143622
|
-
childFactory: function childFactory(child) {
|
|
143623
|
-
return child;
|
|
143624
|
-
}
|
|
143625
|
-
};
|
|
143626
|
-
var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
|
|
143627
|
-
_inheritsLoose(TransitionGroup2, _React$Component);
|
|
143628
|
-
function TransitionGroup2(props, context) {
|
|
143629
|
-
var _this;
|
|
143630
|
-
_this = _React$Component.call(this, props, context) || this;
|
|
143631
|
-
var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
|
|
143632
|
-
_this.state = {
|
|
143633
|
-
contextValue: {
|
|
143634
|
-
isMounting: true
|
|
143635
|
-
},
|
|
143636
|
-
handleExited,
|
|
143637
|
-
firstRender: true
|
|
143638
|
-
};
|
|
143639
|
-
return _this;
|
|
143640
|
-
}
|
|
143641
|
-
var _proto = TransitionGroup2.prototype;
|
|
143642
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
143643
|
-
this.mounted = true;
|
|
143644
|
-
this.setState({
|
|
143645
|
-
contextValue: {
|
|
143646
|
-
isMounting: false
|
|
143647
|
-
}
|
|
143648
|
-
});
|
|
143649
|
-
};
|
|
143650
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
143651
|
-
this.mounted = false;
|
|
143652
|
-
};
|
|
143653
|
-
TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
|
|
143654
|
-
var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
|
|
143655
|
-
return {
|
|
143656
|
-
children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
|
|
143657
|
-
firstRender: false
|
|
143658
|
-
};
|
|
143659
|
-
};
|
|
143660
|
-
_proto.handleExited = function handleExited(child, node2) {
|
|
143661
|
-
var currentChildMapping = getChildMapping(this.props.children);
|
|
143662
|
-
if (child.key in currentChildMapping) return;
|
|
143663
|
-
if (child.props.onExited) {
|
|
143664
|
-
child.props.onExited(node2);
|
|
143665
|
-
}
|
|
143666
|
-
if (this.mounted) {
|
|
143667
|
-
this.setState(function(state) {
|
|
143668
|
-
var children2 = _extends$1({}, state.children);
|
|
143669
|
-
delete children2[child.key];
|
|
143670
|
-
return {
|
|
143671
|
-
children: children2
|
|
143672
|
-
};
|
|
143673
|
-
});
|
|
143674
|
-
}
|
|
143675
|
-
};
|
|
143676
|
-
_proto.render = function render() {
|
|
143677
|
-
var _this$props = this.props, Component2 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
|
|
143678
|
-
var contextValue = this.state.contextValue;
|
|
143679
|
-
var children2 = values(this.state.children).map(childFactory2);
|
|
143680
|
-
delete props.appear;
|
|
143681
|
-
delete props.enter;
|
|
143682
|
-
delete props.exit;
|
|
143683
|
-
if (Component2 === null) {
|
|
143684
|
-
return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
|
|
143685
|
-
value: contextValue
|
|
143686
|
-
}, children2);
|
|
143687
|
-
}
|
|
143688
|
-
return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
|
|
143689
|
-
value: contextValue
|
|
143690
|
-
}, /* @__PURE__ */ React__default.createElement(Component2, props, children2));
|
|
143691
|
-
};
|
|
143692
|
-
return TransitionGroup2;
|
|
143693
|
-
}(React__default.Component);
|
|
143694
|
-
TransitionGroup.propTypes = {
|
|
143695
|
-
/**
|
|
143696
|
-
* `<TransitionGroup>` renders a `<div>` by default. You can change this
|
|
143697
|
-
* behavior by providing a `component` prop.
|
|
143698
|
-
* If you use React v16+ and would like to avoid a wrapping `<div>` element
|
|
143699
|
-
* you can pass in `component={null}`. This is useful if the wrapping div
|
|
143700
|
-
* borks your css styles.
|
|
143701
|
-
*/
|
|
143702
|
-
component: PropTypes.any,
|
|
143703
|
-
/**
|
|
143704
|
-
* A set of `<Transition>` components, that are toggled `in` and out as they
|
|
143705
|
-
* leave. the `<TransitionGroup>` will inject specific transition props, so
|
|
143706
|
-
* remember to spread them through if you are wrapping the `<Transition>` as
|
|
143707
|
-
* with our `<Fade>` example.
|
|
143708
|
-
*
|
|
143709
|
-
* While this component is meant for multiple `Transition` or `CSSTransition`
|
|
143710
|
-
* children, sometimes you may want to have a single transition child with
|
|
143711
|
-
* content that you want to be transitioned out and in when you change it
|
|
143712
|
-
* (e.g. routes, images etc.) In that case you can change the `key` prop of
|
|
143713
|
-
* the transition child as you change its content, this will cause
|
|
143714
|
-
* `TransitionGroup` to transition the child out and back in.
|
|
143715
|
-
*/
|
|
143716
|
-
children: PropTypes.node,
|
|
143717
|
-
/**
|
|
143718
|
-
* A convenience prop that enables or disables appear animations
|
|
143719
|
-
* for all children. Note that specifying this will override any defaults set
|
|
143720
|
-
* on individual children Transitions.
|
|
143721
|
-
*/
|
|
143722
|
-
appear: PropTypes.bool,
|
|
143723
|
-
/**
|
|
143724
|
-
* A convenience prop that enables or disables enter animations
|
|
143725
|
-
* for all children. Note that specifying this will override any defaults set
|
|
143726
|
-
* on individual children Transitions.
|
|
143727
|
-
*/
|
|
143728
|
-
enter: PropTypes.bool,
|
|
143729
|
-
/**
|
|
143730
|
-
* A convenience prop that enables or disables exit animations
|
|
143731
|
-
* for all children. Note that specifying this will override any defaults set
|
|
143732
|
-
* on individual children Transitions.
|
|
143733
|
-
*/
|
|
143734
|
-
exit: PropTypes.bool,
|
|
143735
|
-
/**
|
|
143736
|
-
* You may need to apply reactive updates to a child as it is exiting.
|
|
143737
|
-
* This is generally done by using `cloneElement` however in the case of an exiting
|
|
143738
|
-
* child the element has already been removed and not accessible to the consumer.
|
|
143739
|
-
*
|
|
143740
|
-
* If you do need to update a child as it leaves you can provide a `childFactory`
|
|
143741
|
-
* to wrap every child, even the ones that are leaving.
|
|
143742
|
-
*
|
|
143743
|
-
* @type Function(child: ReactElement) -> ReactElement
|
|
143744
|
-
*/
|
|
143745
|
-
childFactory: PropTypes.func
|
|
143746
|
-
};
|
|
143747
|
-
TransitionGroup.defaultProps = defaultProps;
|
|
143748
|
-
const UNINITIALIZED = {};
|
|
143749
|
-
function useLazyRef(init, initArg) {
|
|
143750
|
-
const ref = React.useRef(UNINITIALIZED);
|
|
143751
|
-
if (ref.current === UNINITIALIZED) {
|
|
143752
|
-
ref.current = init(initArg);
|
|
143753
|
-
}
|
|
143754
|
-
return ref;
|
|
143755
|
-
}
|
|
143756
|
-
const EMPTY = [];
|
|
143757
|
-
function useOnMount(fn) {
|
|
143758
|
-
React.useEffect(fn, EMPTY);
|
|
143759
|
-
}
|
|
143760
|
-
class Timeout {
|
|
143761
|
-
constructor() {
|
|
143762
|
-
__publicField(this, "currentId", null);
|
|
143763
|
-
__publicField(this, "clear", () => {
|
|
143764
|
-
if (this.currentId !== null) {
|
|
143765
|
-
clearTimeout(this.currentId);
|
|
143766
|
-
this.currentId = null;
|
|
143767
|
-
}
|
|
143768
|
-
});
|
|
143769
|
-
__publicField(this, "disposeEffect", () => {
|
|
143770
|
-
return this.clear;
|
|
143771
|
-
});
|
|
143772
|
-
}
|
|
143773
|
-
static create() {
|
|
143774
|
-
return new Timeout();
|
|
143775
|
-
}
|
|
143776
|
-
/**
|
|
143777
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
143778
|
-
*/
|
|
143779
|
-
start(delay, fn) {
|
|
143780
|
-
this.clear();
|
|
143781
|
-
this.currentId = setTimeout(() => {
|
|
143782
|
-
this.currentId = null;
|
|
143783
|
-
fn();
|
|
143784
|
-
}, delay);
|
|
143785
|
-
}
|
|
143786
|
-
}
|
|
143787
|
-
function useTimeout() {
|
|
143788
|
-
const timeout2 = useLazyRef(Timeout.create).current;
|
|
143789
|
-
useOnMount(timeout2.disposeEffect);
|
|
143790
|
-
return timeout2;
|
|
143791
|
-
}
|
|
143792
|
-
function isClassComponent(elementType) {
|
|
143793
|
-
const {
|
|
143794
|
-
prototype = {}
|
|
143795
|
-
} = elementType;
|
|
143796
|
-
return Boolean(prototype.isReactComponent);
|
|
143797
|
-
}
|
|
143798
|
-
function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
|
|
143799
|
-
const propValue = props[propName];
|
|
143800
|
-
const safePropName = propFullName || propName;
|
|
143801
|
-
if (propValue == null || // When server-side rendering React doesn't warn either.
|
|
143802
|
-
// This is not an accurate check for SSR.
|
|
143803
|
-
// This is only in place for emotion compat.
|
|
143804
|
-
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
|
|
143805
|
-
typeof window === "undefined") {
|
|
143806
|
-
return null;
|
|
143807
|
-
}
|
|
143808
|
-
let warningHint;
|
|
143809
|
-
if (typeof propValue === "function" && !isClassComponent(propValue)) {
|
|
143810
|
-
warningHint = "Did you accidentally provide a plain function component instead?";
|
|
143811
|
-
}
|
|
143812
|
-
if (warningHint !== void 0) {
|
|
143813
|
-
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`);
|
|
143814
|
-
}
|
|
143815
|
-
return null;
|
|
143816
|
-
}
|
|
143817
|
-
const elementTypeAcceptingRef$1 = chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef);
|
|
143818
143489
|
function getSvgIconUtilityClass(slot) {
|
|
143819
143490
|
return generateUtilityClass("MuiSvgIcon", slot);
|
|
143820
143491
|
}
|
|
@@ -144231,6 +143902,337 @@ function mergeSlotProps$1(externalSlotProps, defaultSlotProps) {
|
|
|
144231
143902
|
}
|
|
144232
143903
|
};
|
|
144233
143904
|
}
|
|
143905
|
+
function chainPropTypes(propType1, propType2) {
|
|
143906
|
+
return function validate2(...args) {
|
|
143907
|
+
return propType1(...args) || propType2(...args);
|
|
143908
|
+
};
|
|
143909
|
+
}
|
|
143910
|
+
function _extends$1() {
|
|
143911
|
+
return _extends$1 = Object.assign ? Object.assign.bind() : function(n2) {
|
|
143912
|
+
for (var e3 = 1; e3 < arguments.length; e3++) {
|
|
143913
|
+
var t = arguments[e3];
|
|
143914
|
+
for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n2[r2] = t[r2]);
|
|
143915
|
+
}
|
|
143916
|
+
return n2;
|
|
143917
|
+
}, _extends$1.apply(null, arguments);
|
|
143918
|
+
}
|
|
143919
|
+
function _objectWithoutPropertiesLoose(r2, e3) {
|
|
143920
|
+
if (null == r2) return {};
|
|
143921
|
+
var t = {};
|
|
143922
|
+
for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) {
|
|
143923
|
+
if (-1 !== e3.indexOf(n2)) continue;
|
|
143924
|
+
t[n2] = r2[n2];
|
|
143925
|
+
}
|
|
143926
|
+
return t;
|
|
143927
|
+
}
|
|
143928
|
+
function _setPrototypeOf(t, e3) {
|
|
143929
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e4) {
|
|
143930
|
+
return t2.__proto__ = e4, t2;
|
|
143931
|
+
}, _setPrototypeOf(t, e3);
|
|
143932
|
+
}
|
|
143933
|
+
function _inheritsLoose(t, o2) {
|
|
143934
|
+
t.prototype = Object.create(o2.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o2);
|
|
143935
|
+
}
|
|
143936
|
+
const TransitionGroupContext = React__default.createContext(null);
|
|
143937
|
+
function _assertThisInitialized(e3) {
|
|
143938
|
+
if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
143939
|
+
return e3;
|
|
143940
|
+
}
|
|
143941
|
+
function getChildMapping(children2, mapFn) {
|
|
143942
|
+
var mapper = function mapper2(child) {
|
|
143943
|
+
return mapFn && isValidElement(child) ? mapFn(child) : child;
|
|
143944
|
+
};
|
|
143945
|
+
var result = /* @__PURE__ */ Object.create(null);
|
|
143946
|
+
if (children2) Children.map(children2, function(c2) {
|
|
143947
|
+
return c2;
|
|
143948
|
+
}).forEach(function(child) {
|
|
143949
|
+
result[child.key] = mapper(child);
|
|
143950
|
+
});
|
|
143951
|
+
return result;
|
|
143952
|
+
}
|
|
143953
|
+
function mergeChildMappings(prev2, next2) {
|
|
143954
|
+
prev2 = prev2 || {};
|
|
143955
|
+
next2 = next2 || {};
|
|
143956
|
+
function getValueForKey(key) {
|
|
143957
|
+
return key in next2 ? next2[key] : prev2[key];
|
|
143958
|
+
}
|
|
143959
|
+
var nextKeysPending = /* @__PURE__ */ Object.create(null);
|
|
143960
|
+
var pendingKeys = [];
|
|
143961
|
+
for (var prevKey in prev2) {
|
|
143962
|
+
if (prevKey in next2) {
|
|
143963
|
+
if (pendingKeys.length) {
|
|
143964
|
+
nextKeysPending[prevKey] = pendingKeys;
|
|
143965
|
+
pendingKeys = [];
|
|
143966
|
+
}
|
|
143967
|
+
} else {
|
|
143968
|
+
pendingKeys.push(prevKey);
|
|
143969
|
+
}
|
|
143970
|
+
}
|
|
143971
|
+
var i2;
|
|
143972
|
+
var childMapping = {};
|
|
143973
|
+
for (var nextKey in next2) {
|
|
143974
|
+
if (nextKeysPending[nextKey]) {
|
|
143975
|
+
for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
|
|
143976
|
+
var pendingNextKey = nextKeysPending[nextKey][i2];
|
|
143977
|
+
childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
|
|
143978
|
+
}
|
|
143979
|
+
}
|
|
143980
|
+
childMapping[nextKey] = getValueForKey(nextKey);
|
|
143981
|
+
}
|
|
143982
|
+
for (i2 = 0; i2 < pendingKeys.length; i2++) {
|
|
143983
|
+
childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
|
|
143984
|
+
}
|
|
143985
|
+
return childMapping;
|
|
143986
|
+
}
|
|
143987
|
+
function getProp(child, prop, props) {
|
|
143988
|
+
return props[prop] != null ? props[prop] : child.props[prop];
|
|
143989
|
+
}
|
|
143990
|
+
function getInitialChildMapping(props, onExited) {
|
|
143991
|
+
return getChildMapping(props.children, function(child) {
|
|
143992
|
+
return cloneElement(child, {
|
|
143993
|
+
onExited: onExited.bind(null, child),
|
|
143994
|
+
in: true,
|
|
143995
|
+
appear: getProp(child, "appear", props),
|
|
143996
|
+
enter: getProp(child, "enter", props),
|
|
143997
|
+
exit: getProp(child, "exit", props)
|
|
143998
|
+
});
|
|
143999
|
+
});
|
|
144000
|
+
}
|
|
144001
|
+
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
|
|
144002
|
+
var nextChildMapping = getChildMapping(nextProps.children);
|
|
144003
|
+
var children2 = mergeChildMappings(prevChildMapping, nextChildMapping);
|
|
144004
|
+
Object.keys(children2).forEach(function(key) {
|
|
144005
|
+
var child = children2[key];
|
|
144006
|
+
if (!isValidElement(child)) return;
|
|
144007
|
+
var hasPrev = key in prevChildMapping;
|
|
144008
|
+
var hasNext = key in nextChildMapping;
|
|
144009
|
+
var prevChild = prevChildMapping[key];
|
|
144010
|
+
var isLeaving = isValidElement(prevChild) && !prevChild.props.in;
|
|
144011
|
+
if (hasNext && (!hasPrev || isLeaving)) {
|
|
144012
|
+
children2[key] = cloneElement(child, {
|
|
144013
|
+
onExited: onExited.bind(null, child),
|
|
144014
|
+
in: true,
|
|
144015
|
+
exit: getProp(child, "exit", nextProps),
|
|
144016
|
+
enter: getProp(child, "enter", nextProps)
|
|
144017
|
+
});
|
|
144018
|
+
} else if (!hasNext && hasPrev && !isLeaving) {
|
|
144019
|
+
children2[key] = cloneElement(child, {
|
|
144020
|
+
in: false
|
|
144021
|
+
});
|
|
144022
|
+
} else if (hasNext && hasPrev && isValidElement(prevChild)) {
|
|
144023
|
+
children2[key] = cloneElement(child, {
|
|
144024
|
+
onExited: onExited.bind(null, child),
|
|
144025
|
+
in: prevChild.props.in,
|
|
144026
|
+
exit: getProp(child, "exit", nextProps),
|
|
144027
|
+
enter: getProp(child, "enter", nextProps)
|
|
144028
|
+
});
|
|
144029
|
+
}
|
|
144030
|
+
});
|
|
144031
|
+
return children2;
|
|
144032
|
+
}
|
|
144033
|
+
var values = Object.values || function(obj) {
|
|
144034
|
+
return Object.keys(obj).map(function(k) {
|
|
144035
|
+
return obj[k];
|
|
144036
|
+
});
|
|
144037
|
+
};
|
|
144038
|
+
var defaultProps = {
|
|
144039
|
+
component: "div",
|
|
144040
|
+
childFactory: function childFactory(child) {
|
|
144041
|
+
return child;
|
|
144042
|
+
}
|
|
144043
|
+
};
|
|
144044
|
+
var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
|
|
144045
|
+
_inheritsLoose(TransitionGroup2, _React$Component);
|
|
144046
|
+
function TransitionGroup2(props, context) {
|
|
144047
|
+
var _this;
|
|
144048
|
+
_this = _React$Component.call(this, props, context) || this;
|
|
144049
|
+
var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
|
|
144050
|
+
_this.state = {
|
|
144051
|
+
contextValue: {
|
|
144052
|
+
isMounting: true
|
|
144053
|
+
},
|
|
144054
|
+
handleExited,
|
|
144055
|
+
firstRender: true
|
|
144056
|
+
};
|
|
144057
|
+
return _this;
|
|
144058
|
+
}
|
|
144059
|
+
var _proto = TransitionGroup2.prototype;
|
|
144060
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
144061
|
+
this.mounted = true;
|
|
144062
|
+
this.setState({
|
|
144063
|
+
contextValue: {
|
|
144064
|
+
isMounting: false
|
|
144065
|
+
}
|
|
144066
|
+
});
|
|
144067
|
+
};
|
|
144068
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
144069
|
+
this.mounted = false;
|
|
144070
|
+
};
|
|
144071
|
+
TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
|
|
144072
|
+
var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
|
|
144073
|
+
return {
|
|
144074
|
+
children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
|
|
144075
|
+
firstRender: false
|
|
144076
|
+
};
|
|
144077
|
+
};
|
|
144078
|
+
_proto.handleExited = function handleExited(child, node2) {
|
|
144079
|
+
var currentChildMapping = getChildMapping(this.props.children);
|
|
144080
|
+
if (child.key in currentChildMapping) return;
|
|
144081
|
+
if (child.props.onExited) {
|
|
144082
|
+
child.props.onExited(node2);
|
|
144083
|
+
}
|
|
144084
|
+
if (this.mounted) {
|
|
144085
|
+
this.setState(function(state) {
|
|
144086
|
+
var children2 = _extends$1({}, state.children);
|
|
144087
|
+
delete children2[child.key];
|
|
144088
|
+
return {
|
|
144089
|
+
children: children2
|
|
144090
|
+
};
|
|
144091
|
+
});
|
|
144092
|
+
}
|
|
144093
|
+
};
|
|
144094
|
+
_proto.render = function render() {
|
|
144095
|
+
var _this$props = this.props, Component2 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
|
|
144096
|
+
var contextValue = this.state.contextValue;
|
|
144097
|
+
var children2 = values(this.state.children).map(childFactory2);
|
|
144098
|
+
delete props.appear;
|
|
144099
|
+
delete props.enter;
|
|
144100
|
+
delete props.exit;
|
|
144101
|
+
if (Component2 === null) {
|
|
144102
|
+
return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
|
|
144103
|
+
value: contextValue
|
|
144104
|
+
}, children2);
|
|
144105
|
+
}
|
|
144106
|
+
return /* @__PURE__ */ React__default.createElement(TransitionGroupContext.Provider, {
|
|
144107
|
+
value: contextValue
|
|
144108
|
+
}, /* @__PURE__ */ React__default.createElement(Component2, props, children2));
|
|
144109
|
+
};
|
|
144110
|
+
return TransitionGroup2;
|
|
144111
|
+
}(React__default.Component);
|
|
144112
|
+
TransitionGroup.propTypes = {
|
|
144113
|
+
/**
|
|
144114
|
+
* `<TransitionGroup>` renders a `<div>` by default. You can change this
|
|
144115
|
+
* behavior by providing a `component` prop.
|
|
144116
|
+
* If you use React v16+ and would like to avoid a wrapping `<div>` element
|
|
144117
|
+
* you can pass in `component={null}`. This is useful if the wrapping div
|
|
144118
|
+
* borks your css styles.
|
|
144119
|
+
*/
|
|
144120
|
+
component: PropTypes.any,
|
|
144121
|
+
/**
|
|
144122
|
+
* A set of `<Transition>` components, that are toggled `in` and out as they
|
|
144123
|
+
* leave. the `<TransitionGroup>` will inject specific transition props, so
|
|
144124
|
+
* remember to spread them through if you are wrapping the `<Transition>` as
|
|
144125
|
+
* with our `<Fade>` example.
|
|
144126
|
+
*
|
|
144127
|
+
* While this component is meant for multiple `Transition` or `CSSTransition`
|
|
144128
|
+
* children, sometimes you may want to have a single transition child with
|
|
144129
|
+
* content that you want to be transitioned out and in when you change it
|
|
144130
|
+
* (e.g. routes, images etc.) In that case you can change the `key` prop of
|
|
144131
|
+
* the transition child as you change its content, this will cause
|
|
144132
|
+
* `TransitionGroup` to transition the child out and back in.
|
|
144133
|
+
*/
|
|
144134
|
+
children: PropTypes.node,
|
|
144135
|
+
/**
|
|
144136
|
+
* A convenience prop that enables or disables appear animations
|
|
144137
|
+
* for all children. Note that specifying this will override any defaults set
|
|
144138
|
+
* on individual children Transitions.
|
|
144139
|
+
*/
|
|
144140
|
+
appear: PropTypes.bool,
|
|
144141
|
+
/**
|
|
144142
|
+
* A convenience prop that enables or disables enter animations
|
|
144143
|
+
* for all children. Note that specifying this will override any defaults set
|
|
144144
|
+
* on individual children Transitions.
|
|
144145
|
+
*/
|
|
144146
|
+
enter: PropTypes.bool,
|
|
144147
|
+
/**
|
|
144148
|
+
* A convenience prop that enables or disables exit animations
|
|
144149
|
+
* for all children. Note that specifying this will override any defaults set
|
|
144150
|
+
* on individual children Transitions.
|
|
144151
|
+
*/
|
|
144152
|
+
exit: PropTypes.bool,
|
|
144153
|
+
/**
|
|
144154
|
+
* You may need to apply reactive updates to a child as it is exiting.
|
|
144155
|
+
* This is generally done by using `cloneElement` however in the case of an exiting
|
|
144156
|
+
* child the element has already been removed and not accessible to the consumer.
|
|
144157
|
+
*
|
|
144158
|
+
* If you do need to update a child as it leaves you can provide a `childFactory`
|
|
144159
|
+
* to wrap every child, even the ones that are leaving.
|
|
144160
|
+
*
|
|
144161
|
+
* @type Function(child: ReactElement) -> ReactElement
|
|
144162
|
+
*/
|
|
144163
|
+
childFactory: PropTypes.func
|
|
144164
|
+
};
|
|
144165
|
+
TransitionGroup.defaultProps = defaultProps;
|
|
144166
|
+
const UNINITIALIZED = {};
|
|
144167
|
+
function useLazyRef(init, initArg) {
|
|
144168
|
+
const ref = React.useRef(UNINITIALIZED);
|
|
144169
|
+
if (ref.current === UNINITIALIZED) {
|
|
144170
|
+
ref.current = init(initArg);
|
|
144171
|
+
}
|
|
144172
|
+
return ref;
|
|
144173
|
+
}
|
|
144174
|
+
const EMPTY = [];
|
|
144175
|
+
function useOnMount(fn) {
|
|
144176
|
+
React.useEffect(fn, EMPTY);
|
|
144177
|
+
}
|
|
144178
|
+
class Timeout {
|
|
144179
|
+
constructor() {
|
|
144180
|
+
__publicField(this, "currentId", null);
|
|
144181
|
+
__publicField(this, "clear", () => {
|
|
144182
|
+
if (this.currentId !== null) {
|
|
144183
|
+
clearTimeout(this.currentId);
|
|
144184
|
+
this.currentId = null;
|
|
144185
|
+
}
|
|
144186
|
+
});
|
|
144187
|
+
__publicField(this, "disposeEffect", () => {
|
|
144188
|
+
return this.clear;
|
|
144189
|
+
});
|
|
144190
|
+
}
|
|
144191
|
+
static create() {
|
|
144192
|
+
return new Timeout();
|
|
144193
|
+
}
|
|
144194
|
+
/**
|
|
144195
|
+
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
144196
|
+
*/
|
|
144197
|
+
start(delay, fn) {
|
|
144198
|
+
this.clear();
|
|
144199
|
+
this.currentId = setTimeout(() => {
|
|
144200
|
+
this.currentId = null;
|
|
144201
|
+
fn();
|
|
144202
|
+
}, delay);
|
|
144203
|
+
}
|
|
144204
|
+
}
|
|
144205
|
+
function useTimeout() {
|
|
144206
|
+
const timeout2 = useLazyRef(Timeout.create).current;
|
|
144207
|
+
useOnMount(timeout2.disposeEffect);
|
|
144208
|
+
return timeout2;
|
|
144209
|
+
}
|
|
144210
|
+
function isClassComponent(elementType) {
|
|
144211
|
+
const {
|
|
144212
|
+
prototype = {}
|
|
144213
|
+
} = elementType;
|
|
144214
|
+
return Boolean(prototype.isReactComponent);
|
|
144215
|
+
}
|
|
144216
|
+
function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
|
|
144217
|
+
const propValue = props[propName];
|
|
144218
|
+
const safePropName = propFullName || propName;
|
|
144219
|
+
if (propValue == null || // When server-side rendering React doesn't warn either.
|
|
144220
|
+
// This is not an accurate check for SSR.
|
|
144221
|
+
// This is only in place for emotion compat.
|
|
144222
|
+
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
|
|
144223
|
+
typeof window === "undefined") {
|
|
144224
|
+
return null;
|
|
144225
|
+
}
|
|
144226
|
+
let warningHint;
|
|
144227
|
+
if (typeof propValue === "function" && !isClassComponent(propValue)) {
|
|
144228
|
+
warningHint = "Did you accidentally provide a plain function component instead?";
|
|
144229
|
+
}
|
|
144230
|
+
if (warningHint !== void 0) {
|
|
144231
|
+
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`);
|
|
144232
|
+
}
|
|
144233
|
+
return null;
|
|
144234
|
+
}
|
|
144235
|
+
const elementTypeAcceptingRef$1 = chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef);
|
|
144234
144236
|
function getTypeByValue(value) {
|
|
144235
144237
|
const valueType = typeof value;
|
|
144236
144238
|
switch (valueType) {
|
|
@@ -150493,8 +150495,14 @@ function forceCollideRects() {
|
|
|
150493
150495
|
};
|
|
150494
150496
|
return force;
|
|
150495
150497
|
}
|
|
150496
|
-
|
|
150497
|
-
|
|
150498
|
+
const BASE_POINT_SIZE = 5;
|
|
150499
|
+
const LARGE_DATASET_CELL_COUNT = 1e4;
|
|
150500
|
+
const SMALL_DATASET_CELL_COUNT = 100;
|
|
150501
|
+
function getInitialPointSize(numCells = LARGE_DATASET_CELL_COUNT) {
|
|
150502
|
+
return BASE_POINT_SIZE / clamp$4(numCells, SMALL_DATASET_CELL_COUNT, LARGE_DATASET_CELL_COUNT);
|
|
150503
|
+
}
|
|
150504
|
+
function getPointSizeDevicePixels(devicePixelRatio, zoom, xRange, yRange, width2, height2, numCells) {
|
|
150505
|
+
const pointSize = getInitialPointSize(numCells);
|
|
150498
150506
|
const pointScreenSizeMax = 10;
|
|
150499
150507
|
const pointScreenSizeMin = 1 / devicePixelRatio;
|
|
150500
150508
|
const scaleFactor = 2 ** zoom;
|
|
@@ -152052,40 +152060,51 @@ function number$2(x) {
|
|
|
152052
152060
|
const ascendingBisect = bisector(ascending);
|
|
152053
152061
|
const bisectRight = ascendingBisect.right;
|
|
152054
152062
|
bisector(number$2).center;
|
|
152055
|
-
|
|
152063
|
+
const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
|
|
152064
|
+
function tickSpec(start, stop, count2) {
|
|
152065
|
+
const step = (stop - start) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error2 = step / Math.pow(10, power), factor = error2 >= e10 ? 10 : error2 >= e5 ? 5 : error2 >= e2 ? 2 : 1;
|
|
152066
|
+
let i1, i2, inc;
|
|
152067
|
+
if (power < 0) {
|
|
152068
|
+
inc = Math.pow(10, -power) / factor;
|
|
152069
|
+
i1 = Math.round(start * inc);
|
|
152070
|
+
i2 = Math.round(stop * inc);
|
|
152071
|
+
if (i1 / inc < start) ++i1;
|
|
152072
|
+
if (i2 / inc > stop) --i2;
|
|
152073
|
+
inc = -inc;
|
|
152074
|
+
} else {
|
|
152075
|
+
inc = Math.pow(10, power) * factor;
|
|
152076
|
+
i1 = Math.round(start / inc);
|
|
152077
|
+
i2 = Math.round(stop / inc);
|
|
152078
|
+
if (i1 * inc < start) ++i1;
|
|
152079
|
+
if (i2 * inc > stop) --i2;
|
|
152080
|
+
}
|
|
152081
|
+
if (i2 < i1 && 0.5 <= count2 && count2 < 2) return tickSpec(start, stop, count2 * 2);
|
|
152082
|
+
return [i1, i2, inc];
|
|
152083
|
+
}
|
|
152056
152084
|
function ticks(start, stop, count2) {
|
|
152057
|
-
var reverse, i2 = -1, n2, ticks2, step;
|
|
152058
152085
|
stop = +stop, start = +start, count2 = +count2;
|
|
152059
|
-
if (
|
|
152060
|
-
if (
|
|
152061
|
-
|
|
152062
|
-
if (
|
|
152063
|
-
|
|
152064
|
-
|
|
152065
|
-
if (
|
|
152066
|
-
|
|
152067
|
-
while (++i2 < n2) ticks2[i2] = (r0 + i2) * step;
|
|
152086
|
+
if (!(count2 > 0)) return [];
|
|
152087
|
+
if (start === stop) return [start];
|
|
152088
|
+
const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count2) : tickSpec(start, stop, count2);
|
|
152089
|
+
if (!(i2 >= i1)) return [];
|
|
152090
|
+
const n2 = i2 - i1 + 1, ticks2 = new Array(n2);
|
|
152091
|
+
if (reverse) {
|
|
152092
|
+
if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) / -inc;
|
|
152093
|
+
else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) * inc;
|
|
152068
152094
|
} else {
|
|
152069
|
-
|
|
152070
|
-
let
|
|
152071
|
-
|
|
152072
|
-
if (r1 / step > stop) --r1;
|
|
152073
|
-
ticks2 = new Array(n2 = r1 - r0 + 1);
|
|
152074
|
-
while (++i2 < n2) ticks2[i2] = (r0 + i2) / step;
|
|
152075
|
-
}
|
|
152076
|
-
if (reverse) ticks2.reverse();
|
|
152095
|
+
if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) / -inc;
|
|
152096
|
+
else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) * inc;
|
|
152097
|
+
}
|
|
152077
152098
|
return ticks2;
|
|
152078
152099
|
}
|
|
152079
152100
|
function tickIncrement(start, stop, count2) {
|
|
152080
|
-
|
|
152081
|
-
return
|
|
152101
|
+
stop = +stop, start = +start, count2 = +count2;
|
|
152102
|
+
return tickSpec(start, stop, count2)[2];
|
|
152082
152103
|
}
|
|
152083
152104
|
function tickStep(start, stop, count2) {
|
|
152084
|
-
|
|
152085
|
-
|
|
152086
|
-
|
|
152087
|
-
else if (error2 >= e2) step1 *= 2;
|
|
152088
|
-
return stop < start ? -step1 : step1;
|
|
152105
|
+
stop = +stop, start = +start, count2 = +count2;
|
|
152106
|
+
const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count2) : tickIncrement(start, stop, count2);
|
|
152107
|
+
return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
|
|
152089
152108
|
}
|
|
152090
152109
|
function initRange(domain, range2) {
|
|
152091
152110
|
switch (arguments.length) {
|
|
@@ -153167,6 +153186,9 @@ function ramp(color2, n2 = 256) {
|
|
|
153167
153186
|
canvas.width = n2;
|
|
153168
153187
|
canvas.height = 1;
|
|
153169
153188
|
const context = canvas.getContext("2d");
|
|
153189
|
+
if (!context) {
|
|
153190
|
+
throw new Error("Could not get 2d context from canvas");
|
|
153191
|
+
}
|
|
153170
153192
|
for (let i2 = 0; i2 < n2; ++i2) {
|
|
153171
153193
|
context.fillStyle = color2(i2 / (n2 - 1));
|
|
153172
153194
|
context.fillRect(i2, 0, 1, 1);
|
|
@@ -153185,6 +153207,8 @@ function getXlinkHref(cmap) {
|
|
|
153185
153207
|
}
|
|
153186
153208
|
const useStyles = makeStyles()(() => ({
|
|
153187
153209
|
legend: {
|
|
153210
|
+
position: "relative",
|
|
153211
|
+
// Needed for absolute positioning of slider overlay
|
|
153188
153212
|
top: "2px",
|
|
153189
153213
|
right: "2px",
|
|
153190
153214
|
fontSize: "10px !important",
|
|
@@ -153216,6 +153240,74 @@ const useStyles = makeStyles()(() => ({
|
|
|
153216
153240
|
},
|
|
153217
153241
|
legendInvisible: {
|
|
153218
153242
|
display: "none"
|
|
153243
|
+
},
|
|
153244
|
+
sliderContainer: {
|
|
153245
|
+
position: "absolute",
|
|
153246
|
+
// Position at the colormap location: top offset = titleHeight
|
|
153247
|
+
top: "10px",
|
|
153248
|
+
// titleHeight
|
|
153249
|
+
left: "2px",
|
|
153250
|
+
// Account for parent padding
|
|
153251
|
+
width: "calc(100% - 4px)",
|
|
153252
|
+
// Account for left and right padding
|
|
153253
|
+
height: "8px",
|
|
153254
|
+
// rectHeight
|
|
153255
|
+
"&:hover $sliderThumb": {
|
|
153256
|
+
opacity: 1
|
|
153257
|
+
}
|
|
153258
|
+
},
|
|
153259
|
+
sliderRoot: {
|
|
153260
|
+
position: "absolute",
|
|
153261
|
+
top: 0,
|
|
153262
|
+
left: 0,
|
|
153263
|
+
width: "100%",
|
|
153264
|
+
height: "8px",
|
|
153265
|
+
// rectHeight
|
|
153266
|
+
padding: 0,
|
|
153267
|
+
"& .MuiSlider-rail": {
|
|
153268
|
+
display: "none"
|
|
153269
|
+
},
|
|
153270
|
+
"& .MuiSlider-track": {
|
|
153271
|
+
display: "none"
|
|
153272
|
+
},
|
|
153273
|
+
"& .MuiSlider-valueLabel": {
|
|
153274
|
+
fontSize: "9px",
|
|
153275
|
+
padding: "2px 4px",
|
|
153276
|
+
backgroundColor: "rgb(0, 0, 0)",
|
|
153277
|
+
borderRadius: "2px"
|
|
153278
|
+
}
|
|
153279
|
+
},
|
|
153280
|
+
sliderThumb: {
|
|
153281
|
+
width: "4px",
|
|
153282
|
+
height: "12px",
|
|
153283
|
+
borderRadius: "2px",
|
|
153284
|
+
backgroundColor: "white",
|
|
153285
|
+
border: "1px solid black",
|
|
153286
|
+
opacity: 0,
|
|
153287
|
+
transition: "opacity 0.15s ease-in-out",
|
|
153288
|
+
"&:hover, &.Mui-focusVisible": {
|
|
153289
|
+
boxShadow: "0 0 0 4px rgba(0, 0, 0, 0.16)",
|
|
153290
|
+
opacity: 1
|
|
153291
|
+
},
|
|
153292
|
+
"&.Mui-active": {
|
|
153293
|
+
boxShadow: "0 0 0 6px rgba(0, 0, 0, 0.16)",
|
|
153294
|
+
opacity: 1
|
|
153295
|
+
}
|
|
153296
|
+
},
|
|
153297
|
+
colormapImage: {
|
|
153298
|
+
position: "absolute",
|
|
153299
|
+
top: "2px",
|
|
153300
|
+
height: "6px",
|
|
153301
|
+
// rectHeight
|
|
153302
|
+
pointerEvents: "none"
|
|
153303
|
+
},
|
|
153304
|
+
grayTrack: {
|
|
153305
|
+
position: "absolute",
|
|
153306
|
+
top: "2px",
|
|
153307
|
+
height: "6px",
|
|
153308
|
+
// rectHeight
|
|
153309
|
+
backgroundColor: "rgba(128, 128, 128, 0.5)",
|
|
153310
|
+
pointerEvents: "none"
|
|
153219
153311
|
}
|
|
153220
153312
|
}));
|
|
153221
153313
|
const titleHeight = 10;
|
|
@@ -153225,21 +153317,23 @@ const rectMarginX = 2;
|
|
|
153225
153317
|
function combineExtents(extents, featureAggregationStrategy) {
|
|
153226
153318
|
if (Array.isArray(extents)) {
|
|
153227
153319
|
if (Array.isArray(extents == null ? void 0 : extents[0])) {
|
|
153320
|
+
const extentsArray = extents;
|
|
153228
153321
|
if (featureAggregationStrategy === "first") {
|
|
153229
|
-
return
|
|
153322
|
+
return extentsArray[0];
|
|
153230
153323
|
}
|
|
153231
153324
|
if (featureAggregationStrategy === "last") {
|
|
153232
|
-
return
|
|
153325
|
+
return extentsArray.at(-1) || null;
|
|
153233
153326
|
}
|
|
153234
153327
|
if (typeof featureAggregationStrategy === "number") {
|
|
153235
153328
|
const i2 = featureAggregationStrategy;
|
|
153236
|
-
return
|
|
153329
|
+
return extentsArray[i2];
|
|
153237
153330
|
}
|
|
153238
153331
|
if (featureAggregationStrategy === "sum") {
|
|
153239
|
-
return
|
|
153332
|
+
return extentsArray.reduce((a2, h) => [a2[0] + h[0], a2[1] + h[1]]);
|
|
153240
153333
|
}
|
|
153241
153334
|
if (featureAggregationStrategy === "mean") {
|
|
153242
|
-
|
|
153335
|
+
const sum2 = extentsArray.reduce((a2, h) => [a2[0] + h[0], a2[1] + h[1]]);
|
|
153336
|
+
return [sum2[0] / extentsArray.length, sum2[1] / extentsArray.length];
|
|
153243
153337
|
}
|
|
153244
153338
|
} else {
|
|
153245
153339
|
return extents;
|
|
@@ -153253,7 +153347,7 @@ function combineMissings(missings, featureAggregationStrategy) {
|
|
|
153253
153347
|
return missings[0];
|
|
153254
153348
|
}
|
|
153255
153349
|
if (featureAggregationStrategy === "last") {
|
|
153256
|
-
return missings.at(-1);
|
|
153350
|
+
return missings.at(-1) || null;
|
|
153257
153351
|
}
|
|
153258
153352
|
if (typeof featureAggregationStrategy === "number") {
|
|
153259
153353
|
const i2 = featureAggregationStrategy;
|
|
@@ -153269,52 +153363,127 @@ function combineMissings(missings, featureAggregationStrategy) {
|
|
|
153269
153363
|
return null;
|
|
153270
153364
|
}
|
|
153271
153365
|
function Legend(props) {
|
|
153272
|
-
const {
|
|
153273
|
-
|
|
153366
|
+
const {
|
|
153367
|
+
visible: visibleProp,
|
|
153368
|
+
positionRelative = false,
|
|
153369
|
+
highContrast = false,
|
|
153370
|
+
obsType,
|
|
153371
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
153372
|
+
featureType: _featureType = void 0,
|
|
153373
|
+
// Unused but accepted for API compatibility
|
|
153374
|
+
featureValueType,
|
|
153375
|
+
considerSelections = true,
|
|
153376
|
+
obsColorEncoding,
|
|
153377
|
+
featureSelection,
|
|
153378
|
+
featureLabelsMap,
|
|
153379
|
+
featureValueColormap,
|
|
153380
|
+
featureValueColormapRange,
|
|
153381
|
+
setFeatureValueColormapRange,
|
|
153382
|
+
spatialChannelColor,
|
|
153383
|
+
spatialLayerColor,
|
|
153384
|
+
obsSetSelection,
|
|
153385
|
+
obsSetColor,
|
|
153386
|
+
featureAggregationStrategy,
|
|
153387
|
+
extent: extent2,
|
|
153388
|
+
missing,
|
|
153389
|
+
width: width2 = 100,
|
|
153390
|
+
height: height2 = 36,
|
|
153391
|
+
maxHeight: maxHeight2 = null,
|
|
153392
|
+
theme,
|
|
153393
|
+
showObsLabel = false,
|
|
153394
|
+
pointsVisible = true,
|
|
153395
|
+
contoursVisible = false,
|
|
153396
|
+
contoursFilled,
|
|
153397
|
+
contourPercentiles,
|
|
153398
|
+
contourThresholds
|
|
153399
|
+
} = props;
|
|
153400
|
+
const svgRef = useRef(null);
|
|
153274
153401
|
const { classes } = useStyles();
|
|
153402
|
+
const [localRange, setLocalRange] = useState(featureValueColormapRange);
|
|
153403
|
+
useEffect(() => {
|
|
153404
|
+
setLocalRange(featureValueColormapRange);
|
|
153405
|
+
}, [featureValueColormapRange]);
|
|
153406
|
+
const debouncedSetRange = useMemo(() => setFeatureValueColormapRange ? debounce$1((value) => {
|
|
153407
|
+
setFeatureValueColormapRange(value);
|
|
153408
|
+
}, 5, { leading: false, trailing: true }) : null, [setFeatureValueColormapRange]);
|
|
153409
|
+
useEffect(() => () => {
|
|
153410
|
+
if (debouncedSetRange) {
|
|
153411
|
+
debouncedSetRange.cancel();
|
|
153412
|
+
}
|
|
153413
|
+
}, [debouncedSetRange]);
|
|
153414
|
+
const handleSliderChange = useCallback((_event, newValue) => {
|
|
153415
|
+
const rangeValue = newValue;
|
|
153416
|
+
setLocalRange(rangeValue);
|
|
153417
|
+
if (debouncedSetRange) {
|
|
153418
|
+
debouncedSetRange(rangeValue);
|
|
153419
|
+
}
|
|
153420
|
+
}, [debouncedSetRange]);
|
|
153275
153421
|
const isDarkTheme = theme === "dark";
|
|
153276
153422
|
const isStaticColor = obsColorEncoding === "spatialChannelColor" || obsColorEncoding === "spatialLayerColor";
|
|
153277
153423
|
const isSetColor = obsColorEncoding === "cellSetSelection";
|
|
153278
|
-
const layerColor = Array.isArray(spatialLayerColor) && spatialLayerColor.length === 3 ? spatialLayerColor : getDefaultColor(theme);
|
|
153279
|
-
const channelColor = Array.isArray(spatialChannelColor) && spatialChannelColor.length === 3 ? spatialChannelColor : getDefaultColor(theme);
|
|
153424
|
+
const layerColor = Array.isArray(spatialLayerColor) && spatialLayerColor.length === 3 ? spatialLayerColor : getDefaultColor(theme ?? "light");
|
|
153425
|
+
const channelColor = Array.isArray(spatialChannelColor) && spatialChannelColor.length === 3 ? spatialChannelColor : getDefaultColor(theme ?? "light");
|
|
153280
153426
|
const staticColor = obsColorEncoding === "spatialChannelColor" ? channelColor : layerColor;
|
|
153281
|
-
const visible = visibleProp && (!considerSelections || obsColorEncoding
|
|
153427
|
+
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);
|
|
153282
153428
|
const levelZeroNames = useMemo(() => Array.from(new Set((obsSetSelection == null ? void 0 : obsSetSelection.map((setPath) => setPath[0])) || [])), [obsSetSelection]);
|
|
153283
|
-
const dynamicHeight = isSetColor && obsSetSelection ? levelZeroNames.length * titleHeight + (obsSetSelection == null ? void 0 : obsSetSelection.length) * (rectHeight + rectMarginY) : height2 + (!pointsVisible && contoursVisible ? 25 : 0);
|
|
153429
|
+
const dynamicHeight = isSetColor && obsSetSelection ? levelZeroNames.length * titleHeight + ((obsSetSelection == null ? void 0 : obsSetSelection.length) ?? 0) * (rectHeight + rectMarginY) : height2 + (!pointsVisible && contoursVisible ? 25 : 0);
|
|
153284
153430
|
const availHeight = maxHeight2 !== null ? Math.max(0, maxHeight2 - 4) : Infinity;
|
|
153285
153431
|
const needsScroll = Number.isFinite(availHeight) && dynamicHeight > availHeight + 1;
|
|
153286
153432
|
useEffect(() => {
|
|
153287
153433
|
const domElement = svgRef.current;
|
|
153434
|
+
if (!domElement)
|
|
153435
|
+
return;
|
|
153288
153436
|
const foregroundColor = highContrast ? "black" : isDarkTheme ? "white" : "black";
|
|
153289
153437
|
const svg = select(domElement);
|
|
153290
153438
|
svg.selectAll("g").remove();
|
|
153291
153439
|
svg.attr("width", width2).attr("height", dynamicHeight);
|
|
153292
153440
|
const g2 = svg.append("g").attr("width", width2).attr("height", dynamicHeight);
|
|
153293
|
-
|
|
153294
|
-
|
|
153441
|
+
const showInteractiveSlider2 = setFeatureValueColormapRange && ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && pointsVisible && featureValueColormap;
|
|
153442
|
+
if (!considerSelections || ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "")) {
|
|
153443
|
+
const combinedExtent = combineExtents(extent2 ?? null, featureAggregationStrategy ?? null) || [0, 1];
|
|
153444
|
+
const [xMin, xMax] = combinedExtent;
|
|
153295
153445
|
if (featureValueColormap && pointsVisible) {
|
|
153296
|
-
const
|
|
153297
|
-
|
|
153298
|
-
const [rMin, rMax] =
|
|
153446
|
+
const xlinkHref2 = getXlinkHref(featureValueColormap);
|
|
153447
|
+
const currentRange = showInteractiveSlider2 ? localRange : featureValueColormapRange;
|
|
153448
|
+
const [rMin, rMax] = currentRange || [0, 1];
|
|
153449
|
+
if (showInteractiveSlider2) ;
|
|
153450
|
+
else if (setFeatureValueColormapRange) {
|
|
153451
|
+
g2.append("image").attr("x", rMin * width2).attr("y", titleHeight).attr("width", (rMax - rMin) * width2).attr("height", rectHeight).attr("preserveAspectRatio", "none").attr("href", xlinkHref2);
|
|
153452
|
+
} else {
|
|
153453
|
+
g2.append("image").attr("x", 0).attr("y", titleHeight).attr("width", width2).attr("height", rectHeight).attr("preserveAspectRatio", "none").attr("href", xlinkHref2);
|
|
153454
|
+
}
|
|
153299
153455
|
const scaledDataExtent = [
|
|
153300
153456
|
xMin + (xMax - xMin) * rMin,
|
|
153301
153457
|
xMax - (xMax - xMin) * (1 - rMax)
|
|
153302
153458
|
];
|
|
153303
|
-
|
|
153304
|
-
|
|
153305
|
-
|
|
153306
|
-
|
|
153307
|
-
|
|
153308
|
-
|
|
153459
|
+
let x;
|
|
153460
|
+
if (setFeatureValueColormapRange || showInteractiveSlider2) {
|
|
153461
|
+
x = linear().domain(scaledDataExtent).range([rMin * width2, rMax * width2]);
|
|
153462
|
+
} else {
|
|
153463
|
+
x = linear().domain(scaledDataExtent).range([0, width2]);
|
|
153464
|
+
}
|
|
153465
|
+
if (showInteractiveSlider2) {
|
|
153466
|
+
const xGlobal = linear().domain([xMin, xMax]).range([0, width2 - 4]);
|
|
153467
|
+
const axisTicks = g2.append("g").attr("transform", `translate(0,${titleHeight + rectHeight})`).style("font-size", "10px").call(axisBottom(xGlobal).tickValues([xMin, xMax]));
|
|
153468
|
+
axisTicks.selectAll("line,path").style("stroke", foregroundColor);
|
|
153469
|
+
axisTicks.selectAll("text").style("fill", foregroundColor);
|
|
153470
|
+
axisTicks.selectAll("text").attr("text-anchor", (_d, i2) => i2 === 0 ? "start" : "end");
|
|
153471
|
+
} else {
|
|
153472
|
+
const axisTicks = g2.append("g").attr("transform", `translate(0,${titleHeight + rectHeight})`).style("font-size", "10px").call(axisBottom(x).tickValues(scaledDataExtent));
|
|
153473
|
+
axisTicks.selectAll("line,path").style("stroke", foregroundColor);
|
|
153474
|
+
axisTicks.selectAll("text").style("fill", foregroundColor);
|
|
153475
|
+
axisTicks.selectAll("text").attr("text-anchor", (_d, i2) => i2 === 0 ? "start" : "end");
|
|
153476
|
+
}
|
|
153477
|
+
} else if (contoursVisible && contourPercentiles) {
|
|
153309
153478
|
const tSize = 12;
|
|
153310
153479
|
const xPercentile = linear().domain([0, 1]).range([tSize / 2, width2 - tSize / 2 - 2]);
|
|
153311
|
-
const axisTicks = g2.append("g").attr("transform", `translate(0,${titleHeight + rectHeight + 15})`).style("font-size", "9px").call(axisBottom(xPercentile).tickValues(contourPercentiles).tickFormat(format(".0%")).tickSizeOuter(0));
|
|
153480
|
+
const axisTicks = g2.append("g").attr("transform", `translate(0,${titleHeight + rectHeight + 15})`).style("font-size", "9px").call(axisBottom(xPercentile).tickValues(contourPercentiles).tickFormat((d) => format(".0%")(d)).tickSizeOuter(0));
|
|
153312
153481
|
axisTicks.selectAll("line,path").style("stroke", foregroundColor);
|
|
153313
153482
|
axisTicks.selectAll("text").style("fill", foregroundColor);
|
|
153314
153483
|
const NEIGHBOR_THRESHOLD = 18;
|
|
153315
|
-
const contourPercentages = contourPercentiles.map((
|
|
153484
|
+
const contourPercentages = contourPercentiles.map((p) => p * 100);
|
|
153316
153485
|
if ((contourPercentages == null ? void 0 : contourPercentages[1]) - (contourPercentages == null ? void 0 : contourPercentages[0]) <= NEIGHBOR_THRESHOLD || (contourPercentages == null ? void 0 : contourPercentages[2]) - (contourPercentages == null ? void 0 : contourPercentages[1]) <= NEIGHBOR_THRESHOLD) {
|
|
153317
|
-
axisTicks.selectAll("text").attr("transform", (
|
|
153486
|
+
axisTicks.selectAll("text").attr("transform", (_d, i2) => `translate(0,${i2 === 0 || i2 === contourPercentiles.length - 1 ? 0 : 10})`);
|
|
153318
153487
|
}
|
|
153319
153488
|
const triangleGroupG = g2.append("g").attr("transform", `translate(0,${titleHeight + rectHeight + 4})`);
|
|
153320
153489
|
contourPercentiles.forEach((p, i2) => {
|
|
@@ -153324,14 +153493,14 @@ function Legend(props) {
|
|
|
153324
153493
|
const thresholdGroupG = g2.append("g").attr("transform", `translate(0,${titleHeight + rectHeight})`);
|
|
153325
153494
|
const thresholdFormatter = format(".0f");
|
|
153326
153495
|
contourPercentiles.forEach((p, i2) => {
|
|
153327
|
-
const contourThreshold = xMin + (xMax - xMin) * ((contourThresholds == null ? void 0 : contourThresholds[i2]) / 255);
|
|
153496
|
+
const contourThreshold = xMin + (xMax - xMin) * (((contourThresholds == null ? void 0 : contourThresholds[i2]) ?? 0) / 255);
|
|
153328
153497
|
const thresholdG = thresholdGroupG.append("g").attr("transform", `translate(${xPercentile(p)},0)`).style("font-size", "7px");
|
|
153329
153498
|
thresholdG.append("text").text(thresholdFormatter(contourThreshold)).style("fill", foregroundColor).attr("text-anchor", "middle");
|
|
153330
153499
|
});
|
|
153331
153500
|
}
|
|
153332
153501
|
}
|
|
153333
153502
|
if (isStaticColor) {
|
|
153334
|
-
g2.append("rect").attr("x", 0).attr("y", titleHeight).attr("width", width2).attr("height", rectHeight).attr("fill", `rgb(${staticColor[0]},${staticColor[1]},${staticColor[2]})`);
|
|
153503
|
+
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]})`);
|
|
153335
153504
|
}
|
|
153336
153505
|
if (isSetColor && obsSetSelection && obsSetColor) {
|
|
153337
153506
|
const obsSetSelectionByLevelZero = {};
|
|
@@ -153348,9 +153517,9 @@ function Legend(props) {
|
|
|
153348
153517
|
y += titleHeight;
|
|
153349
153518
|
setPaths.forEach((setPath) => {
|
|
153350
153519
|
var _a3;
|
|
153351
|
-
const setColor2 = ((_a3 = obsSetColor == null ? void 0 : obsSetColor.find((d) => isEqual$1(d.path, setPath))) == null ? void 0 : _a3.color) || getDefaultColor(theme);
|
|
153520
|
+
const setColor2 = ((_a3 = obsSetColor == null ? void 0 : obsSetColor.find((d) => isEqual$1(d.path, setPath))) == null ? void 0 : _a3.color) || getDefaultColor(theme ?? "light");
|
|
153352
153521
|
g2.append("rect").attr("x", 0).attr("y", y).attr("width", rectHeight).attr("height", rectHeight).attr("fill", `rgb(${setColor2[0]},${setColor2[1]},${setColor2[2]})`);
|
|
153353
|
-
g2.append("text").attr("text-anchor", "start").attr("dominant-baseline", "hanging").attr("x", rectHeight + rectMarginX).attr("y", y).text(setPath.at(-1)).style("font-size", "9px").style("fill", foregroundColor);
|
|
153522
|
+
g2.append("text").attr("text-anchor", "start").attr("dominant-baseline", "hanging").attr("x", rectHeight + rectMarginX).attr("y", y).text(setPath.at(-1) ?? "").style("font-size", "9px").style("fill", foregroundColor);
|
|
153354
153523
|
y += rectHeight + rectMarginY;
|
|
153355
153524
|
});
|
|
153356
153525
|
});
|
|
@@ -153365,23 +153534,31 @@ function Legend(props) {
|
|
|
153365
153534
|
const i2 = featureAggregationStrategy;
|
|
153366
153535
|
featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[i2];
|
|
153367
153536
|
} else if (featureAggregationStrategy === "sum") {
|
|
153368
|
-
|
|
153537
|
+
if (Array.isArray(featureSelection) && featureSelection.length === 1) {
|
|
153538
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
|
|
153539
|
+
} else {
|
|
153540
|
+
featureSelectionLabelRawStr = "Sum of features";
|
|
153541
|
+
}
|
|
153369
153542
|
} else if (featureAggregationStrategy === "mean") {
|
|
153370
|
-
|
|
153543
|
+
if (Array.isArray(featureSelection) && featureSelection.length === 1) {
|
|
153544
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
|
|
153545
|
+
} else {
|
|
153546
|
+
featureSelectionLabelRawStr = "Mean of features";
|
|
153547
|
+
}
|
|
153371
153548
|
} else {
|
|
153372
153549
|
featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
|
|
153373
153550
|
}
|
|
153374
|
-
const combinedMissing = combineMissings(missing, featureAggregationStrategy);
|
|
153551
|
+
const combinedMissing = combineMissings(missing ?? null, featureAggregationStrategy ?? null);
|
|
153375
153552
|
const featureSelectionLabel = combinedMissing ? `${featureSelectionLabelRawStr} (${Math.round(combinedMissing * 100)}% NaN)` : featureSelectionLabelRawStr;
|
|
153376
|
-
const obsLabel = capitalize$2(obsType);
|
|
153377
|
-
const featureLabel = considerSelections ? featureSelectionLabel || capitalize$2(featureValueType) : capitalize$2(featureValueType);
|
|
153553
|
+
const obsLabel = capitalize$2(obsType ?? null);
|
|
153554
|
+
const featureLabel = considerSelections ? featureSelectionLabel || capitalize$2(featureValueType ?? null) : capitalize$2(featureValueType ?? null);
|
|
153378
153555
|
const mainLabel = showObsLabel ? obsLabel : featureLabel;
|
|
153379
153556
|
const subLabel = showObsLabel ? featureLabel : null;
|
|
153380
153557
|
const hasSubLabel = subLabel !== null;
|
|
153381
153558
|
if (!isSetColor) {
|
|
153382
|
-
g2.append("text").attr("text-anchor", hasSubLabel ? "start" : "end").attr("dominant-baseline", "hanging").attr("x", hasSubLabel ? 0 : width2).attr("y", 0).text(mainLabel).style("font-size", "10px").style("fill", foregroundColor);
|
|
153559
|
+
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);
|
|
153383
153560
|
if (hasSubLabel) {
|
|
153384
|
-
g2.append("text").attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("x", width2).attr("y", titleHeight).text(subLabel).style("font-size", "9px").style("fill", foregroundColor);
|
|
153561
|
+
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);
|
|
153385
153562
|
}
|
|
153386
153563
|
}
|
|
153387
153564
|
}, [
|
|
@@ -153389,6 +153566,7 @@ function Legend(props) {
|
|
|
153389
153566
|
height2,
|
|
153390
153567
|
featureValueColormap,
|
|
153391
153568
|
featureValueColormapRange,
|
|
153569
|
+
localRange,
|
|
153392
153570
|
considerSelections,
|
|
153393
153571
|
obsType,
|
|
153394
153572
|
obsColorEncoding,
|
|
@@ -153407,20 +153585,63 @@ function Legend(props) {
|
|
|
153407
153585
|
contoursFilled,
|
|
153408
153586
|
contoursVisible,
|
|
153409
153587
|
pointsVisible,
|
|
153410
|
-
featureAggregationStrategy
|
|
153588
|
+
featureAggregationStrategy,
|
|
153589
|
+
setFeatureValueColormapRange,
|
|
153590
|
+
dynamicHeight,
|
|
153591
|
+
highContrast,
|
|
153592
|
+
isStaticColor,
|
|
153593
|
+
missing,
|
|
153594
|
+
showObsLabel,
|
|
153595
|
+
staticColor
|
|
153411
153596
|
]);
|
|
153412
|
-
|
|
153597
|
+
const showInteractiveSlider = setFeatureValueColormapRange && ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && pointsVisible && featureValueColormap;
|
|
153598
|
+
const globalExtent = useMemo(() => {
|
|
153599
|
+
const combined = combineExtents(extent2 ?? null, featureAggregationStrategy ?? null);
|
|
153600
|
+
return combined || [0, 1];
|
|
153601
|
+
}, [extent2, featureAggregationStrategy]);
|
|
153602
|
+
const formatSliderValue = useCallback((value) => {
|
|
153603
|
+
const [xMin, xMax] = globalExtent;
|
|
153604
|
+
const dataValue = xMin + (xMax - xMin) * value;
|
|
153605
|
+
const range2 = xMax - xMin;
|
|
153606
|
+
if (range2 < 0.01) {
|
|
153607
|
+
return dataValue.toExponential(2);
|
|
153608
|
+
}
|
|
153609
|
+
if (range2 < 1) {
|
|
153610
|
+
return dataValue.toFixed(3);
|
|
153611
|
+
}
|
|
153612
|
+
if (range2 < 100) {
|
|
153613
|
+
return dataValue.toFixed(1);
|
|
153614
|
+
}
|
|
153615
|
+
return Math.round(dataValue).toString();
|
|
153616
|
+
}, [globalExtent]);
|
|
153617
|
+
const xlinkHref = featureValueColormap ? getXlinkHref(featureValueColormap) : null;
|
|
153618
|
+
const currentLocalRange = localRange || [0, 1];
|
|
153619
|
+
return jsxRuntimeExports.jsxs("div", { className: clsx$1(classes.legend, {
|
|
153413
153620
|
[classes.legendRelative]: positionRelative,
|
|
153414
153621
|
[classes.legendAbsolute]: !positionRelative,
|
|
153415
153622
|
[classes.legendHighContrast]: highContrast,
|
|
153416
153623
|
[classes.legendLowContrast]: !highContrast,
|
|
153417
153624
|
[classes.legendInvisible]: !visible
|
|
153418
153625
|
}), style: {
|
|
153419
|
-
...needsScroll ? { maxHeight: `${Math.floor(availHeight)}px`, overflowY: "auto" } : { maxHeight: void 0, overflowY: "visible" }
|
|
153420
|
-
|
|
153626
|
+
...needsScroll ? { maxHeight: `${Math.floor(availHeight)}px`, overflowY: "auto" } : { maxHeight: void 0, overflowY: "visible" },
|
|
153627
|
+
width: `${width2}px`
|
|
153628
|
+
}, children: [jsxRuntimeExports.jsx("svg", { ref: svgRef, style: {
|
|
153421
153629
|
width: `${width2}px`,
|
|
153422
153630
|
height: `${dynamicHeight}px`
|
|
153423
|
-
} })
|
|
153631
|
+
} }), showInteractiveSlider && xlinkHref && jsxRuntimeExports.jsxs("div", { className: classes.sliderContainer, children: [currentLocalRange[0] > 0 && jsxRuntimeExports.jsx("div", { className: classes.grayTrack, style: {
|
|
153632
|
+
left: 0,
|
|
153633
|
+
width: `${currentLocalRange[0] * 100}%`
|
|
153634
|
+
} }), currentLocalRange[1] < 1 && jsxRuntimeExports.jsx("div", { className: classes.grayTrack, style: {
|
|
153635
|
+
left: `${currentLocalRange[1] * 100}%`,
|
|
153636
|
+
width: `${(1 - currentLocalRange[1]) * 100}%`
|
|
153637
|
+
} }), jsxRuntimeExports.jsx("img", { src: xlinkHref, alt: "Colormap gradient", className: classes.colormapImage, style: {
|
|
153638
|
+
left: `${currentLocalRange[0] * 100}%`,
|
|
153639
|
+
width: `${(currentLocalRange[1] - currentLocalRange[0]) * 100}%`
|
|
153640
|
+
} }), jsxRuntimeExports.jsx(Slider, { className: classes.sliderRoot, value: currentLocalRange, onChange: handleSliderChange, min: 0, max: 1, step: 0.01, disableSwap: true, valueLabelDisplay: "auto", valueLabelFormat: formatSliderValue, "aria-label": "Colormap range", getAriaLabel: (index2) => index2 === 0 ? "Colormap minimum" : "Colormap maximum", getAriaValueText: (value) => formatSliderValue(value), slotProps: {
|
|
153641
|
+
thumb: {
|
|
153642
|
+
className: classes.sliderThumb
|
|
153643
|
+
}
|
|
153644
|
+
} })] })] });
|
|
153424
153645
|
}
|
|
153425
153646
|
makeStyles()(() => ({
|
|
153426
153647
|
multiLegend: {
|
|
@@ -153768,7 +153989,8 @@ function EmbeddingScatterplotSubscriber(props) {
|
|
|
153768
153989
|
xRange,
|
|
153769
153990
|
yRange,
|
|
153770
153991
|
width2,
|
|
153771
|
-
height2
|
|
153992
|
+
height2,
|
|
153993
|
+
numCells
|
|
153772
153994
|
);
|
|
153773
153995
|
setDynamicCellRadius(pointSizeDevicePixels);
|
|
153774
153996
|
const nextCellOpacityScale = getPointOpacity(
|
|
@@ -154075,6 +154297,7 @@ function EmbeddingScatterplotSubscriber(props) {
|
|
|
154075
154297
|
featureLabelsMap,
|
|
154076
154298
|
featureValueColormap: geneExpressionColormap,
|
|
154077
154299
|
featureValueColormapRange: geneExpressionColormapRange,
|
|
154300
|
+
setFeatureValueColormapRange: setGeneExpressionColormapRange,
|
|
154078
154301
|
obsSetSelection: cellSetSelection,
|
|
154079
154302
|
extent: expressionExtents,
|
|
154080
154303
|
missing: expressionMissing,
|