@vitessce/heatmap 3.0.0 → 3.0.1
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-16770a05.js → deflate-6ff65b5f.js} +1 -1
- package/dist/{index-516800f9.js → index-047725f9.js} +73 -80
- package/dist/index.js +1 -1
- package/dist/{jpeg-aaa6dcb6.js → jpeg-7841016e.js} +1 -1
- package/dist/{lerc-4c94e66f.js → lerc-566b409f.js} +1 -1
- package/dist/{lzw-072df1d0.js → lzw-b36101c3.js} +1 -1
- package/dist/{packbits-3dcafae7.js → packbits-cb32e60c.js} +1 -1
- package/dist/{raw-282aecb8.js → raw-b35f9004.js} +1 -1
- package/dist/{webimage-0d9c3bfd.js → webimage-4ffaa38f.js} +1 -1
- package/dist-tsc/Heatmap.d.ts +5 -5
- package/dist-tsc/Heatmap.d.ts.map +1 -1
- package/dist-tsc/Heatmap.js +59 -59
- package/dist-tsc/Heatmap.test.js +1 -1
- package/dist-tsc/HeatmapSubscriber.d.ts.map +1 -1
- package/dist-tsc/HeatmapSubscriber.js +10 -18
- package/dist-tsc/utils.test.js +1 -0
- package/package.json +13 -13
- package/src/Heatmap.js +63 -61
- package/src/Heatmap.test.jsx +1 -1
- package/src/HeatmapSubscriber.js +17 -23
- package/src/utils.test.js +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React__default, { Children, isValidElement, cloneElement, useRef, useEffect, useLayoutEffect, createElement, forwardRef, useState, useMemo, useImperativeHandle, useReducer, useCallback } from "react";
|
|
3
|
-
import { useVitessceContainer, useComponentHover, useComponentViewInfo, usePlotOptionsStyles, OptionsContainer, OptionSelect, useLoaders, useSetComponentHover, useSetComponentViewInfo, useCoordination,
|
|
3
|
+
import { useVitessceContainer, useComponentHover, useComponentViewInfo, usePlotOptionsStyles, OptionsContainer, OptionSelect, useLoaders, useSetComponentHover, useSetComponentViewInfo, useCoordination, useDeckCanvasSize, useMultiObsLabels, useFeatureLabelsData, useObsFeatureMatrixData, useObsSetsData, useReady, useUrls, useUint8ObsFeatureMatrix, useGetObsInfo, useGetObsMembership, TitleInfo } from "@vitessce/vit-s";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
|
5
5
|
function _mergeNamespaces(n2, m) {
|
|
6
6
|
for (var i2 = 0; i2 < m.length; i2++) {
|
|
@@ -132442,16 +132442,16 @@ function addDecoder(cases, importFn) {
|
|
|
132442
132442
|
}
|
|
132443
132443
|
cases.forEach((c) => registry$1.set(c, importFn));
|
|
132444
132444
|
}
|
|
132445
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
132446
|
-
addDecoder(5, () => import("./lzw-
|
|
132445
|
+
addDecoder([void 0, 1], () => import("./raw-b35f9004.js").then((m) => m.default));
|
|
132446
|
+
addDecoder(5, () => import("./lzw-b36101c3.js").then((m) => m.default));
|
|
132447
132447
|
addDecoder(6, () => {
|
|
132448
132448
|
throw new Error("old style JPEG compression is not supported.");
|
|
132449
132449
|
});
|
|
132450
|
-
addDecoder(7, () => import("./jpeg-
|
|
132451
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
132452
|
-
addDecoder(32773, () => import("./packbits-
|
|
132453
|
-
addDecoder(34887, () => import("./lerc-
|
|
132454
|
-
addDecoder(50001, () => import("./webimage-
|
|
132450
|
+
addDecoder(7, () => import("./jpeg-7841016e.js").then((m) => m.default));
|
|
132451
|
+
addDecoder([8, 32946], () => import("./deflate-6ff65b5f.js").then((m) => m.default));
|
|
132452
|
+
addDecoder(32773, () => import("./packbits-cb32e60c.js").then((m) => m.default));
|
|
132453
|
+
addDecoder(34887, () => import("./lerc-566b409f.js").then((m) => m.default));
|
|
132454
|
+
addDecoder(50001, () => import("./webimage-4ffaa38f.js").then((m) => m.default));
|
|
132455
132455
|
function decodeRowAcc(row, stride) {
|
|
132456
132456
|
let length2 = row.length - stride;
|
|
132457
132457
|
let offset5 = 0;
|
|
@@ -143412,12 +143412,11 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143412
143412
|
setViewState,
|
|
143413
143413
|
width: viewWidth,
|
|
143414
143414
|
height: viewHeight,
|
|
143415
|
-
|
|
143415
|
+
uint8ObsFeatureMatrix,
|
|
143416
143416
|
cellColors,
|
|
143417
143417
|
cellColorLabels = [""],
|
|
143418
143418
|
colormap,
|
|
143419
143419
|
colormapRange,
|
|
143420
|
-
clearPleaseWait,
|
|
143421
143420
|
setComponentHover,
|
|
143422
143421
|
setCellHighlight = createDefaultUpdateCellsHover("Heatmap"),
|
|
143423
143422
|
setGeneHighlight = createDefaultUpdateGenesHover("Heatmap"),
|
|
@@ -143435,7 +143434,9 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143435
143434
|
hideVariableLabels = false,
|
|
143436
143435
|
onHeatmapClick,
|
|
143437
143436
|
setColorEncoding,
|
|
143438
|
-
|
|
143437
|
+
obsIndex,
|
|
143438
|
+
featureIndex,
|
|
143439
|
+
featureLabelsMap
|
|
143439
143440
|
} = props2;
|
|
143440
143441
|
const viewState = {
|
|
143441
143442
|
...rawViewState,
|
|
@@ -143445,11 +143446,6 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143445
143446
|
const axisLeftTitle = transpose2 ? variablesTitle : observationsTitle;
|
|
143446
143447
|
const axisTopTitle = transpose2 ? observationsTitle : variablesTitle;
|
|
143447
143448
|
const workerPool = useMemo(() => new HeatmapPool(), []);
|
|
143448
|
-
useEffect(() => {
|
|
143449
|
-
if (clearPleaseWait && expression) {
|
|
143450
|
-
clearPleaseWait("expression-matrix");
|
|
143451
|
-
}
|
|
143452
|
-
}, [clearPleaseWait, expression]);
|
|
143453
143449
|
const tilesRef = useRef();
|
|
143454
143450
|
const dataRef = useRef();
|
|
143455
143451
|
const [axisLeftLabels, setAxisLeftLabels] = useState([]);
|
|
@@ -143459,15 +143455,15 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143459
143455
|
const [tileIteration, incTileIteration] = useReducer((i2) => i2 + 1, 0);
|
|
143460
143456
|
const [backlog, setBacklog] = useState([]);
|
|
143461
143457
|
useEffect(() => {
|
|
143462
|
-
if (
|
|
143463
|
-
dataRef.current = copyUint8Array(
|
|
143458
|
+
if (uint8ObsFeatureMatrix && !shouldUsePaddedImplementation(uint8ObsFeatureMatrix.length)) {
|
|
143459
|
+
dataRef.current = copyUint8Array(uint8ObsFeatureMatrix);
|
|
143464
143460
|
}
|
|
143465
|
-
}, [dataRef,
|
|
143461
|
+
}, [dataRef, uint8ObsFeatureMatrix]);
|
|
143466
143462
|
useEffect(() => {
|
|
143467
|
-
if (!
|
|
143463
|
+
if (!obsIndex) {
|
|
143468
143464
|
return;
|
|
143469
143465
|
}
|
|
143470
|
-
const newCellOrdering = !cellColors || cellColors.size === 0 ?
|
|
143466
|
+
const newCellOrdering = !cellColors || cellColors.size === 0 ? obsIndex : Array.from(cellColors.keys());
|
|
143471
143467
|
const oldCellOrdering = transpose2 ? axisTopLabels : axisLeftLabels;
|
|
143472
143468
|
if (!isEqual$1(oldCellOrdering, newCellOrdering)) {
|
|
143473
143469
|
if (transpose2) {
|
|
@@ -143476,33 +143472,33 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143476
143472
|
setAxisLeftLabels(newCellOrdering);
|
|
143477
143473
|
}
|
|
143478
143474
|
}
|
|
143479
|
-
}, [
|
|
143475
|
+
}, [obsIndex, cellColors, axisTopLabels, axisLeftLabels, transpose2]);
|
|
143480
143476
|
useEffect(() => {
|
|
143481
|
-
if (!
|
|
143477
|
+
if (!featureIndex) {
|
|
143482
143478
|
return;
|
|
143483
143479
|
}
|
|
143484
143480
|
if (transpose2) {
|
|
143485
|
-
setAxisLeftLabels(
|
|
143481
|
+
setAxisLeftLabels(featureIndex);
|
|
143486
143482
|
} else {
|
|
143487
|
-
setAxisTopLabels(
|
|
143483
|
+
setAxisTopLabels(featureIndex);
|
|
143488
143484
|
}
|
|
143489
|
-
}, [
|
|
143485
|
+
}, [featureIndex, transpose2]);
|
|
143490
143486
|
const [longestCellLabel, longestGeneLabel] = useMemo(() => {
|
|
143491
|
-
if (!
|
|
143487
|
+
if (!obsIndex || !featureIndex) {
|
|
143492
143488
|
return ["", ""];
|
|
143493
143489
|
}
|
|
143494
143490
|
return [
|
|
143495
|
-
getLongestString(
|
|
143496
|
-
getLongestString([...
|
|
143491
|
+
getLongestString(obsIndex),
|
|
143492
|
+
getLongestString([...featureIndex, ...cellColorLabels])
|
|
143497
143493
|
];
|
|
143498
|
-
}, [
|
|
143494
|
+
}, [featureIndex, cellColorLabels, obsIndex]);
|
|
143499
143495
|
const expressionRowLookUp = useMemo(() => {
|
|
143500
143496
|
const lookUp = /* @__PURE__ */ new Map();
|
|
143501
|
-
if (
|
|
143502
|
-
|
|
143497
|
+
if (obsIndex) {
|
|
143498
|
+
obsIndex.forEach((cell, j) => lookUp.set(cell, j));
|
|
143503
143499
|
}
|
|
143504
143500
|
return lookUp;
|
|
143505
|
-
}, [
|
|
143501
|
+
}, [obsIndex]);
|
|
143506
143502
|
const width = axisTopLabels.length;
|
|
143507
143503
|
const height = axisLeftLabels.length;
|
|
143508
143504
|
const [axisOffsetLeft, axisOffsetTop] = getAxisSizes(
|
|
@@ -143588,29 +143584,28 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143588
143584
|
});
|
|
143589
143585
|
}, [matrixRight, matrixBottom, transpose2, setViewState]);
|
|
143590
143586
|
useEffect(() => {
|
|
143591
|
-
if (!
|
|
143587
|
+
if (!uint8ObsFeatureMatrix || uint8ObsFeatureMatrix.length < DATA_TEXTURE_SIZE ** 2) {
|
|
143592
143588
|
return;
|
|
143593
143589
|
}
|
|
143594
143590
|
if (axisTopLabels && axisLeftLabels && xTiles && yTiles) {
|
|
143595
143591
|
setBacklog((prev) => [...prev, v4$1()]);
|
|
143596
143592
|
}
|
|
143597
|
-
}, [dataRef,
|
|
143593
|
+
}, [dataRef, uint8ObsFeatureMatrix, axisTopLabels, axisLeftLabels, xTiles, yTiles]);
|
|
143598
143594
|
useEffect(() => {
|
|
143599
143595
|
if (backlog.length < 1 || shouldUsePaddedImplementation(dataRef.current.length)) {
|
|
143600
143596
|
return;
|
|
143601
143597
|
}
|
|
143602
143598
|
const curr = backlog[backlog.length - 1];
|
|
143603
143599
|
if (dataRef.current && dataRef.current.buffer.byteLength && expressionRowLookUp.size > 0 && !shouldUsePaddedImplementation(dataRef.current.length)) {
|
|
143604
|
-
const { cols, matrix: matrix2 } = expression;
|
|
143605
143600
|
const promises = range$5(yTiles).map((i2) => range$5(xTiles).map(async (j) => workerPool.process({
|
|
143606
143601
|
curr,
|
|
143607
143602
|
tileI: i2,
|
|
143608
143603
|
tileJ: j,
|
|
143609
143604
|
tileSize: TILE_SIZE,
|
|
143610
143605
|
cellOrdering: transpose2 ? axisTopLabels : axisLeftLabels,
|
|
143611
|
-
cols,
|
|
143606
|
+
cols: featureIndex,
|
|
143612
143607
|
transpose: transpose2,
|
|
143613
|
-
data:
|
|
143608
|
+
data: uint8ObsFeatureMatrix.buffer.slice(),
|
|
143614
143609
|
expressionRowLookUp
|
|
143615
143610
|
})));
|
|
143616
143611
|
const process2 = async () => {
|
|
@@ -143630,27 +143625,28 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143630
143625
|
axisLeftLabels,
|
|
143631
143626
|
axisTopLabels,
|
|
143632
143627
|
backlog,
|
|
143633
|
-
|
|
143628
|
+
uint8ObsFeatureMatrix,
|
|
143634
143629
|
transpose2,
|
|
143635
143630
|
xTiles,
|
|
143636
143631
|
yTiles,
|
|
143637
143632
|
workerPool,
|
|
143638
|
-
expressionRowLookUp
|
|
143633
|
+
expressionRowLookUp,
|
|
143634
|
+
featureIndex
|
|
143639
143635
|
]);
|
|
143640
143636
|
useEffect(() => {
|
|
143641
143637
|
setIsRendering(backlog.length > 0);
|
|
143642
143638
|
}, [backlog, setIsRendering]);
|
|
143643
143639
|
const paddedExpressions = useMemo(() => {
|
|
143644
143640
|
const cellOrdering = transpose2 ? axisTopLabels : axisLeftLabels;
|
|
143645
|
-
if (
|
|
143641
|
+
if (uint8ObsFeatureMatrix && cellOrdering.length && gl && shouldUsePaddedImplementation(uint8ObsFeatureMatrix.length)) {
|
|
143646
143642
|
let newIndex = 0;
|
|
143647
143643
|
for (let cellOrderingIndex = 0; cellOrderingIndex < cellOrdering.length; cellOrderingIndex += 1) {
|
|
143648
143644
|
const cell = cellOrdering[cellOrderingIndex];
|
|
143649
143645
|
newIndex = transpose2 ? cellOrderingIndex : newIndex;
|
|
143650
143646
|
const cellIndex = expressionRowLookUp.get(cell);
|
|
143651
|
-
for (let geneIndex = 0; geneIndex <
|
|
143652
|
-
const index2 = cellIndex *
|
|
143653
|
-
paddedExpressionContainer[newIndex % (DATA_TEXTURE_SIZE * DATA_TEXTURE_SIZE)] =
|
|
143647
|
+
for (let geneIndex = 0; geneIndex < featureIndex.length; geneIndex += 1) {
|
|
143648
|
+
const index2 = cellIndex * featureIndex.length + geneIndex;
|
|
143649
|
+
paddedExpressionContainer[newIndex % (DATA_TEXTURE_SIZE * DATA_TEXTURE_SIZE)] = uint8ObsFeatureMatrix[index2];
|
|
143654
143650
|
newIndex = transpose2 ? newIndex + cellOrdering.length : newIndex + 1;
|
|
143655
143651
|
}
|
|
143656
143652
|
}
|
|
@@ -143672,18 +143668,18 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143672
143668
|
transpose2,
|
|
143673
143669
|
axisTopLabels,
|
|
143674
143670
|
axisLeftLabels,
|
|
143675
|
-
|
|
143671
|
+
uint8ObsFeatureMatrix,
|
|
143676
143672
|
expressionRowLookUp,
|
|
143673
|
+
featureIndex,
|
|
143677
143674
|
gl
|
|
143678
143675
|
]);
|
|
143679
143676
|
const heatmapLayers = useMemo(() => {
|
|
143680
|
-
const usePaddedExpressions =
|
|
143677
|
+
const usePaddedExpressions = uint8ObsFeatureMatrix && shouldUsePaddedImplementation(uint8ObsFeatureMatrix.length);
|
|
143681
143678
|
if ((!tilesRef.current || backlog.length) && !usePaddedExpressions) {
|
|
143682
143679
|
return [];
|
|
143683
143680
|
}
|
|
143684
143681
|
if (usePaddedExpressions) {
|
|
143685
143682
|
let getLayer2 = function(i2, j) {
|
|
143686
|
-
const { cols } = expression;
|
|
143687
143683
|
return new PaddedExpressionHeatmapBitmapLayer({
|
|
143688
143684
|
id: `heatmapLayer-${i2}-${j}`,
|
|
143689
143685
|
image: paddedExpressions,
|
|
@@ -143697,7 +143693,7 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143697
143693
|
tileJ: j,
|
|
143698
143694
|
numXTiles: xTiles,
|
|
143699
143695
|
numYTiles: yTiles,
|
|
143700
|
-
origDataSize: transpose2 ? [
|
|
143696
|
+
origDataSize: transpose2 ? [featureIndex.length, cellOrdering.length] : [cellOrdering.length, featureIndex.length],
|
|
143701
143697
|
aggSizeX,
|
|
143702
143698
|
aggSizeY,
|
|
143703
143699
|
colormap,
|
|
@@ -143741,28 +143737,29 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143741
143737
|
);
|
|
143742
143738
|
return layers2;
|
|
143743
143739
|
}, [
|
|
143744
|
-
|
|
143740
|
+
uint8ObsFeatureMatrix,
|
|
143745
143741
|
backlog.length,
|
|
143746
143742
|
transpose2,
|
|
143747
143743
|
axisTopLabels,
|
|
143748
143744
|
axisLeftLabels,
|
|
143749
|
-
yTiles,
|
|
143750
|
-
xTiles,
|
|
143751
143745
|
paddedExpressions,
|
|
143752
143746
|
matrixLeft,
|
|
143753
143747
|
tileWidth,
|
|
143754
143748
|
matrixTop,
|
|
143755
143749
|
tileHeight,
|
|
143750
|
+
yTiles,
|
|
143751
|
+
xTiles,
|
|
143756
143752
|
aggSizeX,
|
|
143757
143753
|
aggSizeY,
|
|
143758
143754
|
colormap,
|
|
143759
143755
|
colormapRange,
|
|
143760
|
-
tileIteration
|
|
143756
|
+
tileIteration,
|
|
143757
|
+
featureIndex
|
|
143761
143758
|
]);
|
|
143762
143759
|
const axisLeftDashes = transpose2 ? variablesDashes : observationsDashes;
|
|
143763
143760
|
const axisTopDashes = transpose2 ? observationsDashes : variablesDashes;
|
|
143764
|
-
const axisTopLabelData = useMemo(() => axisTopLabels.map((d, i2) => [i2, axisTopDashes ? `- ${d}` : d]), [axisTopLabels, axisTopDashes]);
|
|
143765
|
-
const axisLeftLabelData = useMemo(() => axisLeftLabels.map((d, i2) => [i2, axisLeftDashes ? `${d} -` : d]), [axisLeftLabels, axisLeftDashes]);
|
|
143761
|
+
const axisTopLabelData = useMemo(() => (!transpose2 && featureLabelsMap ? axisTopLabels.map((d) => featureLabelsMap.get(d) || d) : axisTopLabels).map((d, i2) => [i2, axisTopDashes ? `- ${d}` : d]), [axisTopLabels, axisTopDashes, transpose2, featureLabelsMap]);
|
|
143762
|
+
const axisLeftLabelData = useMemo(() => (transpose2 && featureLabelsMap ? axisLeftLabels.map((d) => featureLabelsMap.get(d) || d) : axisLeftLabels).map((d, i2) => [i2, axisLeftDashes ? `${d} -` : d]), [axisLeftLabels, axisLeftDashes, transpose2, featureLabelsMap]);
|
|
143766
143763
|
const cellColorLabelsData = useMemo(() => cellColorLabels.map((d, i2) => [i2, d && (transpose2 ? `${d} -` : `- ${d}`)]), [cellColorLabels, transpose2]);
|
|
143767
143764
|
const hideTopLabels = transpose2 ? hideObservationLabels : hideVariableLabels;
|
|
143768
143765
|
const hideLeftLabels = transpose2 ? hideVariableLabels : hideObservationLabels;
|
|
@@ -143933,7 +143930,7 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143933
143930
|
const showText = width > 0 && height > 0;
|
|
143934
143931
|
const layers = heatmapLayers.concat(showText ? textLayers : []).concat(...cellColorsLayersList);
|
|
143935
143932
|
function onHover(info, event) {
|
|
143936
|
-
if (!
|
|
143933
|
+
if (!uint8ObsFeatureMatrix) {
|
|
143937
143934
|
return;
|
|
143938
143935
|
}
|
|
143939
143936
|
let highlightedCell = null;
|
|
@@ -143959,8 +143956,8 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143959
143956
|
setTrackHighlight(null);
|
|
143960
143957
|
setColorEncoding("geneSelection");
|
|
143961
143958
|
} else {
|
|
143962
|
-
const obsI2 =
|
|
143963
|
-
const cellIndex =
|
|
143959
|
+
const obsI2 = obsIndex.indexOf(transpose2 ? axisTopLabels[trackColI] : axisLeftLabels[trackColI]);
|
|
143960
|
+
const cellIndex = obsIndex[obsI2];
|
|
143964
143961
|
setTrackHighlight([cellIndex, trackI, mouseX, mouseY]);
|
|
143965
143962
|
highlightedCell = cellIndex;
|
|
143966
143963
|
setColorEncoding("cellSelection");
|
|
@@ -143976,9 +143973,9 @@ const Heatmap = forwardRef((props2, deckRef) => {
|
|
|
143976
143973
|
numRows: height,
|
|
143977
143974
|
numCols: width
|
|
143978
143975
|
});
|
|
143979
|
-
const obsI =
|
|
143980
|
-
const varI =
|
|
143981
|
-
const obsId =
|
|
143976
|
+
const obsI = obsIndex.indexOf(transpose2 ? axisTopLabels[colI] : axisLeftLabels[rowI]);
|
|
143977
|
+
const varI = featureIndex.indexOf(transpose2 ? axisLeftLabels[rowI] : axisTopLabels[colI]);
|
|
143978
|
+
const obsId = obsIndex[obsI];
|
|
143982
143979
|
const varId = featureIndex[varI];
|
|
143983
143980
|
if (setComponentHover) {
|
|
143984
143981
|
setComponentHover();
|
|
@@ -144332,37 +144329,36 @@ function HeatmapSubscriber(props2) {
|
|
|
144332
144329
|
const variablesTitle = capitalize$1(variablesPluralLabel);
|
|
144333
144330
|
const [isRendering, setIsRendering] = useState(false);
|
|
144334
144331
|
const [hoveredColorEncoding, setHoveredColorEncoding] = useState("geneSelection");
|
|
144335
|
-
const [urls, addUrl] = useUrls(loaders, dataset);
|
|
144336
144332
|
const [width, height, deckRef] = useDeckCanvasSize();
|
|
144337
144333
|
const [obsLabelsTypes, obsLabelsData] = useMultiObsLabels(
|
|
144338
144334
|
coordinationScopes,
|
|
144339
144335
|
obsType,
|
|
144340
144336
|
loaders,
|
|
144341
|
-
dataset
|
|
144342
|
-
addUrl
|
|
144337
|
+
dataset
|
|
144343
144338
|
);
|
|
144344
|
-
const [{ featureLabelsMap }, featureLabelsStatus] = useFeatureLabelsData(
|
|
144339
|
+
const [{ featureLabelsMap }, featureLabelsStatus, featureLabelsUrls] = useFeatureLabelsData(
|
|
144345
144340
|
loaders,
|
|
144346
144341
|
dataset,
|
|
144347
|
-
addUrl,
|
|
144348
144342
|
false,
|
|
144349
144343
|
{},
|
|
144350
144344
|
{},
|
|
144351
144345
|
{ featureType }
|
|
144352
144346
|
);
|
|
144353
|
-
const [
|
|
144347
|
+
const [
|
|
144348
|
+
{ obsIndex, featureIndex, obsFeatureMatrix },
|
|
144349
|
+
matrixStatus,
|
|
144350
|
+
matrixUrls
|
|
144351
|
+
] = useObsFeatureMatrixData(
|
|
144354
144352
|
loaders,
|
|
144355
144353
|
dataset,
|
|
144356
|
-
addUrl,
|
|
144357
144354
|
true,
|
|
144358
144355
|
{},
|
|
144359
144356
|
{},
|
|
144360
144357
|
{ obsType, featureType, featureValueType }
|
|
144361
144358
|
);
|
|
144362
|
-
const [{ obsSets: cellSets, obsSetsMembership }, obsSetsStatus] = useObsSetsData(
|
|
144359
|
+
const [{ obsSets: cellSets, obsSetsMembership }, obsSetsStatus, obsSetsUrls] = useObsSetsData(
|
|
144363
144360
|
loaders,
|
|
144364
144361
|
dataset,
|
|
144365
|
-
addUrl,
|
|
144366
144362
|
false,
|
|
144367
144363
|
{ setObsSetSelection: setCellSetSelection, setObsSetColor: setCellSetColor },
|
|
144368
144364
|
{ obsSetSelection: cellSetSelection, obsSetColor: cellSetColor },
|
|
@@ -144373,6 +144369,11 @@ function HeatmapSubscriber(props2) {
|
|
|
144373
144369
|
matrixStatus,
|
|
144374
144370
|
obsSetsStatus
|
|
144375
144371
|
]);
|
|
144372
|
+
const urls = useUrls([
|
|
144373
|
+
featureLabelsUrls,
|
|
144374
|
+
matrixUrls,
|
|
144375
|
+
obsSetsUrls
|
|
144376
|
+
]);
|
|
144376
144377
|
const [uint8ObsFeatureMatrix, obsFeatureMatrixExtent] = useUint8ObsFeatureMatrix(
|
|
144377
144378
|
{ obsFeatureMatrix }
|
|
144378
144379
|
);
|
|
@@ -144407,16 +144408,6 @@ function HeatmapSubscriber(props2) {
|
|
|
144407
144408
|
}
|
|
144408
144409
|
return null;
|
|
144409
144410
|
}, [variablesLabel, featureLabelsMap]);
|
|
144410
|
-
const expressionMatrix = useMemo(() => {
|
|
144411
|
-
if (obsIndex && featureIndex && uint8ObsFeatureMatrix) {
|
|
144412
|
-
return {
|
|
144413
|
-
rows: obsIndex,
|
|
144414
|
-
cols: featureLabelsMap ? featureIndex.map((key) => featureLabelsMap.get(key) || key) : featureIndex,
|
|
144415
|
-
matrix: uint8ObsFeatureMatrix.data
|
|
144416
|
-
};
|
|
144417
|
-
}
|
|
144418
|
-
return null;
|
|
144419
|
-
}, [obsIndex, featureIndex, uint8ObsFeatureMatrix, featureLabelsMap]);
|
|
144420
144411
|
const cellsCount = obsIndex ? obsIndex.length : 0;
|
|
144421
144412
|
const genesCount = featureIndex ? featureIndex.length : 0;
|
|
144422
144413
|
const setTrackHighlight = useCallback(() => {
|
|
@@ -144480,12 +144471,14 @@ function HeatmapSubscriber(props2) {
|
|
|
144480
144471
|
width,
|
|
144481
144472
|
theme,
|
|
144482
144473
|
uuid,
|
|
144483
|
-
|
|
144474
|
+
uint8ObsFeatureMatrix: uint8ObsFeatureMatrix == null ? void 0 : uint8ObsFeatureMatrix.data,
|
|
144484
144475
|
cellColors,
|
|
144485
144476
|
colormap: geneExpressionColormap,
|
|
144486
144477
|
setIsRendering,
|
|
144487
144478
|
setCellHighlight,
|
|
144488
144479
|
setGeneHighlight,
|
|
144480
|
+
featureLabelsMap,
|
|
144481
|
+
obsIndex,
|
|
144489
144482
|
featureIndex,
|
|
144490
144483
|
setTrackHighlight,
|
|
144491
144484
|
setComponentHover: () => {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
|
|
2
|
-
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-047725f9.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@vitessce/vit-s";
|
|
5
5
|
import "react-dom";
|
package/dist-tsc/Heatmap.d.ts
CHANGED
|
@@ -12,15 +12,12 @@ export default Heatmap;
|
|
|
12
12
|
* for DeckGL.
|
|
13
13
|
* @param {number} props.width The width of the canvas.
|
|
14
14
|
* @param {number} props.height The height of the canvas.
|
|
15
|
-
* @param {
|
|
16
|
-
*
|
|
17
|
-
* and cols is a list of gene ID strings.
|
|
15
|
+
* @param {null|Uint8Array} props.uint8ObsFeatureMatrix A flat Uint8Array
|
|
16
|
+
* containing the expression data.
|
|
18
17
|
* @param {Map} props.cellColors Map of cell ID to color. Optional.
|
|
19
18
|
* If defined, the key ordering is used to order the cell axis of the heatmap.
|
|
20
19
|
* @param {array} props.cellColorLabels array of labels to place beside cell color
|
|
21
20
|
* tracks. Only works for transpose=true.
|
|
22
|
-
* @param {function} props.clearPleaseWait The clear please wait callback,
|
|
23
|
-
* called when the expression matrix has loaded (is not null).
|
|
24
21
|
* @param {function} props.setCellHighlight Callback function called on
|
|
25
22
|
* hover with the cell ID. Optional.
|
|
26
23
|
* @param {function} props.setGeneHighlight Callback function called on
|
|
@@ -38,6 +35,9 @@ export default Heatmap;
|
|
|
38
35
|
* @param {string} props.colormap The name of the colormap function to use.
|
|
39
36
|
* @param {array} props.colormapRange A tuple [lower, upper] to adjust the color scale.
|
|
40
37
|
* @param {function} props.setColormapRange The setter function for colormapRange.
|
|
38
|
+
* @param {string[]} props.obsIndex The cell ID list.
|
|
39
|
+
* @param {string[]} props.featureIndex The gene ID list.
|
|
40
|
+
* @param {null|Map<string,string>} props.featureLabelsMap A map of featureIndex to featureLabel.
|
|
41
41
|
*/
|
|
42
42
|
declare const Heatmap: any;
|
|
43
43
|
//# sourceMappingURL=Heatmap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["../src/Heatmap.js"],"names":[],"mappings":";AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,
|
|
1
|
+
{"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["../src/Heatmap.js"],"names":[],"mappings":";AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,2BAywBG"}
|