@vitessce/json 3.3.0 → 3.3.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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-7fde58f2.js";
2
+ import { B as BaseDecoder } from "./index-c9e50f8e.js";
3
3
  import "@vitessce/vit-s";
4
4
  import "react";
5
5
  class DeflateDecoder extends BaseDecoder {
@@ -38985,7 +38985,7 @@ const jsonLoader = {
38985
38985
  testText: isJSON,
38986
38986
  parseTextSync: JSON.parse
38987
38987
  };
38988
- const version = "8.8.20";
38988
+ const version = "8.8.27";
38989
38989
  const existingVersion = globalThis.deck && globalThis.deck.VERSION;
38990
38990
  if (existingVersion && existingVersion !== version) {
38991
38991
  throw new Error("deck.gl - multiple versions detected: ".concat(existingVersion, " vs ").concat(version));
@@ -40184,9 +40184,8 @@ function cssToDeviceRatio(gl) {
40184
40184
  luma
40185
40185
  } = gl;
40186
40186
  if (gl.canvas && luma) {
40187
- const {
40188
- clientWidth
40189
- } = luma.canvasSizeInfo;
40187
+ const cachedSize = luma.canvasSizeInfo;
40188
+ const clientWidth = "clientWidth" in cachedSize ? cachedSize.clientWidth : gl.canvas.clientWidth;
40190
40189
  return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;
40191
40190
  }
40192
40191
  return 1;
@@ -40442,7 +40441,7 @@ function setDevicePixelRatio(gl, devicePixelRatio, options) {
40442
40441
  });
40443
40442
  }
40444
40443
  }
40445
- const VERSION$7 = "8.5.16";
40444
+ const VERSION$7 = "8.5.21";
40446
40445
  const STARTUP_MESSAGE = "set luma.log.level=1 (or higher) to trace rendering";
40447
40446
  class StatsManager {
40448
40447
  constructor() {
@@ -40563,7 +40562,6 @@ let Resource$1 = class Resource {
40563
40562
  this._handle = this._createHandle();
40564
40563
  }
40565
40564
  this.byteLength = 0;
40566
- this._initStats();
40567
40565
  this._addStats();
40568
40566
  }
40569
40567
  toString() {
@@ -40699,9 +40697,6 @@ let Resource$1 = class Resource {
40699
40697
  this.gl.luma = this.gl.luma || {};
40700
40698
  return this.gl.luma;
40701
40699
  }
40702
- _initStats() {
40703
- this.gl.stats = this.gl.stats || new StatsManager();
40704
- }
40705
40700
  _addStats() {
40706
40701
  const name2 = this[Symbol.toStringTag];
40707
40702
  const stats = lumaStats.get("Resource Counts");
@@ -40716,27 +40711,29 @@ let Resource$1 = class Resource {
40716
40711
  }
40717
40712
  _trackAllocatedMemory(bytes) {
40718
40713
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
40719
- this._doTrackAllocatedMemory(bytes, name2);
40720
- this._doTrackAllocatedMemory(bytes, name2, this.gl.stats.get("Memory Usage"));
40714
+ this._trackAllocatedMemoryForContext(bytes, name2);
40715
+ this._trackAllocatedMemoryForContext(bytes, name2, this.gl.canvas && this.gl.canvas.id);
40716
+ this.byteLength = bytes;
40721
40717
  }
40722
- _doTrackAllocatedMemory(bytes) {
40718
+ _trackAllocatedMemoryForContext(bytes) {
40723
40719
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
40724
- let stats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lumaStats.get("Memory Usage");
40720
+ let id = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
40721
+ const stats = lumaStats.get("Memory Usage".concat(id));
40725
40722
  stats.get("GPU Memory").addCount(bytes);
40726
40723
  stats.get("".concat(name2, " Memory")).addCount(bytes);
40727
- this.byteLength = bytes;
40728
40724
  }
40729
40725
  _trackDeallocatedMemory() {
40730
40726
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
40731
- this._doTrackDeallocatedMemory(name2);
40732
- this._doTrackDeallocatedMemory(name2, this.gl.stats.get("Memory Usage"));
40727
+ this._trackDeallocatedMemoryForContext(name2);
40728
+ this._trackDeallocatedMemoryForContext(name2, this.gl.canvas && this.gl.canvas.id);
40729
+ this.byteLength = 0;
40733
40730
  }
40734
- _doTrackDeallocatedMemory() {
40731
+ _trackDeallocatedMemoryForContext() {
40735
40732
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
40736
- let stats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : lumaStats.get("Memory Usage");
40733
+ let id = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
40734
+ const stats = lumaStats.get("Memory Usage".concat(id));
40737
40735
  stats.get("GPU Memory").subtractCount(this.byteLength);
40738
40736
  stats.get("".concat(name2, " Memory")).subtractCount(this.byteLength);
40739
- this.byteLength = 0;
40740
40737
  }
40741
40738
  };
40742
40739
  const ERR_TYPE_DEDUCTION = "Failed to deduce GL constant from typed array";
@@ -50351,6 +50348,7 @@ const picking = {
50351
50348
  inject: {
50352
50349
  "vs:DECKGL_FILTER_GL_POSITION": "\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n ",
50353
50350
  "vs:DECKGL_FILTER_COLOR": "\n picking_setPickingColor(geometry.pickingColor);\n ",
50351
+ "fs:#decl": "\nuniform bool picking_uAttribute;\n ",
50354
50352
  "fs:DECKGL_FILTER_COLOR": {
50355
50353
  order: 99,
50356
50354
  injection: "\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "
@@ -51161,6 +51159,9 @@ class Viewport {
51161
51159
  this.projectFlat = this.projectFlat.bind(this);
51162
51160
  this.unprojectFlat = this.unprojectFlat.bind(this);
51163
51161
  }
51162
+ get subViewports() {
51163
+ return null;
51164
+ }
51164
51165
  get metersPerPixel() {
51165
51166
  return this.distanceScales.metersPerUnit[2] / this.scale;
51166
51167
  }
@@ -60052,7 +60053,7 @@ class Attribute extends DataColumn {
60052
60053
  const {
60053
60054
  startIndices
60054
60055
  } = this;
60055
- const vertexIndex = startIndices ? startIndices[row] : row;
60056
+ const vertexIndex = startIndices ? row < startIndices.length ? startIndices[row] : this.numInstances : row;
60056
60057
  return vertexIndex * this.size;
60057
60058
  }
60058
60059
  getShaderAttributes() {
@@ -62696,7 +62697,7 @@ class Layer extends Component {
62696
62697
  if (Array.isArray(highlightColor)) {
62697
62698
  parameters.pickingHighlightColor = highlightColor;
62698
62699
  }
62699
- if (Number.isInteger(highlightedObjectIndex)) {
62700
+ if (forceUpdate || highlightedObjectIndex !== oldProps.highlightedObjectIndex) {
62700
62701
  parameters.pickingSelectedColor = Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0 ? this.encodePickingColor(highlightedObjectIndex) : null;
62701
62702
  }
62702
62703
  this.setModuleParameters(parameters);
@@ -64059,7 +64060,7 @@ function interpolateQuad(quad, ut, vt) {
64059
64060
  }
64060
64061
  const vs$g = "\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy + project_uCommonOrigin.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n";
64061
64062
  const packUVsIntoRGB = "\nvec3 packUVsIntoRGB(vec2 uv) {\n // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n vec2 uv8bit = floor(uv * 256.);\n\n // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n // Scale and clamp to 0-1 range\n vec2 uvFraction = fract(uv * 256.);\n vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n return vec3(uv8bit, fractions) / 255.;\n}\n";
64062
- const fs$i = "\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n return mix(transparentColor, vec4(color, 1.0), alpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n".concat(packUVsIntoRGB, "\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive) {\n // Since instance information is not used, we can use picking color for pixel index\n gl_FragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n");
64063
+ const fs$i = "\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n return mix(transparentColor, vec4(color, 1.0), alpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n".concat(packUVsIntoRGB, "\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive && !picking_uAttribute) {\n // Since instance information is not used, we can use picking color for pixel index\n gl_FragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n");
64063
64064
  const defaultProps$I = {
64064
64065
  image: {
64065
64066
  type: "image",
@@ -72199,18 +72200,22 @@ function getBoundingBox(viewport, zRange, extent2) {
72199
72200
  }
72200
72201
  function getCullBounds({
72201
72202
  viewport,
72202
- z: z2,
72203
+ z: z2 = 0,
72203
72204
  cullRect
72204
72205
  }) {
72205
- const x2 = cullRect.x - viewport.x;
72206
- const y2 = cullRect.y - viewport.y;
72207
- const {
72208
- width,
72209
- height
72210
- } = cullRect;
72206
+ const subViewports = viewport.subViewports || [viewport];
72207
+ return subViewports.map((v) => getCullBoundsInViewport(v, z2, cullRect));
72208
+ }
72209
+ function getCullBoundsInViewport(viewport, z2, cullRect) {
72211
72210
  if (!Array.isArray(z2)) {
72211
+ const x2 = cullRect.x - viewport.x;
72212
+ const y2 = cullRect.y - viewport.y;
72213
+ const {
72214
+ width,
72215
+ height
72216
+ } = cullRect;
72212
72217
  const unprojectOption = {
72213
- targetZ: z2 || 0
72218
+ targetZ: z2
72214
72219
  };
72215
72220
  const topLeft = viewport.unproject([x2, y2], unprojectOption);
72216
72221
  const topRight = viewport.unproject([x2 + width, y2], unprojectOption);
@@ -72218,16 +72223,8 @@ function getCullBounds({
72218
72223
  const bottomRight = viewport.unproject([x2 + width, y2 + height], unprojectOption);
72219
72224
  return [Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]), Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]), Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]), Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1])];
72220
72225
  }
72221
- const bounds0 = getCullBounds({
72222
- viewport,
72223
- z: z2[0],
72224
- cullRect
72225
- });
72226
- const bounds1 = getCullBounds({
72227
- viewport,
72228
- z: z2[1],
72229
- cullRect
72230
- });
72226
+ const bounds0 = getCullBoundsInViewport(viewport, z2[0], cullRect);
72227
+ const bounds1 = getCullBoundsInViewport(viewport, z2[1], cullRect);
72231
72228
  return [Math.min(bounds0[0], bounds1[0]), Math.min(bounds0[1], bounds1[1]), Math.max(bounds0[2], bounds1[2]), Math.max(bounds0[3], bounds1[3])];
72232
72229
  }
72233
72230
  function getIndexingCoords(bbox2, scale2, modelMatrixInverse) {
@@ -72457,7 +72454,7 @@ class Tileset2D {
72457
72454
  return false;
72458
72455
  }
72459
72456
  if (cullRect && this._viewport) {
72460
- const [minX, minY, maxX, maxY] = getCullBounds({
72457
+ const boundsArr = this._getCullBounds({
72461
72458
  viewport: this._viewport,
72462
72459
  z: this._zRange,
72463
72460
  cullRect
@@ -72465,12 +72462,20 @@ class Tileset2D {
72465
72462
  const {
72466
72463
  bbox: bbox2
72467
72464
  } = tile;
72468
- if ("west" in bbox2) {
72469
- return bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
72465
+ for (const [minX, minY, maxX, maxY] of boundsArr) {
72466
+ let overlaps;
72467
+ if ("west" in bbox2) {
72468
+ overlaps = bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
72469
+ } else {
72470
+ const y02 = Math.min(bbox2.top, bbox2.bottom);
72471
+ const y12 = Math.max(bbox2.top, bbox2.bottom);
72472
+ overlaps = bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
72473
+ }
72474
+ if (overlaps) {
72475
+ return true;
72476
+ }
72470
72477
  }
72471
- const y02 = Math.min(bbox2.top, bbox2.bottom);
72472
- const y12 = Math.max(bbox2.top, bbox2.bottom);
72473
- return bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
72478
+ return false;
72474
72479
  }
72475
72480
  return true;
72476
72481
  }
@@ -72919,14 +72924,19 @@ class TileLayer extends CompositeLayer {
72919
72924
  info,
72920
72925
  sourceLayer
72921
72926
  }) {
72927
+ const sourceTile = sourceLayer.props.tile;
72922
72928
  if (info.picked) {
72923
- info.tile = sourceLayer.props.tile;
72929
+ info.tile = sourceTile;
72924
72930
  }
72931
+ info.sourceTile = sourceTile;
72925
72932
  return info;
72926
72933
  }
72927
72934
  _updateAutoHighlight(info) {
72928
- if (info.sourceLayer) {
72929
- info.sourceLayer.updateAutoHighlight(info);
72935
+ const sourceTile = info.sourceTile;
72936
+ if (sourceTile && sourceTile.layers) {
72937
+ for (const layer of sourceTile.layers) {
72938
+ layer.updateAutoHighlight(info);
72939
+ }
72930
72940
  }
72931
72941
  }
72932
72942
  renderLayers() {
@@ -85244,6 +85254,9 @@ class ScenegraphNode {
85244
85254
  toString() {
85245
85255
  return "{type: ScenegraphNode, id: ".concat(this.id, ")}");
85246
85256
  }
85257
+ getBounds() {
85258
+ return null;
85259
+ }
85247
85260
  setPosition(position) {
85248
85261
  assert$7(position.length === 3, "setPosition requires vector argument");
85249
85262
  this.position = position;
@@ -85394,6 +85407,34 @@ class GroupNode extends ScenegraphNode {
85394
85407
  this.removeAll();
85395
85408
  super.delete();
85396
85409
  }
85410
+ getBounds() {
85411
+ const result = [[Infinity, Infinity, Infinity], [-Infinity, -Infinity, -Infinity]];
85412
+ this.traverse((node2, _ref) => {
85413
+ let {
85414
+ worldMatrix
85415
+ } = _ref;
85416
+ const bounds2 = node2.getBounds();
85417
+ if (!bounds2) {
85418
+ return;
85419
+ }
85420
+ const [min2, max2] = bounds2;
85421
+ const center2 = new Vector3(min2).add(max2).divide([2, 2, 2]);
85422
+ worldMatrix.transformAsPoint(center2, center2);
85423
+ const halfSize = new Vector3(max2).subtract(min2).divide([2, 2, 2]);
85424
+ worldMatrix.transformAsVector(halfSize, halfSize);
85425
+ for (let v = 0; v < 8; v++) {
85426
+ const position = new Vector3(v & 1 ? -1 : 1, v & 2 ? -1 : 1, v & 4 ? -1 : 1).multiply(halfSize).add(center2);
85427
+ for (let i2 = 0; i2 < 3; i2++) {
85428
+ result[0][i2] = Math.min(result[0][i2], position[i2]);
85429
+ result[1][i2] = Math.max(result[1][i2], position[i2]);
85430
+ }
85431
+ }
85432
+ });
85433
+ if (!Number.isFinite(result[0][0])) {
85434
+ return null;
85435
+ }
85436
+ return result;
85437
+ }
85397
85438
  traverse(visitor) {
85398
85439
  let {
85399
85440
  worldMatrix = new Matrix4()
@@ -85643,6 +85684,7 @@ class ModelNode extends ScenegraphNode {
85643
85684
  } else {
85644
85685
  this.model = new Model(gl, props2);
85645
85686
  }
85687
+ this.bounds = null;
85646
85688
  this.managedResources = props2.managedResources || [];
85647
85689
  }
85648
85690
  setProps(props2) {
@@ -85650,6 +85692,9 @@ class ModelNode extends ScenegraphNode {
85650
85692
  this._setModelNodeProps(props2);
85651
85693
  return this;
85652
85694
  }
85695
+ getBounds() {
85696
+ return this.bounds;
85697
+ }
85653
85698
  delete() {
85654
85699
  if (this.model) {
85655
85700
  this.model.delete();
@@ -85834,17 +85879,21 @@ function createGLTFModel(gl, options) {
85834
85879
  const managedResources = [];
85835
85880
  managedResources.push(...materialParser.generatedTextures);
85836
85881
  managedResources.push(...Object.values(attributes).map((attribute) => attribute.buffer));
85837
- const model = new ModelNode(gl, Object.assign({
85882
+ const model = new ModelNode(gl, {
85838
85883
  id,
85839
85884
  drawMode,
85840
85885
  vertexCount,
85841
85886
  modules: [pbr],
85842
- defines: materialParser.defines,
85843
85887
  parameters: materialParser.parameters,
85844
85888
  vs: addVersionToShader(gl, vs$7),
85845
85889
  fs: addVersionToShader(gl, fs$7),
85846
- managedResources
85847
- }, modelOptions));
85890
+ managedResources,
85891
+ ...modelOptions,
85892
+ defines: {
85893
+ ...materialParser.defines,
85894
+ ...modelOptions.defines
85895
+ }
85896
+ });
85848
85897
  model.setProps({
85849
85898
  attributes
85850
85899
  });
@@ -85939,13 +85988,15 @@ class GLTFInstantiator {
85939
85988
  log$2.warn("getVertexCount() not found")();
85940
85989
  }
85941
85990
  createPrimitive(gltfPrimitive, i2, gltfMesh) {
85942
- return createGLTFModel(this.gl, Object.assign({
85991
+ const model = createGLTFModel(this.gl, Object.assign({
85943
85992
  id: gltfPrimitive.name || "".concat(gltfMesh.name || gltfMesh.id, "-primitive-").concat(i2),
85944
85993
  drawMode: gltfPrimitive.mode || 4,
85945
85994
  vertexCount: gltfPrimitive.indices ? gltfPrimitive.indices.count : this.getVertexCount(gltfPrimitive.attributes),
85946
85995
  attributes: this.createAttributes(gltfPrimitive.attributes, gltfPrimitive.indices),
85947
85996
  material: gltfPrimitive.material
85948
85997
  }, this.options));
85998
+ model.bounds = [gltfPrimitive.attributes.POSITION.min, gltfPrimitive.attributes.POSITION.max];
85999
+ return model;
85949
86000
  }
85950
86001
  createAttributes(attributes, indices) {
85951
86002
  const loadedAttributes = {};
@@ -93873,15 +93924,11 @@ class Tile3DLayer extends CompositeLayer {
93873
93924
  info,
93874
93925
  sourceLayer
93875
93926
  }) {
93876
- const {
93877
- layerMap
93878
- } = this.state;
93879
- const layerId = sourceLayer && sourceLayer.id;
93880
- if (layerId) {
93881
- const substr = layerId.substring(this.id.length + 1);
93882
- const tileId = substr.substring(substr.indexOf("-") + 1);
93883
- info.object = layerMap[tileId] && layerMap[tileId].tile;
93927
+ const sourceTile = sourceLayer && sourceLayer.props.tile;
93928
+ if (info.picked) {
93929
+ info.object = sourceTile;
93884
93930
  }
93931
+ info.sourceTile = sourceTile;
93885
93932
  return info;
93886
93933
  }
93887
93934
  filterSubLayer({
@@ -93897,8 +93944,10 @@ class Tile3DLayer extends CompositeLayer {
93897
93944
  return tile.selected && tile.viewportIds.includes(viewportId);
93898
93945
  }
93899
93946
  _updateAutoHighlight(info) {
93900
- if (info.sourceLayer) {
93901
- info.sourceLayer.updateAutoHighlight(info);
93947
+ const sourceTile = info.sourceTile;
93948
+ const layerCache = this.state.layerMap[sourceTile === null || sourceTile === void 0 ? void 0 : sourceTile.id];
93949
+ if (layerCache && layerCache.layer) {
93950
+ layerCache.layer.updateAutoHighlight(info);
93902
93951
  }
93903
93952
  }
93904
93953
  async _loadTileset(tilesetUrl) {
@@ -134599,16 +134648,16 @@ async function getDecoder(fileDirectory) {
134599
134648
  const Decoder = await importFn();
134600
134649
  return new Decoder(fileDirectory);
134601
134650
  }
134602
- addDecoder([void 0, 1], () => import("./raw-54b09a40.js").then((m) => m.default));
134603
- addDecoder(5, () => import("./lzw-96a48880.js").then((m) => m.default));
134651
+ addDecoder([void 0, 1], () => import("./raw-489994e7.js").then((m) => m.default));
134652
+ addDecoder(5, () => import("./lzw-95c88af0.js").then((m) => m.default));
134604
134653
  addDecoder(6, () => {
134605
134654
  throw new Error("old style JPEG compression is not supported.");
134606
134655
  });
134607
- addDecoder(7, () => import("./jpeg-0419d8c4.js").then((m) => m.default));
134608
- addDecoder([8, 32946], () => import("./deflate-8a69aa14.js").then((m) => m.default));
134609
- addDecoder(32773, () => import("./packbits-459e9af7.js").then((m) => m.default));
134610
- addDecoder(34887, () => import("./lerc-39d13ed4.js").then((m) => m.default));
134611
- addDecoder(50001, () => import("./webimage-8cf070f9.js").then((m) => m.default));
134656
+ addDecoder(7, () => import("./jpeg-4352029f.js").then((m) => m.default));
134657
+ addDecoder([8, 32946], () => import("./deflate-44be7eee.js").then((m) => m.default));
134658
+ addDecoder(32773, () => import("./packbits-dbe03832.js").then((m) => m.default));
134659
+ addDecoder(34887, () => import("./lerc-9666eaeb.js").then((m) => m.default));
134660
+ addDecoder(50001, () => import("./webimage-bf903bbd.js").then((m) => m.default));
134612
134661
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
134613
134662
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
134614
134663
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C, d, e, f, h, G, b, J, M, i, O, c, R, j } from "./index-7fde58f2.js";
1
+ import { C, d, e, f, h, G, b, J, M, i, O, c, R, j } from "./index-c9e50f8e.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-7fde58f2.js";
1
+ import { B as BaseDecoder } from "./index-c9e50f8e.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
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-7fde58f2.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-c9e50f8e.js";
3
3
  import "@vitessce/vit-s";
4
4
  import "react";
5
5
  var LercDecode = { exports: {} };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-7fde58f2.js";
1
+ import { B as BaseDecoder } from "./index-c9e50f8e.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  const MIN_BITS = 9;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-7fde58f2.js";
1
+ import { B as BaseDecoder } from "./index-c9e50f8e.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  class PackbitsDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-7fde58f2.js";
1
+ import { B as BaseDecoder } from "./index-c9e50f8e.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  class RawDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-7fde58f2.js";
1
+ import { B as BaseDecoder } from "./index-c9e50f8e.js";
2
2
  import "@vitessce/vit-s";
3
3
  import "react";
4
4
  class WebImageDecoder extends BaseDecoder {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/json",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
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
  "zarrita": "0.4.0-next.4",
22
22
  "zod": "^3.21.4",
23
- "@vitessce/constants-internal": "3.3.0",
24
- "@vitessce/schemas": "3.3.0",
25
- "@vitessce/gl": "3.3.0",
26
- "@vitessce/sets-utils": "3.3.0",
27
- "@vitessce/spatial-utils": "3.3.0",
28
- "@vitessce/utils": "3.3.0",
29
- "@vitessce/vit-s": "3.3.0",
30
- "@vitessce/zarr-utils": "3.3.0"
23
+ "@vitessce/gl": "3.3.1",
24
+ "@vitessce/constants-internal": "3.3.1",
25
+ "@vitessce/schemas": "3.3.1",
26
+ "@vitessce/sets-utils": "3.3.1",
27
+ "@vitessce/utils": "3.3.1",
28
+ "@vitessce/spatial-utils": "3.3.1",
29
+ "@vitessce/vit-s": "3.3.1",
30
+ "@vitessce/zarr-utils": "3.3.1"
31
31
  },
32
32
  "scripts": {
33
33
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",