@vitessce/zarr 2.0.1 → 2.0.2

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.
@@ -22,14 +22,14 @@ export default class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
22
22
  * Class method for loading feature string labels.
23
23
  * @returns {Promise} A promise for the array.
24
24
  */
25
- async loadLabels() {
25
+ loadLabels() {
26
26
  const { path } = this.options;
27
27
  if (this.labels) {
28
28
  return this.labels;
29
29
  }
30
30
  if (!this.labels) {
31
31
  // eslint-disable-next-line no-underscore-dangle
32
- this.labels = await this.dataSource._loadColumn(path);
32
+ this.labels = this.dataSource._loadColumn(path);
33
33
  return this.labels;
34
34
  }
35
35
  this.labels = Promise.resolve(null);
@@ -11,13 +11,13 @@ export default class ObsEmbeddingAnndataLoader extends AbstractTwoStepLoader {
11
11
  * Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
12
12
  * @returns {Promise} A promise for an array of columns.
13
13
  */
14
- async loadEmbedding() {
14
+ loadEmbedding() {
15
15
  const { path, dims = [0, 1] } = this.options;
16
16
  if (this.embedding) {
17
17
  return this.embedding;
18
18
  }
19
19
  if (!this.embedding) {
20
- this.embedding = await this.dataSource.loadNumericForDims(path, dims);
20
+ this.embedding = this.dataSource.loadNumericForDims(path, dims);
21
21
  return this.embedding;
22
22
  }
23
23
  this.embedding = Promise.resolve(null);
@@ -11,14 +11,14 @@ export default class ObsLabelsAnndataLoader extends AbstractTwoStepLoader {
11
11
  * Class method for loading observation string labels.
12
12
  * @returns {Promise} A promise for the array.
13
13
  */
14
- async loadLabels() {
14
+ loadLabels() {
15
15
  const { path } = this.options;
16
16
  if (this.labels) {
17
17
  return this.labels;
18
18
  }
19
19
  if (!this.labels) {
20
20
  // eslint-disable-next-line no-underscore-dangle
21
- this.labels = await this.dataSource._loadColumn(path);
21
+ this.labels = this.dataSource._loadColumn(path);
22
22
  return this.labels;
23
23
  }
24
24
  this.labels = Promise.resolve(null);
@@ -11,13 +11,13 @@ export default class ObsLocationsAnndataLoader extends AbstractTwoStepLoader {
11
11
  * Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
12
12
  * @returns {Promise} A promise for an array of columns.
13
13
  */
14
- async loadLocations() {
14
+ loadLocations() {
15
15
  const { path, dims = [0, 1] } = this.options;
16
16
  if (this.locations) {
17
17
  return this.locations;
18
18
  }
19
19
  if (!this.locations) {
20
- this.locations = await this.dataSource.loadNumericForDims(path, dims);
20
+ this.locations = this.dataSource.loadNumericForDims(path, dims);
21
21
  return this.locations;
22
22
  }
23
23
  this.locations = Promise.resolve(null);
@@ -12,13 +12,20 @@ export default class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader
12
12
  * Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
13
13
  * @returns {Promise} A promise for an array of columns.
14
14
  */
15
- async loadSegmentations() {
15
+ loadSegmentations() {
16
16
  const { path } = this.options;
17
17
  if (this.segmentations) {
18
18
  return this.segmentations;
19
19
  }
20
20
  if (!this.segmentations) {
21
- this.segmentations = await this.dataSource.loadNumeric(path);
21
+ this.segmentations = this.dataSource.loadNumeric(path).then(arr => ({
22
+ ...arr,
23
+ // Bug introduced from DeckGL v8.6.x to v8.8.x:
24
+ // Polygon vertices cannot be passed via Uint32Arrays, which is how they load via Zarr.
25
+ // For now, a workaround is to cast each vertex to a plain Array.
26
+ data: arr.data
27
+ .map(poly => poly.map(vertex => Array.from(vertex))),
28
+ }));
22
29
  return this.segmentations;
23
30
  }
24
31
  this.segmentations = Promise.resolve(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/zarr",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -16,12 +16,12 @@
16
16
  "d3-array": "^2.4.0",
17
17
  "lodash": "^4.17.21",
18
18
  "zarr": "0.5.1",
19
- "@vitessce/constants-internal": "2.0.1",
20
- "@vitessce/gl": "2.0.1",
21
- "@vitessce/sets-utils": "2.0.1",
22
- "@vitessce/spatial-utils": "2.0.1",
23
- "@vitessce/utils": "2.0.1",
24
- "@vitessce/vit-s": "2.0.1"
19
+ "@vitessce/constants-internal": "2.0.2",
20
+ "@vitessce/gl": "2.0.2",
21
+ "@vitessce/sets-utils": "2.0.2",
22
+ "@vitessce/spatial-utils": "2.0.2",
23
+ "@vitessce/utils": "2.0.2",
24
+ "@vitessce/vit-s": "2.0.2"
25
25
  },
26
26
  "scripts": {
27
27
  "start": "tsc --watch",