@vitessce/gl 3.3.0 → 3.3.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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-9f310473.js";
2
+ import { B as BaseDecoder } from "./index-0d084e33.js";
3
3
  import "react";
4
4
  class DeflateDecoder extends BaseDecoder {
5
5
  decodeBlock(buffer) {
@@ -2970,7 +2970,7 @@ const jsonLoader = {
2970
2970
  testText: isJSON,
2971
2971
  parseTextSync: JSON.parse
2972
2972
  };
2973
- const version = "8.8.20";
2973
+ const version = "8.8.27";
2974
2974
  const existingVersion = globalThis.deck && globalThis.deck.VERSION;
2975
2975
  if (existingVersion && existingVersion !== version) {
2976
2976
  throw new Error("deck.gl - multiple versions detected: ".concat(existingVersion, " vs ").concat(version));
@@ -4169,9 +4169,8 @@ function cssToDeviceRatio(gl) {
4169
4169
  luma: luma2
4170
4170
  } = gl;
4171
4171
  if (gl.canvas && luma2) {
4172
- const {
4173
- clientWidth
4174
- } = luma2.canvasSizeInfo;
4172
+ const cachedSize = luma2.canvasSizeInfo;
4173
+ const clientWidth = "clientWidth" in cachedSize ? cachedSize.clientWidth : gl.canvas.clientWidth;
4175
4174
  return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;
4176
4175
  }
4177
4176
  return 1;
@@ -4427,7 +4426,7 @@ function setDevicePixelRatio(gl, devicePixelRatio, options) {
4427
4426
  });
4428
4427
  }
4429
4428
  }
4430
- const VERSION$7 = "8.5.16";
4429
+ const VERSION$7 = "8.5.21";
4431
4430
  const STARTUP_MESSAGE = "set luma.log.level=1 (or higher) to trace rendering";
4432
4431
  class StatsManager {
4433
4432
  constructor() {
@@ -4548,7 +4547,6 @@ let Resource$1 = class Resource {
4548
4547
  this._handle = this._createHandle();
4549
4548
  }
4550
4549
  this.byteLength = 0;
4551
- this._initStats();
4552
4550
  this._addStats();
4553
4551
  }
4554
4552
  toString() {
@@ -4684,9 +4682,6 @@ let Resource$1 = class Resource {
4684
4682
  this.gl.luma = this.gl.luma || {};
4685
4683
  return this.gl.luma;
4686
4684
  }
4687
- _initStats() {
4688
- this.gl.stats = this.gl.stats || new StatsManager();
4689
- }
4690
4685
  _addStats() {
4691
4686
  const name2 = this[Symbol.toStringTag];
4692
4687
  const stats = lumaStats.get("Resource Counts");
@@ -4701,27 +4696,29 @@ let Resource$1 = class Resource {
4701
4696
  }
4702
4697
  _trackAllocatedMemory(bytes) {
4703
4698
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
4704
- this._doTrackAllocatedMemory(bytes, name2);
4705
- this._doTrackAllocatedMemory(bytes, name2, this.gl.stats.get("Memory Usage"));
4699
+ this._trackAllocatedMemoryForContext(bytes, name2);
4700
+ this._trackAllocatedMemoryForContext(bytes, name2, this.gl.canvas && this.gl.canvas.id);
4701
+ this.byteLength = bytes;
4706
4702
  }
4707
- _doTrackAllocatedMemory(bytes) {
4703
+ _trackAllocatedMemoryForContext(bytes) {
4708
4704
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
4709
- let stats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lumaStats.get("Memory Usage");
4705
+ let id = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
4706
+ const stats = lumaStats.get("Memory Usage".concat(id));
4710
4707
  stats.get("GPU Memory").addCount(bytes);
4711
4708
  stats.get("".concat(name2, " Memory")).addCount(bytes);
4712
- this.byteLength = bytes;
4713
4709
  }
4714
4710
  _trackDeallocatedMemory() {
4715
4711
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
4716
- this._doTrackDeallocatedMemory(name2);
4717
- this._doTrackDeallocatedMemory(name2, this.gl.stats.get("Memory Usage"));
4712
+ this._trackDeallocatedMemoryForContext(name2);
4713
+ this._trackDeallocatedMemoryForContext(name2, this.gl.canvas && this.gl.canvas.id);
4714
+ this.byteLength = 0;
4718
4715
  }
4719
- _doTrackDeallocatedMemory() {
4716
+ _trackDeallocatedMemoryForContext() {
4720
4717
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
4721
- let stats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : lumaStats.get("Memory Usage");
4718
+ let id = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
4719
+ const stats = lumaStats.get("Memory Usage".concat(id));
4722
4720
  stats.get("GPU Memory").subtractCount(this.byteLength);
4723
4721
  stats.get("".concat(name2, " Memory")).subtractCount(this.byteLength);
4724
- this.byteLength = 0;
4725
4722
  }
4726
4723
  };
4727
4724
  const ERR_TYPE_DEDUCTION = "Failed to deduce GL constant from typed array";
@@ -17937,6 +17934,7 @@ const picking = {
17937
17934
  inject: {
17938
17935
  "vs:DECKGL_FILTER_GL_POSITION": "\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n ",
17939
17936
  "vs:DECKGL_FILTER_COLOR": "\n picking_setPickingColor(geometry.pickingColor);\n ",
17937
+ "fs:#decl": "\nuniform bool picking_uAttribute;\n ",
17940
17938
  "fs:DECKGL_FILTER_COLOR": {
17941
17939
  order: 99,
17942
17940
  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 "
@@ -18747,6 +18745,9 @@ class Viewport {
18747
18745
  this.projectFlat = this.projectFlat.bind(this);
18748
18746
  this.unprojectFlat = this.unprojectFlat.bind(this);
18749
18747
  }
18748
+ get subViewports() {
18749
+ return null;
18750
+ }
18750
18751
  get metersPerPixel() {
18751
18752
  return this.distanceScales.metersPerUnit[2] / this.scale;
18752
18753
  }
@@ -27671,7 +27672,7 @@ class Attribute extends DataColumn {
27671
27672
  const {
27672
27673
  startIndices
27673
27674
  } = this;
27674
- const vertexIndex = startIndices ? startIndices[row] : row;
27675
+ const vertexIndex = startIndices ? row < startIndices.length ? startIndices[row] : this.numInstances : row;
27675
27676
  return vertexIndex * this.size;
27676
27677
  }
27677
27678
  getShaderAttributes() {
@@ -30315,7 +30316,7 @@ class Layer extends Component {
30315
30316
  if (Array.isArray(highlightColor)) {
30316
30317
  parameters.pickingHighlightColor = highlightColor;
30317
30318
  }
30318
- if (Number.isInteger(highlightedObjectIndex)) {
30319
+ if (forceUpdate || highlightedObjectIndex !== oldProps.highlightedObjectIndex) {
30319
30320
  parameters.pickingSelectedColor = Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0 ? this.encodePickingColor(highlightedObjectIndex) : null;
30320
30321
  }
30321
30322
  this.setModuleParameters(parameters);
@@ -31678,7 +31679,7 @@ function interpolateQuad(quad, ut, vt) {
31678
31679
  }
31679
31680
  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";
31680
31681
  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";
31681
- 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");
31682
+ 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");
31682
31683
  const defaultProps$I = {
31683
31684
  image: {
31684
31685
  type: "image",
@@ -39821,18 +39822,22 @@ function getBoundingBox(viewport, zRange, extent2) {
39821
39822
  }
39822
39823
  function getCullBounds({
39823
39824
  viewport,
39824
- z: z2,
39825
+ z: z2 = 0,
39825
39826
  cullRect
39826
39827
  }) {
39827
- const x2 = cullRect.x - viewport.x;
39828
- const y2 = cullRect.y - viewport.y;
39829
- const {
39830
- width,
39831
- height
39832
- } = cullRect;
39828
+ const subViewports = viewport.subViewports || [viewport];
39829
+ return subViewports.map((v) => getCullBoundsInViewport(v, z2, cullRect));
39830
+ }
39831
+ function getCullBoundsInViewport(viewport, z2, cullRect) {
39833
39832
  if (!Array.isArray(z2)) {
39833
+ const x2 = cullRect.x - viewport.x;
39834
+ const y2 = cullRect.y - viewport.y;
39835
+ const {
39836
+ width,
39837
+ height
39838
+ } = cullRect;
39834
39839
  const unprojectOption = {
39835
- targetZ: z2 || 0
39840
+ targetZ: z2
39836
39841
  };
39837
39842
  const topLeft = viewport.unproject([x2, y2], unprojectOption);
39838
39843
  const topRight = viewport.unproject([x2 + width, y2], unprojectOption);
@@ -39840,16 +39845,8 @@ function getCullBounds({
39840
39845
  const bottomRight = viewport.unproject([x2 + width, y2 + height], unprojectOption);
39841
39846
  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])];
39842
39847
  }
39843
- const bounds0 = getCullBounds({
39844
- viewport,
39845
- z: z2[0],
39846
- cullRect
39847
- });
39848
- const bounds1 = getCullBounds({
39849
- viewport,
39850
- z: z2[1],
39851
- cullRect
39852
- });
39848
+ const bounds0 = getCullBoundsInViewport(viewport, z2[0], cullRect);
39849
+ const bounds1 = getCullBoundsInViewport(viewport, z2[1], cullRect);
39853
39850
  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])];
39854
39851
  }
39855
39852
  function getIndexingCoords(bbox2, scale2, modelMatrixInverse) {
@@ -40079,7 +40076,7 @@ class Tileset2D {
40079
40076
  return false;
40080
40077
  }
40081
40078
  if (cullRect && this._viewport) {
40082
- const [minX, minY, maxX, maxY] = getCullBounds({
40079
+ const boundsArr = this._getCullBounds({
40083
40080
  viewport: this._viewport,
40084
40081
  z: this._zRange,
40085
40082
  cullRect
@@ -40087,12 +40084,20 @@ class Tileset2D {
40087
40084
  const {
40088
40085
  bbox: bbox2
40089
40086
  } = tile;
40090
- if ("west" in bbox2) {
40091
- return bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
40087
+ for (const [minX, minY, maxX, maxY] of boundsArr) {
40088
+ let overlaps;
40089
+ if ("west" in bbox2) {
40090
+ overlaps = bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
40091
+ } else {
40092
+ const y02 = Math.min(bbox2.top, bbox2.bottom);
40093
+ const y12 = Math.max(bbox2.top, bbox2.bottom);
40094
+ overlaps = bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
40095
+ }
40096
+ if (overlaps) {
40097
+ return true;
40098
+ }
40092
40099
  }
40093
- const y02 = Math.min(bbox2.top, bbox2.bottom);
40094
- const y12 = Math.max(bbox2.top, bbox2.bottom);
40095
- return bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
40100
+ return false;
40096
40101
  }
40097
40102
  return true;
40098
40103
  }
@@ -40541,14 +40546,19 @@ class TileLayer extends CompositeLayer {
40541
40546
  info,
40542
40547
  sourceLayer
40543
40548
  }) {
40549
+ const sourceTile = sourceLayer.props.tile;
40544
40550
  if (info.picked) {
40545
- info.tile = sourceLayer.props.tile;
40551
+ info.tile = sourceTile;
40546
40552
  }
40553
+ info.sourceTile = sourceTile;
40547
40554
  return info;
40548
40555
  }
40549
40556
  _updateAutoHighlight(info) {
40550
- if (info.sourceLayer) {
40551
- info.sourceLayer.updateAutoHighlight(info);
40557
+ const sourceTile = info.sourceTile;
40558
+ if (sourceTile && sourceTile.layers) {
40559
+ for (const layer of sourceTile.layers) {
40560
+ layer.updateAutoHighlight(info);
40561
+ }
40552
40562
  }
40553
40563
  }
40554
40564
  renderLayers() {
@@ -52866,6 +52876,9 @@ class ScenegraphNode {
52866
52876
  toString() {
52867
52877
  return "{type: ScenegraphNode, id: ".concat(this.id, ")}");
52868
52878
  }
52879
+ getBounds() {
52880
+ return null;
52881
+ }
52869
52882
  setPosition(position) {
52870
52883
  assert$8(position.length === 3, "setPosition requires vector argument");
52871
52884
  this.position = position;
@@ -53016,6 +53029,34 @@ class GroupNode extends ScenegraphNode {
53016
53029
  this.removeAll();
53017
53030
  super.delete();
53018
53031
  }
53032
+ getBounds() {
53033
+ const result = [[Infinity, Infinity, Infinity], [-Infinity, -Infinity, -Infinity]];
53034
+ this.traverse((node, _ref) => {
53035
+ let {
53036
+ worldMatrix
53037
+ } = _ref;
53038
+ const bounds2 = node.getBounds();
53039
+ if (!bounds2) {
53040
+ return;
53041
+ }
53042
+ const [min, max] = bounds2;
53043
+ const center2 = new Vector3(min).add(max).divide([2, 2, 2]);
53044
+ worldMatrix.transformAsPoint(center2, center2);
53045
+ const halfSize = new Vector3(max).subtract(min).divide([2, 2, 2]);
53046
+ worldMatrix.transformAsVector(halfSize, halfSize);
53047
+ for (let v = 0; v < 8; v++) {
53048
+ const position = new Vector3(v & 1 ? -1 : 1, v & 2 ? -1 : 1, v & 4 ? -1 : 1).multiply(halfSize).add(center2);
53049
+ for (let i2 = 0; i2 < 3; i2++) {
53050
+ result[0][i2] = Math.min(result[0][i2], position[i2]);
53051
+ result[1][i2] = Math.max(result[1][i2], position[i2]);
53052
+ }
53053
+ }
53054
+ });
53055
+ if (!Number.isFinite(result[0][0])) {
53056
+ return null;
53057
+ }
53058
+ return result;
53059
+ }
53019
53060
  traverse(visitor) {
53020
53061
  let {
53021
53062
  worldMatrix = new Matrix4()
@@ -53265,6 +53306,7 @@ class ModelNode extends ScenegraphNode {
53265
53306
  } else {
53266
53307
  this.model = new Model(gl, props2);
53267
53308
  }
53309
+ this.bounds = null;
53268
53310
  this.managedResources = props2.managedResources || [];
53269
53311
  }
53270
53312
  setProps(props2) {
@@ -53272,6 +53314,9 @@ class ModelNode extends ScenegraphNode {
53272
53314
  this._setModelNodeProps(props2);
53273
53315
  return this;
53274
53316
  }
53317
+ getBounds() {
53318
+ return this.bounds;
53319
+ }
53275
53320
  delete() {
53276
53321
  if (this.model) {
53277
53322
  this.model.delete();
@@ -53456,17 +53501,21 @@ function createGLTFModel(gl, options) {
53456
53501
  const managedResources = [];
53457
53502
  managedResources.push(...materialParser.generatedTextures);
53458
53503
  managedResources.push(...Object.values(attributes).map((attribute) => attribute.buffer));
53459
- const model = new ModelNode(gl, Object.assign({
53504
+ const model = new ModelNode(gl, {
53460
53505
  id,
53461
53506
  drawMode,
53462
53507
  vertexCount,
53463
53508
  modules: [pbr],
53464
- defines: materialParser.defines,
53465
53509
  parameters: materialParser.parameters,
53466
53510
  vs: addVersionToShader(gl, vs$7),
53467
53511
  fs: addVersionToShader(gl, fs$7),
53468
- managedResources
53469
- }, modelOptions));
53512
+ managedResources,
53513
+ ...modelOptions,
53514
+ defines: {
53515
+ ...materialParser.defines,
53516
+ ...modelOptions.defines
53517
+ }
53518
+ });
53470
53519
  model.setProps({
53471
53520
  attributes
53472
53521
  });
@@ -53561,13 +53610,15 @@ class GLTFInstantiator {
53561
53610
  log$2.warn("getVertexCount() not found")();
53562
53611
  }
53563
53612
  createPrimitive(gltfPrimitive, i2, gltfMesh) {
53564
- return createGLTFModel(this.gl, Object.assign({
53613
+ const model = createGLTFModel(this.gl, Object.assign({
53565
53614
  id: gltfPrimitive.name || "".concat(gltfMesh.name || gltfMesh.id, "-primitive-").concat(i2),
53566
53615
  drawMode: gltfPrimitive.mode || 4,
53567
53616
  vertexCount: gltfPrimitive.indices ? gltfPrimitive.indices.count : this.getVertexCount(gltfPrimitive.attributes),
53568
53617
  attributes: this.createAttributes(gltfPrimitive.attributes, gltfPrimitive.indices),
53569
53618
  material: gltfPrimitive.material
53570
53619
  }, this.options));
53620
+ model.bounds = [gltfPrimitive.attributes.POSITION.min, gltfPrimitive.attributes.POSITION.max];
53621
+ return model;
53571
53622
  }
53572
53623
  createAttributes(attributes, indices) {
53573
53624
  const loadedAttributes = {};
@@ -61495,15 +61546,11 @@ class Tile3DLayer extends CompositeLayer {
61495
61546
  info,
61496
61547
  sourceLayer
61497
61548
  }) {
61498
- const {
61499
- layerMap
61500
- } = this.state;
61501
- const layerId = sourceLayer && sourceLayer.id;
61502
- if (layerId) {
61503
- const substr = layerId.substring(this.id.length + 1);
61504
- const tileId = substr.substring(substr.indexOf("-") + 1);
61505
- info.object = layerMap[tileId] && layerMap[tileId].tile;
61549
+ const sourceTile = sourceLayer && sourceLayer.props.tile;
61550
+ if (info.picked) {
61551
+ info.object = sourceTile;
61506
61552
  }
61553
+ info.sourceTile = sourceTile;
61507
61554
  return info;
61508
61555
  }
61509
61556
  filterSubLayer({
@@ -61519,8 +61566,10 @@ class Tile3DLayer extends CompositeLayer {
61519
61566
  return tile.selected && tile.viewportIds.includes(viewportId);
61520
61567
  }
61521
61568
  _updateAutoHighlight(info) {
61522
- if (info.sourceLayer) {
61523
- info.sourceLayer.updateAutoHighlight(info);
61569
+ const sourceTile = info.sourceTile;
61570
+ const layerCache = this.state.layerMap[sourceTile === null || sourceTile === void 0 ? void 0 : sourceTile.id];
61571
+ if (layerCache && layerCache.layer) {
61572
+ layerCache.layer.updateAutoHighlight(info);
61524
61573
  }
61525
61574
  }
61526
61575
  async _loadTileset(tilesetUrl) {
@@ -103903,16 +103952,16 @@ async function getDecoder(fileDirectory) {
103903
103952
  const Decoder = await importFn();
103904
103953
  return new Decoder(fileDirectory);
103905
103954
  }
103906
- addDecoder([void 0, 1], () => import("./raw-df5c07c8.js").then((m) => m.default));
103907
- addDecoder(5, () => import("./lzw-984a6040.js").then((m) => m.default));
103955
+ addDecoder([void 0, 1], () => import("./raw-c78b844f.js").then((m) => m.default));
103956
+ addDecoder(5, () => import("./lzw-04637fdd.js").then((m) => m.default));
103908
103957
  addDecoder(6, () => {
103909
103958
  throw new Error("old style JPEG compression is not supported.");
103910
103959
  });
103911
- addDecoder(7, () => import("./jpeg-29bf61b4.js").then((m) => m.default));
103912
- addDecoder([8, 32946], () => import("./deflate-27838921.js").then((m) => m.default));
103913
- addDecoder(32773, () => import("./packbits-d5887f3d.js").then((m) => m.default));
103914
- addDecoder(34887, () => import("./lerc-64265216.js").then((m) => m.default));
103915
- addDecoder(50001, () => import("./webimage-a12c8ff6.js").then((m) => m.default));
103960
+ addDecoder(7, () => import("./jpeg-201a0839.js").then((m) => m.default));
103961
+ addDecoder([8, 32946], () => import("./deflate-73d5335b.js").then((m) => m.default));
103962
+ addDecoder(32773, () => import("./packbits-c3fd53d2.js").then((m) => m.default));
103963
+ addDecoder(34887, () => import("./lerc-4c2149fc.js").then((m) => m.default));
103964
+ addDecoder(50001, () => import("./webimage-2dd56bbe.js").then((m) => m.default));
103916
103965
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
103917
103966
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
103918
103967
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { f as distEs6 } from "./index-9f310473.js";
2
- import { o, n, A, r, q, p, i, j, C, l, D, G, e, H, c, M, k, m, d, P, S, h, T, t, b, s, v } from "./index-9f310473.js";
1
+ import { f as distEs6 } from "./index-0d084e33.js";
2
+ import { o, n, A, r, q, p, i, j, C, l, D, G, e, H, c, M, k, m, d, P, S, h, T, t, b, s, v } from "./index-0d084e33.js";
3
3
  import "react";
4
4
  const SELECTION_TYPE = distEs6.SELECTION_TYPE;
5
5
  export {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-9f310473.js";
1
+ import { B as BaseDecoder } from "./index-0d084e33.js";
2
2
  import "react";
3
3
  const dctZigZag = new Int32Array([
4
4
  0,
@@ -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-9f310473.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-0d084e33.js";
3
3
  import "react";
4
4
  var LercDecode = { exports: {} };
5
5
  (function(module) {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-9f310473.js";
1
+ import { B as BaseDecoder } from "./index-0d084e33.js";
2
2
  import "react";
3
3
  const MIN_BITS = 9;
4
4
  const CLEAR_CODE = 256;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-9f310473.js";
1
+ import { B as BaseDecoder } from "./index-0d084e33.js";
2
2
  import "react";
3
3
  class PackbitsDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-9f310473.js";
1
+ import { B as BaseDecoder } from "./index-0d084e33.js";
2
2
  import "react";
3
3
  class RawDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-9f310473.js";
1
+ import { B as BaseDecoder } from "./index-0d084e33.js";
2
2
  import "react";
3
3
  class WebImageDecoder extends BaseDecoder {
4
4
  constructor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/gl",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -16,25 +16,25 @@
16
16
  "dist-tsc"
17
17
  ],
18
18
  "dependencies": {
19
- "@deck.gl/aggregation-layers": "~8.8.6",
20
- "@deck.gl/core": "~8.8.6",
21
- "@deck.gl/extensions": "~8.8.6",
22
- "@deck.gl/geo-layers": "~8.8.6",
23
- "@deck.gl/layers": "~8.8.6",
24
- "@deck.gl/mesh-layers": "~8.8.6",
25
- "@deck.gl/react": "~8.8.6",
19
+ "@deck.gl/aggregation-layers": "8.8.27",
20
+ "@deck.gl/core": "8.8.27",
21
+ "@deck.gl/extensions": "8.8.27",
22
+ "@deck.gl/geo-layers": "8.8.27",
23
+ "@deck.gl/layers": "8.8.27",
24
+ "@deck.gl/mesh-layers": "8.8.27",
25
+ "@deck.gl/react": "8.8.27",
26
26
  "@hms-dbmi/viv": "~0.13.8",
27
27
  "@loaders.gl/3d-tiles": "^3.0.0",
28
28
  "@loaders.gl/core": "^3.0.0",
29
29
  "@loaders.gl/images": "^3.0.0",
30
30
  "@loaders.gl/loader-utils": "^3.0.0",
31
- "@luma.gl/constants": "~8.5.16",
32
- "@luma.gl/core": "~8.5.16",
33
- "@luma.gl/engine": "~8.5.16",
34
- "@luma.gl/experimental": "~8.5.16",
35
- "@luma.gl/gltools": "~8.5.16",
36
- "@luma.gl/shadertools": "~8.5.16",
37
- "@luma.gl/webgl": "~8.5.16",
31
+ "@luma.gl/constants": "8.5.21",
32
+ "@luma.gl/core": "8.5.21",
33
+ "@luma.gl/engine": "8.5.21",
34
+ "@luma.gl/experimental": "8.5.21",
35
+ "@luma.gl/gltools": "8.5.21",
36
+ "@luma.gl/shadertools": "8.5.21",
37
+ "@luma.gl/webgl": "8.5.21",
38
38
  "@math.gl/core": "^3.5.6",
39
39
  "@nebula.gl/edit-modes": "0.23.8",
40
40
  "@nebula.gl/layers": "0.23.8",
@@ -45,14 +45,14 @@
45
45
  "@turf/boolean-within": "^6.5.0",
46
46
  "@turf/centroid": "^6.5.0",
47
47
  "@turf/helpers": "^6.5.0",
48
- "deck.gl": "~8.8.6",
48
+ "d3-array": "^2.4.0",
49
+ "deck.gl": "8.8.27",
49
50
  "glslify": "^7.0.0",
50
51
  "lodash-es": "^4.17.21",
51
52
  "math.gl": "^3.5.6",
52
53
  "mathjs": "^9.2.0",
53
54
  "nebula.gl": "0.23.8",
54
- "d3-array": "^2.4.0",
55
- "@vitessce/utils": "3.3.0"
55
+ "@vitessce/utils": "3.3.2"
56
56
  },
57
57
  "devDependencies": {
58
58
  "glsl-colormap": "^1.0.1"