@vitessce/dev 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-41f71afb.js";
2
+ import { B as BaseDecoder } from "./index-70884868.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  class DeflateDecoder extends BaseDecoder {
@@ -1,6 +1,6 @@
1
1
  import React__default from "react";
2
2
  import ReactDOM__default from "react-dom";
3
- import { c as commonjsGlobal, o as objectAssign, g as getDefaultExportFromCjs, e as earcut, b as getAugmentedNamespace } from "./index-41f71afb.js";
3
+ import { c as commonjsGlobal, o as objectAssign, g as getDefaultExportFromCjs, e as earcut, b as getAugmentedNamespace } from "./index-70884868.js";
4
4
  function _mergeNamespaces(n, m) {
5
5
  for (var i = 0; i < m.length; i++) {
6
6
  const e = m[i];
@@ -480,10 +480,10 @@ const COMPONENT_COORDINATION_TYPES = {
480
480
  ]
481
481
  };
482
482
  const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
483
- const version$6 = "3.1.2";
484
- const date$3 = "2023-08-31";
483
+ const version$6 = "3.1.3";
484
+ const date$3 = "2023-09-05";
485
485
  const branch = "changeset-release/main";
486
- const hash$1 = "21819ea1";
486
+ const hash$1 = "daf84518";
487
487
  const META_VERSION = {
488
488
  note,
489
489
  version: version$6,
@@ -168051,16 +168051,16 @@ async function getDecoder(fileDirectory) {
168051
168051
  const Decoder = await importFn();
168052
168052
  return new Decoder(fileDirectory);
168053
168053
  }
168054
- addDecoder([void 0, 1], () => import("./raw-39b8aa6e.js").then((m2) => m2.default));
168055
- addDecoder(5, () => import("./lzw-e9731b91.js").then((m2) => m2.default));
168054
+ addDecoder([void 0, 1], () => import("./raw-4db1ea53.js").then((m2) => m2.default));
168055
+ addDecoder(5, () => import("./lzw-d0821024.js").then((m2) => m2.default));
168056
168056
  addDecoder(6, () => {
168057
168057
  throw new Error("old style JPEG compression is not supported.");
168058
168058
  });
168059
- addDecoder(7, () => import("./jpeg-6ecadf88.js").then((m2) => m2.default));
168060
- addDecoder([8, 32946], () => import("./deflate-f7fd7599.js").then((m2) => m2.default));
168061
- addDecoder(32773, () => import("./packbits-b8e35f8a.js").then((m2) => m2.default));
168062
- addDecoder(34887, () => import("./lerc-6d26ef1a.js").then((m2) => m2.default));
168063
- addDecoder(50001, () => import("./webimage-61366aaa.js").then((m2) => m2.default));
168059
+ addDecoder(7, () => import("./jpeg-526af1dd.js").then((m2) => m2.default));
168060
+ addDecoder([8, 32946], () => import("./deflate-59a045dd.js").then((m2) => m2.default));
168061
+ addDecoder(32773, () => import("./packbits-08036e95.js").then((m2) => m2.default));
168062
+ addDecoder(34887, () => import("./lerc-16a2498e.js").then((m2) => m2.default));
168063
+ addDecoder(50001, () => import("./webimage-c2fac589.js").then((m2) => m2.default));
168064
168064
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
168065
168065
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
168066
168066
  }
@@ -203080,6 +203080,41 @@ function coordinateTransformationsToMatrix(coordinateTransformations, axes) {
203080
203080
  }
203081
203081
  return mat;
203082
203082
  }
203083
+ function normalizeCoordinateTransformations(coordinateTransformations, datasets) {
203084
+ var _a2;
203085
+ let result = [];
203086
+ if (Array.isArray(coordinateTransformations)) {
203087
+ result = coordinateTransformations.map((transform4) => {
203088
+ if (transform4.input && transform4.output) {
203089
+ const { type: type3 } = transform4;
203090
+ if (type3 === "translation") {
203091
+ return {
203092
+ type: type3,
203093
+ translation: transform4.translation
203094
+ };
203095
+ }
203096
+ if (type3 === "scale") {
203097
+ return {
203098
+ type: type3,
203099
+ scale: transform4.scale
203100
+ };
203101
+ }
203102
+ if (type3 === "identity") {
203103
+ return { type: type3 };
203104
+ }
203105
+ console.warn(`Coordinate transformation type "${type3}" is not supported.`);
203106
+ }
203107
+ return transform4;
203108
+ });
203109
+ }
203110
+ if (Array.isArray((_a2 = datasets == null ? void 0 : datasets[0]) == null ? void 0 : _a2.coordinateTransformations)) {
203111
+ result = [
203112
+ ...datasets[0].coordinateTransformations,
203113
+ ...result
203114
+ ];
203115
+ }
203116
+ return result;
203117
+ }
203083
203118
  var shortNumber$1 = { exports: {} };
203084
203119
  (function(module2, exports2) {
203085
203120
  (function(global2, factory2) {
@@ -211224,7 +211259,7 @@ const HIGLASS_BUNDLE_VERSION = "1.11.13";
211224
211259
  const HIGLASS_CSS_URL = `https://unpkg.com/${HIGLASS_PKG_NAME}@${HIGLASS_BUNDLE_VERSION}/dist/hglib.css`;
211225
211260
  register({ dataFetcher: ZarrMultivecDataFetcher, config: ZarrMultivecDataFetcher.config }, { pluginType: "dataFetcher" });
211226
211261
  const LazyHiGlassComponent = React__default.lazy(async () => {
211227
- const { HiGlassComponent } = await import("./hglib-7f00462a.js").then((n3) => n3.h);
211262
+ const { HiGlassComponent } = await import("./hglib-1c23d473.js").then((n3) => n3.h);
211228
211263
  return { default: HiGlassComponent };
211229
211264
  });
211230
211265
  const HG_SIZE = 800;
@@ -270196,7 +270231,6 @@ function hexToRgb(hex2) {
270196
270231
  }
270197
270232
  class OmeZarrLoader extends AbstractTwoStepLoader {
270198
270233
  async load() {
270199
- var _a2, _b;
270200
270234
  const payload = await this.dataSource.getJson(".zattrs").catch((reason) => Promise.resolve(reason));
270201
270235
  if (payload instanceof AbstractLoaderError) {
270202
270236
  return Promise.reject(payload);
@@ -270204,22 +270238,21 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
270204
270238
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
270205
270239
  const loader2 = await loadOmeZarr(this.url, { fetchOptions: this.requestInit, type: "multiscales" });
270206
270240
  const { metadata: metadata2, data: data2 } = loader2;
270207
- const { omero, multiscales } = metadata2;
270208
- if (!omero) {
270209
- console.error("Path for image not valid");
270241
+ const { omero, multiscales, channels_metadata: spatialDataChannels } = metadata2;
270242
+ const isSpatialData = !!spatialDataChannels;
270243
+ if (!isSpatialData && !omero) {
270244
+ console.error("image.ome-zarr must have omero metadata in attributes.");
270210
270245
  return Promise.reject(payload);
270211
270246
  }
270212
270247
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
270213
270248
  console.error("Multiscales array must exist and have at least one element");
270214
270249
  }
270215
- const { coordinateTransformations } = multiscales[0];
270250
+ const { datasets, coordinateTransformations: coordinateTransformationsFromFile, name: imageName } = multiscales[0];
270216
270251
  const axes = getNgffAxes(multiscales[0].axes);
270252
+ const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, datasets);
270217
270253
  const transformMatrixFromOptions = coordinateTransformationsToMatrix(coordinateTransformationsFromOptions, axes);
270218
- const transformMatrixFromFile = coordinateTransformationsToMatrix(coordinateTransformations, axes);
270254
+ const transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, axes);
270219
270255
  const transformMatrix = transformMatrixFromFile.multiplyLeft(transformMatrixFromOptions);
270220
- const { rdefs, channels: channels2, name: omeroName } = omero;
270221
- const t4 = (_a2 = rdefs.defaultT) != null ? _a2 : 0;
270222
- const z2 = (_b = rdefs.defaultZ) != null ? _b : 0;
270223
270256
  const filterSelection = (sel) => {
270224
270257
  if (data2.length > 0) {
270225
270258
  const nextSel = {};
@@ -270233,14 +270266,37 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
270233
270266
  }
270234
270267
  return sel;
270235
270268
  };
270269
+ let channelObjects;
270270
+ let channelLabels = [];
270271
+ let initialTargetT = 0;
270272
+ let initialTargetZ = 0;
270273
+ if (isSpatialData) {
270274
+ const { channels: channels2 } = spatialDataChannels;
270275
+ channelObjects = channels2.map((channel, i2) => ({
270276
+ selection: filterSelection({ z: initialTargetZ, t: initialTargetT, c: i2 }),
270277
+ slider: [0, 255],
270278
+ color: [255, 255, 255]
270279
+ }));
270280
+ channelLabels = channels2.map((c2) => c2.label);
270281
+ } else {
270282
+ const { rdefs, channels: channels2 } = omero;
270283
+ if (typeof rdefs.defaultT === "number") {
270284
+ initialTargetT = rdefs.defaultT;
270285
+ }
270286
+ if (typeof rdefs.defaultZ === "number") {
270287
+ initialTargetZ = rdefs.defaultZ;
270288
+ }
270289
+ channelObjects = channels2.map((channel, i2) => ({
270290
+ selection: filterSelection({ z: initialTargetZ, t: initialTargetT, c: i2 }),
270291
+ slider: [channel.window.start, channel.window.end],
270292
+ color: hexToRgb(channel.color)
270293
+ }));
270294
+ channelLabels = channels2.map((c2) => c2.label);
270295
+ }
270236
270296
  const imagesWithLoaderCreators = [
270237
270297
  {
270238
- name: omeroName || "Image",
270239
- channels: channels2.map((channel, i2) => ({
270240
- selection: filterSelection({ z: z2, t: t4, c: i2 }),
270241
- slider: [channel.window.start, channel.window.end],
270242
- color: hexToRgb(channel.color)
270243
- })),
270298
+ name: imageName || "Image",
270299
+ channels: channelObjects,
270244
270300
  ...transformMatrix ? {
270245
270301
  metadata: {
270246
270302
  transform: {
@@ -270248,7 +270304,7 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
270248
270304
  }
270249
270305
  }
270250
270306
  } : {},
270251
- loaderCreator: async () => ({ ...loader2, channels: channels2.map((c2) => c2.label) })
270307
+ loaderCreator: async () => ({ ...loader2, channels: channelLabels })
270252
270308
  }
270253
270309
  ];
270254
270310
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = await initializeRasterLayersAndChannels(imagesWithLoaderCreators, void 0);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C, D, F, H, m, h, q, P, r, p, V, n, i, f, d, k, l, j, v, z } from "./index-41f71afb.js";
1
+ import { C, D, F, H, m, h, q, P, r, p, V, n, i, f, d, k, l, j, v, z } from "./index-70884868.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-41f71afb.js";
1
+ import { B as BaseDecoder } from "./index-70884868.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const dctZigZag = new Int32Array([
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-41f71afb.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-70884868.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  var LercDecode = { exports: {} };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-41f71afb.js";
1
+ import { B as BaseDecoder } from "./index-70884868.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const MIN_BITS = 9;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-41f71afb.js";
1
+ import { B as BaseDecoder } from "./index-70884868.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  class PackbitsDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-41f71afb.js";
1
+ import { B as BaseDecoder } from "./index-70884868.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  class RawDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-41f71afb.js";
1
+ import { B as BaseDecoder } from "./index-70884868.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  class WebImageDecoder extends BaseDecoder {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/dev",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -16,10 +16,10 @@
16
16
  "dist-tsc"
17
17
  ],
18
18
  "dependencies": {
19
- "@vitessce/all": "3.1.2",
20
- "@vitessce/config": "3.1.2",
21
- "@vitessce/constants": "3.1.2",
22
- "@vitessce/export-utils": "3.1.2"
19
+ "@vitessce/all": "3.1.3",
20
+ "@vitessce/config": "3.1.3",
21
+ "@vitessce/constants": "3.1.3",
22
+ "@vitessce/export-utils": "3.1.3"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@vitejs/plugin-react": "^4.0.0",