@vitessce/heatmap 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, H } from "./index-047725f9.js";
1
+ import { a, H } from "./index-2a959f7f.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-047725f9.js";
1
+ import { B as BaseDecoder } from "./index-2a959f7f.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -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-047725f9.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-2a959f7f.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-047725f9.js";
1
+ import { B as BaseDecoder } from "./index-2a959f7f.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-047725f9.js";
1
+ import { B as BaseDecoder } from "./index-2a959f7f.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-047725f9.js";
1
+ import { B as BaseDecoder } from "./index-2a959f7f.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-047725f9.js";
1
+ import { B as BaseDecoder } from "./index-2a959f7f.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -23,8 +23,11 @@ export default Heatmap;
23
23
  * @param {function} props.setGeneHighlight Callback function called on
24
24
  * hover with the gene ID. Optional.
25
25
  * @param {function} props.updateViewInfo Callback function that gets called with an
26
- * object { uuid, project() } where project is a function that maps (cellId, geneId)
27
- * to canvas (x,y) coordinates. Used to show tooltips. Optional.
26
+ * object { uuid, project(), projectFromId() } where
27
+ * project is the DeckGL Viewport.project function, and
28
+ * projectFromId is a wrapper around project that
29
+ * takes (cellId, geneId) as parameters and returns
30
+ * canvas (x,y) pixel coordinates. Used to show tooltips. Optional.
28
31
  * @param {boolean} props.transpose By default, false.
29
32
  * @param {string} props.variablesTitle By default, 'Genes'.
30
33
  * @param {string} props.observationsTitle By default, 'Cells'.
@@ -1 +1 @@
1
- {"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["../src/Heatmap.js"],"names":[],"mappings":";AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,2BAywBG"}
1
+ {"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["../src/Heatmap.js"],"names":[],"mappings":";AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,2BAywBG"}
@@ -43,8 +43,11 @@ function shouldUsePaddedImplementation(dataLength) {
43
43
  * @param {function} props.setGeneHighlight Callback function called on
44
44
  * hover with the gene ID. Optional.
45
45
  * @param {function} props.updateViewInfo Callback function that gets called with an
46
- * object { uuid, project() } where project is a function that maps (cellId, geneId)
47
- * to canvas (x,y) coordinates. Used to show tooltips. Optional.
46
+ * object { uuid, project(), projectFromId() } where
47
+ * project is the DeckGL Viewport.project function, and
48
+ * projectFromId is a wrapper around project that
49
+ * takes (cellId, geneId) as parameters and returns
50
+ * canvas (x,y) pixel coordinates. Used to show tooltips. Optional.
48
51
  * @param {boolean} props.transpose By default, false.
49
52
  * @param {string} props.variablesTitle By default, 'Genes'.
50
53
  * @param {string} props.observationsTitle By default, 'Cells'.
@@ -174,7 +177,7 @@ const Heatmap = forwardRef((props, deckRef) => {
174
177
  useEffect(() => {
175
178
  updateViewInfo({
176
179
  uuid,
177
- project: (cellId, geneId) => {
180
+ projectFromId: (cellId, geneId) => {
178
181
  const colI = transpose ? axisTopLabels.indexOf(cellId) : axisTopLabels.indexOf(geneId);
179
182
  const rowI = transpose ? axisLeftLabels.indexOf(geneId) : axisLeftLabels.indexOf(cellId);
180
183
  return heatmapToMousePosition(colI, rowI, {
@@ -8,14 +8,14 @@ export default function HeatmapTooltipSubscriber(props) {
8
8
  const viewInfo = useComponentViewInfo(parentUuid);
9
9
  const [cellInfo, cellCoord] = (obsHighlight && getObsInfo ? ([
10
10
  getObsInfo(obsHighlight),
11
- (viewInfo && viewInfo.project
12
- ? viewInfo.project(obsHighlight, null)[(transpose ? 0 : 1)]
11
+ (viewInfo && viewInfo.projectFromId
12
+ ? viewInfo.projectFromId(obsHighlight, null)[(transpose ? 0 : 1)]
13
13
  : null),
14
14
  ]) : ([null, null]));
15
15
  const [geneInfo, geneCoord] = (featureHighlight && getFeatureInfo ? ([
16
16
  getFeatureInfo(featureHighlight),
17
- (viewInfo && viewInfo.project
18
- ? viewInfo.project(null, featureHighlight)[(transpose ? 1 : 0)]
17
+ (viewInfo && viewInfo.projectFromId
18
+ ? viewInfo.projectFromId(null, featureHighlight)[(transpose ? 1 : 0)]
19
19
  : null),
20
20
  ]) : ([null, null]));
21
21
  const x = (transpose ? cellCoord : geneCoord);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/heatmap",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,14 +20,14 @@
20
20
  "lodash-es": "^4.17.21",
21
21
  "plur": "^5.1.0",
22
22
  "uuid": "^9.0.0",
23
- "@vitessce/constants-internal": "3.0.1",
24
- "@vitessce/gl": "3.0.1",
25
- "@vitessce/legend": "3.0.1",
26
- "@vitessce/sets-utils": "3.0.1",
27
- "@vitessce/tooltip": "3.0.1",
28
- "@vitessce/utils": "3.0.1",
29
- "@vitessce/vit-s": "3.0.1",
30
- "@vitessce/workers": "3.0.1"
23
+ "@vitessce/constants-internal": "3.1.0",
24
+ "@vitessce/gl": "3.1.0",
25
+ "@vitessce/legend": "3.1.0",
26
+ "@vitessce/sets-utils": "3.1.0",
27
+ "@vitessce/tooltip": "3.1.0",
28
+ "@vitessce/utils": "3.1.0",
29
+ "@vitessce/vit-s": "3.1.0",
30
+ "@vitessce/workers": "3.1.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "^5.16.4",
package/src/Heatmap.js CHANGED
@@ -76,8 +76,11 @@ function shouldUsePaddedImplementation(dataLength) {
76
76
  * @param {function} props.setGeneHighlight Callback function called on
77
77
  * hover with the gene ID. Optional.
78
78
  * @param {function} props.updateViewInfo Callback function that gets called with an
79
- * object { uuid, project() } where project is a function that maps (cellId, geneId)
80
- * to canvas (x,y) coordinates. Used to show tooltips. Optional.
79
+ * object { uuid, project(), projectFromId() } where
80
+ * project is the DeckGL Viewport.project function, and
81
+ * projectFromId is a wrapper around project that
82
+ * takes (cellId, geneId) as parameters and returns
83
+ * canvas (x,y) pixel coordinates. Used to show tooltips. Optional.
81
84
  * @param {boolean} props.transpose By default, false.
82
85
  * @param {string} props.variablesTitle By default, 'Genes'.
83
86
  * @param {string} props.observationsTitle By default, 'Cells'.
@@ -269,7 +272,7 @@ const Heatmap = forwardRef((props, deckRef) => {
269
272
  useEffect(() => {
270
273
  updateViewInfo({
271
274
  uuid,
272
- project: (cellId, geneId) => {
275
+ projectFromId: (cellId, geneId) => {
273
276
  const colI = transpose ? axisTopLabels.indexOf(cellId) : axisTopLabels.indexOf(geneId);
274
277
  const rowI = transpose ? axisLeftLabels.indexOf(geneId) : axisLeftLabels.indexOf(cellId);
275
278
  return heatmapToMousePosition(
@@ -16,8 +16,8 @@ export default function HeatmapTooltipSubscriber(props) {
16
16
  const [cellInfo, cellCoord] = (obsHighlight && getObsInfo ? (
17
17
  [
18
18
  getObsInfo(obsHighlight),
19
- (viewInfo && viewInfo.project
20
- ? viewInfo.project(obsHighlight, null)[(transpose ? 0 : 1)]
19
+ (viewInfo && viewInfo.projectFromId
20
+ ? viewInfo.projectFromId(obsHighlight, null)[(transpose ? 0 : 1)]
21
21
  : null),
22
22
  ]
23
23
  ) : ([null, null]));
@@ -25,8 +25,8 @@ export default function HeatmapTooltipSubscriber(props) {
25
25
  const [geneInfo, geneCoord] = (featureHighlight && getFeatureInfo ? (
26
26
  [
27
27
  getFeatureInfo(featureHighlight),
28
- (viewInfo && viewInfo.project
29
- ? viewInfo.project(null, featureHighlight)[(transpose ? 1 : 0)]
28
+ (viewInfo && viewInfo.projectFromId
29
+ ? viewInfo.projectFromId(null, featureHighlight)[(transpose ? 1 : 0)]
30
30
  : null),
31
31
  ]
32
32
  ) : ([null, null]));