@vitessce/zarr 3.2.0 → 3.2.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.
- package/dist/{deflate-2b2b285b.js → deflate-f2b94bed.js} +1 -1
- package/dist/{index-9ae02eab.js → index-11e344fb.js} +118 -28
- package/dist/index.js +1 -1
- package/dist/{jpeg-af2abb26.js → jpeg-f5f84485.js} +1 -1
- package/dist/{lerc-ac5abe1c.js → lerc-2dbc6d98.js} +1 -1
- package/dist/{lzw-b264d65a.js → lzw-88a53998.js} +1 -1
- package/dist/{packbits-58bf813f.js → packbits-93df2294.js} +1 -1
- package/dist/{raw-4015af9c.js → raw-53282bb2.js} +1 -1
- package/dist/{webimage-d31de7e9.js → webimage-9f58dd5d.js} +1 -1
- package/package.json +8 -8
|
@@ -142296,16 +142296,16 @@ function addDecoder(cases, importFn) {
|
|
|
142296
142296
|
}
|
|
142297
142297
|
cases.forEach((c) => registry.set(c, importFn));
|
|
142298
142298
|
}
|
|
142299
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
142300
|
-
addDecoder(5, () => import("./lzw-
|
|
142299
|
+
addDecoder([void 0, 1], () => import("./raw-53282bb2.js").then((m) => m.default));
|
|
142300
|
+
addDecoder(5, () => import("./lzw-88a53998.js").then((m) => m.default));
|
|
142301
142301
|
addDecoder(6, () => {
|
|
142302
142302
|
throw new Error("old style JPEG compression is not supported.");
|
|
142303
142303
|
});
|
|
142304
|
-
addDecoder(7, () => import("./jpeg-
|
|
142305
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
142306
|
-
addDecoder(32773, () => import("./packbits-
|
|
142307
|
-
addDecoder(34887, () => import("./lerc-
|
|
142308
|
-
addDecoder(50001, () => import("./webimage-
|
|
142304
|
+
addDecoder(7, () => import("./jpeg-f5f84485.js").then((m) => m.default));
|
|
142305
|
+
addDecoder([8, 32946], () => import("./deflate-f2b94bed.js").then((m) => m.default));
|
|
142306
|
+
addDecoder(32773, () => import("./packbits-93df2294.js").then((m) => m.default));
|
|
142307
|
+
addDecoder(34887, () => import("./lerc-2dbc6d98.js").then((m) => m.default));
|
|
142308
|
+
addDecoder(50001, () => import("./webimage-9f58dd5d.js").then((m) => m.default));
|
|
142309
142309
|
function decodeRowAcc(row, stride) {
|
|
142310
142310
|
let length2 = row.length - stride;
|
|
142311
142311
|
let offset = 0;
|
|
@@ -146128,6 +146128,67 @@ function makeBoundingBox(viewState) {
|
|
|
146128
146128
|
viewport.unproject([0, viewport.height])
|
|
146129
146129
|
];
|
|
146130
146130
|
}
|
|
146131
|
+
const TARGETS = [1, 2, 3, 4, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1e3];
|
|
146132
|
+
const MIN_TARGET = TARGETS[0];
|
|
146133
|
+
const MAX_TARGET = TARGETS[TARGETS.length - 1];
|
|
146134
|
+
const SI_PREFIXES = [
|
|
146135
|
+
{ symbol: "Y", exponent: 24 },
|
|
146136
|
+
{ symbol: "Z", exponent: 21 },
|
|
146137
|
+
{ symbol: "E", exponent: 18 },
|
|
146138
|
+
{ symbol: "P", exponent: 15 },
|
|
146139
|
+
{ symbol: "T", exponent: 12 },
|
|
146140
|
+
{ symbol: "G", exponent: 9 },
|
|
146141
|
+
{ symbol: "M", exponent: 6 },
|
|
146142
|
+
{ symbol: "k", exponent: 3 },
|
|
146143
|
+
{ symbol: "h", exponent: 2 },
|
|
146144
|
+
{ symbol: "da", exponent: 1 },
|
|
146145
|
+
{ symbol: "", exponent: 0 },
|
|
146146
|
+
{ symbol: "d", exponent: -1 },
|
|
146147
|
+
{ symbol: "c", exponent: -2 },
|
|
146148
|
+
{ symbol: "m", exponent: -3 },
|
|
146149
|
+
{ symbol: "µ", exponent: -6 },
|
|
146150
|
+
{ symbol: "n", exponent: -9 },
|
|
146151
|
+
{ symbol: "p", exponent: -12 },
|
|
146152
|
+
{ symbol: "f", exponent: -15 },
|
|
146153
|
+
{ symbol: "a", exponent: -18 },
|
|
146154
|
+
{ symbol: "z", exponent: -21 },
|
|
146155
|
+
{ symbol: "y", exponent: -24 }
|
|
146156
|
+
];
|
|
146157
|
+
function sizeToMeters(size2, unit2) {
|
|
146158
|
+
if (!unit2 || unit2 === "m") {
|
|
146159
|
+
return size2;
|
|
146160
|
+
}
|
|
146161
|
+
if (unit2.length > 1) {
|
|
146162
|
+
let unitPrefix = unit2.substring(0, unit2.length - 1);
|
|
146163
|
+
if (unitPrefix === "u") {
|
|
146164
|
+
unitPrefix = "µ";
|
|
146165
|
+
}
|
|
146166
|
+
const unitObj = SI_PREFIXES.find((p) => p.symbol === unitPrefix);
|
|
146167
|
+
if (unitObj) {
|
|
146168
|
+
return size2 * 10 ** unitObj.exponent;
|
|
146169
|
+
}
|
|
146170
|
+
}
|
|
146171
|
+
throw new Error("Received unknown unit");
|
|
146172
|
+
}
|
|
146173
|
+
function snapValue(value) {
|
|
146174
|
+
let magnitude = 0;
|
|
146175
|
+
if (value < MIN_TARGET || value > MAX_TARGET) {
|
|
146176
|
+
magnitude = Math.floor(Math.log10(value));
|
|
146177
|
+
}
|
|
146178
|
+
let snappedUnit = SI_PREFIXES.find(
|
|
146179
|
+
(p) => p.exponent % 3 === 0 && p.exponent <= magnitude
|
|
146180
|
+
);
|
|
146181
|
+
let adjustedValue = value / 10 ** snappedUnit.exponent;
|
|
146182
|
+
if (adjustedValue > 500 && adjustedValue <= 1e3) {
|
|
146183
|
+
snappedUnit = SI_PREFIXES.find(
|
|
146184
|
+
(p) => p.exponent % 3 === 0 && p.exponent <= magnitude + 3
|
|
146185
|
+
);
|
|
146186
|
+
adjustedValue = value / 10 ** snappedUnit.exponent;
|
|
146187
|
+
}
|
|
146188
|
+
const targetNewUnits = TARGETS.find((t2) => t2 > adjustedValue);
|
|
146189
|
+
const targetOrigUnits = targetNewUnits * 10 ** snappedUnit.exponent;
|
|
146190
|
+
return [targetOrigUnits, targetNewUnits, snappedUnit.symbol];
|
|
146191
|
+
}
|
|
146131
146192
|
const fs$1$1 = `#define SHADER_NAME xr-layer-fragment-shader
|
|
146132
146193
|
|
|
146133
146194
|
precision highp float;
|
|
@@ -146895,26 +146956,27 @@ const OverviewLayer = class extends CompositeLayer {
|
|
|
146895
146956
|
OverviewLayer.layerName = "OverviewLayer";
|
|
146896
146957
|
OverviewLayer.defaultProps = defaultProps$3;
|
|
146897
146958
|
function getPosition(boundingBox, position, length2) {
|
|
146898
|
-
const
|
|
146959
|
+
const viewWidth = boundingBox[2][0] - boundingBox[0][0];
|
|
146960
|
+
const viewHeight = boundingBox[2][1] - boundingBox[0][1];
|
|
146899
146961
|
switch (position) {
|
|
146900
146962
|
case "bottom-right": {
|
|
146901
|
-
const yCoord = boundingBox[2][1] -
|
|
146902
|
-
const xLeftCoord = boundingBox[2][0] -
|
|
146963
|
+
const yCoord = boundingBox[2][1] - viewHeight * length2;
|
|
146964
|
+
const xLeftCoord = boundingBox[2][0] - viewWidth * length2;
|
|
146903
146965
|
return [yCoord, xLeftCoord];
|
|
146904
146966
|
}
|
|
146905
146967
|
case "top-right": {
|
|
146906
|
-
const yCoord =
|
|
146907
|
-
const xLeftCoord = boundingBox[2][0] -
|
|
146968
|
+
const yCoord = boundingBox[0][1] + viewHeight * length2;
|
|
146969
|
+
const xLeftCoord = boundingBox[2][0] - viewWidth * length2;
|
|
146908
146970
|
return [yCoord, xLeftCoord];
|
|
146909
146971
|
}
|
|
146910
146972
|
case "top-left": {
|
|
146911
|
-
const yCoord =
|
|
146912
|
-
const xLeftCoord =
|
|
146973
|
+
const yCoord = boundingBox[0][1] + viewHeight * length2;
|
|
146974
|
+
const xLeftCoord = boundingBox[0][0] + viewWidth * length2;
|
|
146913
146975
|
return [yCoord, xLeftCoord];
|
|
146914
146976
|
}
|
|
146915
146977
|
case "bottom-left": {
|
|
146916
|
-
const yCoord = boundingBox[2][1] -
|
|
146917
|
-
const xLeftCoord =
|
|
146978
|
+
const yCoord = boundingBox[2][1] - viewHeight * length2;
|
|
146979
|
+
const xLeftCoord = boundingBox[0][0] + viewWidth * length2;
|
|
146918
146980
|
return [yCoord, xLeftCoord];
|
|
146919
146981
|
}
|
|
146920
146982
|
default: {
|
|
@@ -146932,11 +146994,12 @@ const defaultProps$2 = {
|
|
|
146932
146994
|
unit: { type: "string", value: "", compare: true },
|
|
146933
146995
|
size: { type: "number", value: 1, compare: true },
|
|
146934
146996
|
position: { type: "string", value: "bottom-right", compare: true },
|
|
146935
|
-
length: { type: "number", value: 0.085, compare: true }
|
|
146997
|
+
length: { type: "number", value: 0.085, compare: true },
|
|
146998
|
+
snap: { type: "boolean", value: false, compare: true }
|
|
146936
146999
|
};
|
|
146937
147000
|
const ScaleBarLayer = class extends CompositeLayer {
|
|
146938
147001
|
renderLayers() {
|
|
146939
|
-
const { id, unit: unit2, size: size2, position, viewState, length: length2 } = this.props;
|
|
147002
|
+
const { id, unit: unit2, size: size2, position, viewState, length: length2, snap } = this.props;
|
|
146940
147003
|
const boundingBox = makeBoundingBox(viewState);
|
|
146941
147004
|
const { zoom } = viewState;
|
|
146942
147005
|
const viewLength = boundingBox[2][0] - boundingBox[0][0];
|
|
@@ -146945,15 +147008,27 @@ const ScaleBarLayer = class extends CompositeLayer {
|
|
|
146945
147008
|
2 ** (-zoom + 1.5),
|
|
146946
147009
|
(boundingBox[2][1] - boundingBox[0][1]) * 7e-3
|
|
146947
147010
|
);
|
|
146948
|
-
|
|
147011
|
+
let adjustedBarLength = barLength;
|
|
147012
|
+
let displayNumber = (barLength * size2).toPrecision(5);
|
|
147013
|
+
let displayUnit = unit2;
|
|
147014
|
+
if (snap) {
|
|
147015
|
+
const meterSize = sizeToMeters(size2, unit2);
|
|
147016
|
+
const numUnits = barLength * meterSize;
|
|
147017
|
+
const [snappedOrigUnits, snappedNewUnits, snappedUnitPrefix] = snapValue(numUnits);
|
|
147018
|
+
adjustedBarLength = snappedOrigUnits / meterSize;
|
|
147019
|
+
displayNumber = snappedNewUnits;
|
|
147020
|
+
displayUnit = `${snappedUnitPrefix}m`;
|
|
147021
|
+
}
|
|
146949
147022
|
const [yCoord, xLeftCoord] = getPosition(boundingBox, position, length2);
|
|
147023
|
+
const xRightCoord = xLeftCoord + barLength;
|
|
147024
|
+
const isLeft = position.endsWith("-left");
|
|
146950
147025
|
const lengthBar = new LineLayer({
|
|
146951
147026
|
id: `scale-bar-length-${id}`,
|
|
146952
147027
|
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
146953
147028
|
data: [
|
|
146954
147029
|
[
|
|
146955
|
-
[xLeftCoord, yCoord],
|
|
146956
|
-
[xLeftCoord +
|
|
147030
|
+
[isLeft ? xLeftCoord : xRightCoord - adjustedBarLength, yCoord],
|
|
147031
|
+
[isLeft ? xLeftCoord + adjustedBarLength : xRightCoord, yCoord]
|
|
146957
147032
|
]
|
|
146958
147033
|
],
|
|
146959
147034
|
getSourcePosition: (d) => d[0],
|
|
@@ -146966,8 +147041,14 @@ const ScaleBarLayer = class extends CompositeLayer {
|
|
|
146966
147041
|
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
146967
147042
|
data: [
|
|
146968
147043
|
[
|
|
146969
|
-
[
|
|
146970
|
-
|
|
147044
|
+
[
|
|
147045
|
+
isLeft ? xLeftCoord : xRightCoord - adjustedBarLength,
|
|
147046
|
+
yCoord - barHeight
|
|
147047
|
+
],
|
|
147048
|
+
[
|
|
147049
|
+
isLeft ? xLeftCoord : xRightCoord - adjustedBarLength,
|
|
147050
|
+
yCoord + barHeight
|
|
147051
|
+
]
|
|
146971
147052
|
]
|
|
146972
147053
|
],
|
|
146973
147054
|
getSourcePosition: (d) => d[0],
|
|
@@ -146980,8 +147061,14 @@ const ScaleBarLayer = class extends CompositeLayer {
|
|
|
146980
147061
|
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
146981
147062
|
data: [
|
|
146982
147063
|
[
|
|
146983
|
-
[
|
|
146984
|
-
|
|
147064
|
+
[
|
|
147065
|
+
isLeft ? xLeftCoord + adjustedBarLength : xRightCoord,
|
|
147066
|
+
yCoord - barHeight
|
|
147067
|
+
],
|
|
147068
|
+
[
|
|
147069
|
+
isLeft ? xLeftCoord + adjustedBarLength : xRightCoord,
|
|
147070
|
+
yCoord + barHeight
|
|
147071
|
+
]
|
|
146985
147072
|
]
|
|
146986
147073
|
],
|
|
146987
147074
|
getSourcePosition: (d) => d[0],
|
|
@@ -146994,8 +147081,11 @@ const ScaleBarLayer = class extends CompositeLayer {
|
|
|
146994
147081
|
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
146995
147082
|
data: [
|
|
146996
147083
|
{
|
|
146997
|
-
text:
|
|
146998
|
-
position: [
|
|
147084
|
+
text: `${displayNumber}${displayUnit}`,
|
|
147085
|
+
position: [
|
|
147086
|
+
isLeft ? xLeftCoord + barLength * 0.5 : xRightCoord - barLength * 0.5,
|
|
147087
|
+
yCoord + barHeight * 4
|
|
147088
|
+
]
|
|
146999
147089
|
}
|
|
147000
147090
|
],
|
|
147001
147091
|
getColor: [220, 220, 220, 255],
|
|
@@ -147004,7 +147094,7 @@ const ScaleBarLayer = class extends CompositeLayer {
|
|
|
147004
147094
|
sizeUnits: "meters",
|
|
147005
147095
|
sizeScale: 2 ** -zoom,
|
|
147006
147096
|
characterSet: [
|
|
147007
|
-
...
|
|
147097
|
+
...displayUnit.split(""),
|
|
147008
147098
|
...range(10).map((i2) => String(i2)),
|
|
147009
147099
|
".",
|
|
147010
147100
|
"e",
|
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-11e344fb.js";
|
|
3
3
|
import "@vitessce/vit-s";
|
|
4
4
|
import "react";
|
|
5
5
|
const LercParameters = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/zarr",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"d3-array": "^2.4.0",
|
|
20
20
|
"lodash-es": "^4.17.21",
|
|
21
21
|
"zarr": "0.5.1",
|
|
22
|
-
"@vitessce/constants-internal": "3.2.
|
|
23
|
-
"@vitessce/gl": "3.2.
|
|
24
|
-
"@vitessce/sets-utils": "3.2.
|
|
25
|
-
"@vitessce/spatial-utils": "3.2.
|
|
26
|
-
"@vitessce/image-utils": "3.2.
|
|
27
|
-
"@vitessce/utils": "3.2.
|
|
28
|
-
"@vitessce/vit-s": "3.2.
|
|
22
|
+
"@vitessce/constants-internal": "3.2.2",
|
|
23
|
+
"@vitessce/gl": "3.2.2",
|
|
24
|
+
"@vitessce/sets-utils": "3.2.2",
|
|
25
|
+
"@vitessce/spatial-utils": "3.2.2",
|
|
26
|
+
"@vitessce/image-utils": "3.2.2",
|
|
27
|
+
"@vitessce/utils": "3.2.2",
|
|
28
|
+
"@vitessce/vit-s": "3.2.2"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|