@biongff/vizarr 1.0.1 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.1](https://github.com/BioNGFF/vizarr/compare/v1.1.0...v1.1.1) (2025-11-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * zipfilestore import ([58ead65](https://github.com/BioNGFF/vizarr/commit/58ead65c09aaabcfa2d944f9cb7e575c2e39365d))
9
+
10
+ # [1.1.0](https://github.com/BioNGFF/vizarr/compare/v1.0.1...v1.1.0) (2025-11-14)
11
+
12
+
13
+ ### Features
14
+
15
+ * try zarrita ZipFileStore ([ae5d6a7](https://github.com/BioNGFF/vizarr/commit/ae5d6a72875cc5df5839d32ca4d78ce6047ccf36))
16
+
3
17
  ## [1.0.1](https://github.com/BioNGFF/vizarr/compare/v1.0.0...v1.0.1) (2025-11-12)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biongff/vizarr",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@deck.gl/core": "~9.0.0",
@@ -12,7 +12,7 @@
12
12
  "@mui/icons-material": "^7.2.0",
13
13
  "@mui/material": "^7.2.0",
14
14
  "@vivjs/types": "~0.17.0",
15
- "@zarrita/storage": "0.1.0",
15
+ "@zarrita/storage": "0.1.3",
16
16
  "deck.gl": "~9.0.0",
17
17
  "jotai": "^1.0.0",
18
18
  "just-debounce-it": "^3.1.1",
package/src/utils.ts CHANGED
@@ -2,6 +2,7 @@ import { Matrix4 } from "math.gl";
2
2
  import * as zarr from "zarrita";
3
3
 
4
4
  import type * as viv from "@vivjs/types";
5
+ import ZipFileStore from "@zarrita/storage/zip";
5
6
  import type { ZarrPixelSource } from "./ZarrPixelSource";
6
7
  import type { GridLayerProps } from "./layers/grid-layer";
7
8
  import type { LabelLayerProps } from "./layers/label-layer";
@@ -37,11 +38,18 @@ async function normalizeStore(source: string | zarr.Readable): Promise<zarr.Loca
37
38
  ]);
38
39
  store = ReferenceStore.fromSpec(json);
39
40
  } else {
40
- const url = new URL(source);
41
- // grab the path and then set the URL to the root
42
- path = ensureAbosolutePath(url.pathname);
43
- url.pathname = "/";
44
- store = new zarr.FetchStore(url.href);
41
+ // try ZipFileStore first, fallback to FetchStore
42
+ try {
43
+ const zipStore = ZipFileStore.fromUrl(source);
44
+ await zipStore.has("/"); // will throw an error for non-zipped
45
+ store = zipStore;
46
+ } catch {
47
+ const url = new URL(source);
48
+ // grab the path and then set the URL to the root
49
+ path = ensureAbosolutePath(url.pathname);
50
+ url.pathname = "/";
51
+ store = new zarr.FetchStore(url.href);
52
+ }
45
53
  }
46
54
 
47
55
  // Wrap remote stores in a cache