@vitessce/heatmap 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-3c0e8e85.js";
2
+ import { B as BaseDecoder } from "./index-6515eb5d.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -33598,7 +33598,7 @@ const jsonLoader = {
33598
33598
  testText: isJSON,
33599
33599
  parseTextSync: JSON.parse
33600
33600
  };
33601
- const version = "8.8.20";
33601
+ const version = "8.8.27";
33602
33602
  const existingVersion = globalThis.deck && globalThis.deck.VERSION;
33603
33603
  if (existingVersion && existingVersion !== version) {
33604
33604
  throw new Error("deck.gl - multiple versions detected: ".concat(existingVersion, " vs ").concat(version));
@@ -34797,9 +34797,8 @@ function cssToDeviceRatio(gl) {
34797
34797
  luma
34798
34798
  } = gl;
34799
34799
  if (gl.canvas && luma) {
34800
- const {
34801
- clientWidth
34802
- } = luma.canvasSizeInfo;
34800
+ const cachedSize = luma.canvasSizeInfo;
34801
+ const clientWidth = "clientWidth" in cachedSize ? cachedSize.clientWidth : gl.canvas.clientWidth;
34803
34802
  return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;
34804
34803
  }
34805
34804
  return 1;
@@ -35055,7 +35054,7 @@ function setDevicePixelRatio(gl, devicePixelRatio, options) {
35055
35054
  });
35056
35055
  }
35057
35056
  }
35058
- const VERSION$7 = "8.5.16";
35057
+ const VERSION$7 = "8.5.21";
35059
35058
  const STARTUP_MESSAGE = "set luma.log.level=1 (or higher) to trace rendering";
35060
35059
  class StatsManager {
35061
35060
  constructor() {
@@ -35176,7 +35175,6 @@ let Resource$1 = class Resource {
35176
35175
  this._handle = this._createHandle();
35177
35176
  }
35178
35177
  this.byteLength = 0;
35179
- this._initStats();
35180
35178
  this._addStats();
35181
35179
  }
35182
35180
  toString() {
@@ -35312,9 +35310,6 @@ let Resource$1 = class Resource {
35312
35310
  this.gl.luma = this.gl.luma || {};
35313
35311
  return this.gl.luma;
35314
35312
  }
35315
- _initStats() {
35316
- this.gl.stats = this.gl.stats || new StatsManager();
35317
- }
35318
35313
  _addStats() {
35319
35314
  const name2 = this[Symbol.toStringTag];
35320
35315
  const stats = lumaStats.get("Resource Counts");
@@ -35329,27 +35324,29 @@ let Resource$1 = class Resource {
35329
35324
  }
35330
35325
  _trackAllocatedMemory(bytes) {
35331
35326
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
35332
- this._doTrackAllocatedMemory(bytes, name2);
35333
- this._doTrackAllocatedMemory(bytes, name2, this.gl.stats.get("Memory Usage"));
35327
+ this._trackAllocatedMemoryForContext(bytes, name2);
35328
+ this._trackAllocatedMemoryForContext(bytes, name2, this.gl.canvas && this.gl.canvas.id);
35329
+ this.byteLength = bytes;
35334
35330
  }
35335
- _doTrackAllocatedMemory(bytes) {
35331
+ _trackAllocatedMemoryForContext(bytes) {
35336
35332
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
35337
- let stats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lumaStats.get("Memory Usage");
35333
+ let id = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
35334
+ const stats = lumaStats.get("Memory Usage".concat(id));
35338
35335
  stats.get("GPU Memory").addCount(bytes);
35339
35336
  stats.get("".concat(name2, " Memory")).addCount(bytes);
35340
- this.byteLength = bytes;
35341
35337
  }
35342
35338
  _trackDeallocatedMemory() {
35343
35339
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
35344
- this._doTrackDeallocatedMemory(name2);
35345
- this._doTrackDeallocatedMemory(name2, this.gl.stats.get("Memory Usage"));
35340
+ this._trackDeallocatedMemoryForContext(name2);
35341
+ this._trackDeallocatedMemoryForContext(name2, this.gl.canvas && this.gl.canvas.id);
35342
+ this.byteLength = 0;
35346
35343
  }
35347
- _doTrackDeallocatedMemory() {
35344
+ _trackDeallocatedMemoryForContext() {
35348
35345
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
35349
- let stats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : lumaStats.get("Memory Usage");
35346
+ let id = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
35347
+ const stats = lumaStats.get("Memory Usage".concat(id));
35350
35348
  stats.get("GPU Memory").subtractCount(this.byteLength);
35351
35349
  stats.get("".concat(name2, " Memory")).subtractCount(this.byteLength);
35352
- this.byteLength = 0;
35353
35350
  }
35354
35351
  };
35355
35352
  const ERR_TYPE_DEDUCTION = "Failed to deduce GL constant from typed array";
@@ -48565,6 +48562,7 @@ const picking = {
48565
48562
  inject: {
48566
48563
  "vs:DECKGL_FILTER_GL_POSITION": "\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n ",
48567
48564
  "vs:DECKGL_FILTER_COLOR": "\n picking_setPickingColor(geometry.pickingColor);\n ",
48565
+ "fs:#decl": "\nuniform bool picking_uAttribute;\n ",
48568
48566
  "fs:DECKGL_FILTER_COLOR": {
48569
48567
  order: 99,
48570
48568
  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 "
@@ -49375,6 +49373,9 @@ class Viewport {
49375
49373
  this.projectFlat = this.projectFlat.bind(this);
49376
49374
  this.unprojectFlat = this.unprojectFlat.bind(this);
49377
49375
  }
49376
+ get subViewports() {
49377
+ return null;
49378
+ }
49378
49379
  get metersPerPixel() {
49379
49380
  return this.distanceScales.metersPerUnit[2] / this.scale;
49380
49381
  }
@@ -58266,7 +58267,7 @@ class Attribute extends DataColumn {
58266
58267
  const {
58267
58268
  startIndices
58268
58269
  } = this;
58269
- const vertexIndex = startIndices ? startIndices[row] : row;
58270
+ const vertexIndex = startIndices ? row < startIndices.length ? startIndices[row] : this.numInstances : row;
58270
58271
  return vertexIndex * this.size;
58271
58272
  }
58272
58273
  getShaderAttributes() {
@@ -60910,7 +60911,7 @@ class Layer extends Component {
60910
60911
  if (Array.isArray(highlightColor)) {
60911
60912
  parameters.pickingHighlightColor = highlightColor;
60912
60913
  }
60913
- if (Number.isInteger(highlightedObjectIndex)) {
60914
+ if (forceUpdate || highlightedObjectIndex !== oldProps.highlightedObjectIndex) {
60914
60915
  parameters.pickingSelectedColor = Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0 ? this.encodePickingColor(highlightedObjectIndex) : null;
60915
60916
  }
60916
60917
  this.setModuleParameters(parameters);
@@ -62273,7 +62274,7 @@ function interpolateQuad(quad, ut, vt) {
62273
62274
  }
62274
62275
  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";
62275
62276
  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";
62276
- 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");
62277
+ 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");
62277
62278
  const defaultProps$I = {
62278
62279
  image: {
62279
62280
  type: "image",
@@ -70413,18 +70414,22 @@ function getBoundingBox(viewport, zRange, extent2) {
70413
70414
  }
70414
70415
  function getCullBounds({
70415
70416
  viewport,
70416
- z: z2,
70417
+ z: z2 = 0,
70417
70418
  cullRect
70418
70419
  }) {
70419
- const x2 = cullRect.x - viewport.x;
70420
- const y2 = cullRect.y - viewport.y;
70421
- const {
70422
- width,
70423
- height
70424
- } = cullRect;
70420
+ const subViewports = viewport.subViewports || [viewport];
70421
+ return subViewports.map((v) => getCullBoundsInViewport(v, z2, cullRect));
70422
+ }
70423
+ function getCullBoundsInViewport(viewport, z2, cullRect) {
70425
70424
  if (!Array.isArray(z2)) {
70425
+ const x2 = cullRect.x - viewport.x;
70426
+ const y2 = cullRect.y - viewport.y;
70427
+ const {
70428
+ width,
70429
+ height
70430
+ } = cullRect;
70426
70431
  const unprojectOption = {
70427
- targetZ: z2 || 0
70432
+ targetZ: z2
70428
70433
  };
70429
70434
  const topLeft = viewport.unproject([x2, y2], unprojectOption);
70430
70435
  const topRight = viewport.unproject([x2 + width, y2], unprojectOption);
@@ -70432,16 +70437,8 @@ function getCullBounds({
70432
70437
  const bottomRight = viewport.unproject([x2 + width, y2 + height], unprojectOption);
70433
70438
  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])];
70434
70439
  }
70435
- const bounds0 = getCullBounds({
70436
- viewport,
70437
- z: z2[0],
70438
- cullRect
70439
- });
70440
- const bounds1 = getCullBounds({
70441
- viewport,
70442
- z: z2[1],
70443
- cullRect
70444
- });
70440
+ const bounds0 = getCullBoundsInViewport(viewport, z2[0], cullRect);
70441
+ const bounds1 = getCullBoundsInViewport(viewport, z2[1], cullRect);
70445
70442
  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])];
70446
70443
  }
70447
70444
  function getIndexingCoords(bbox2, scale2, modelMatrixInverse) {
@@ -70671,7 +70668,7 @@ class Tileset2D {
70671
70668
  return false;
70672
70669
  }
70673
70670
  if (cullRect && this._viewport) {
70674
- const [minX, minY, maxX, maxY] = getCullBounds({
70671
+ const boundsArr = this._getCullBounds({
70675
70672
  viewport: this._viewport,
70676
70673
  z: this._zRange,
70677
70674
  cullRect
@@ -70679,12 +70676,20 @@ class Tileset2D {
70679
70676
  const {
70680
70677
  bbox: bbox2
70681
70678
  } = tile;
70682
- if ("west" in bbox2) {
70683
- return bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
70679
+ for (const [minX, minY, maxX, maxY] of boundsArr) {
70680
+ let overlaps;
70681
+ if ("west" in bbox2) {
70682
+ overlaps = bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
70683
+ } else {
70684
+ const y02 = Math.min(bbox2.top, bbox2.bottom);
70685
+ const y12 = Math.max(bbox2.top, bbox2.bottom);
70686
+ overlaps = bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
70687
+ }
70688
+ if (overlaps) {
70689
+ return true;
70690
+ }
70684
70691
  }
70685
- const y02 = Math.min(bbox2.top, bbox2.bottom);
70686
- const y12 = Math.max(bbox2.top, bbox2.bottom);
70687
- return bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
70692
+ return false;
70688
70693
  }
70689
70694
  return true;
70690
70695
  }
@@ -71133,14 +71138,19 @@ class TileLayer extends CompositeLayer {
71133
71138
  info,
71134
71139
  sourceLayer
71135
71140
  }) {
71141
+ const sourceTile = sourceLayer.props.tile;
71136
71142
  if (info.picked) {
71137
- info.tile = sourceLayer.props.tile;
71143
+ info.tile = sourceTile;
71138
71144
  }
71145
+ info.sourceTile = sourceTile;
71139
71146
  return info;
71140
71147
  }
71141
71148
  _updateAutoHighlight(info) {
71142
- if (info.sourceLayer) {
71143
- info.sourceLayer.updateAutoHighlight(info);
71149
+ const sourceTile = info.sourceTile;
71150
+ if (sourceTile && sourceTile.layers) {
71151
+ for (const layer of sourceTile.layers) {
71152
+ layer.updateAutoHighlight(info);
71153
+ }
71144
71154
  }
71145
71155
  }
71146
71156
  renderLayers() {
@@ -83458,6 +83468,9 @@ class ScenegraphNode {
83458
83468
  toString() {
83459
83469
  return "{type: ScenegraphNode, id: ".concat(this.id, ")}");
83460
83470
  }
83471
+ getBounds() {
83472
+ return null;
83473
+ }
83461
83474
  setPosition(position) {
83462
83475
  assert$8(position.length === 3, "setPosition requires vector argument");
83463
83476
  this.position = position;
@@ -83608,6 +83621,34 @@ class GroupNode extends ScenegraphNode {
83608
83621
  this.removeAll();
83609
83622
  super.delete();
83610
83623
  }
83624
+ getBounds() {
83625
+ const result = [[Infinity, Infinity, Infinity], [-Infinity, -Infinity, -Infinity]];
83626
+ this.traverse((node, _ref) => {
83627
+ let {
83628
+ worldMatrix
83629
+ } = _ref;
83630
+ const bounds2 = node.getBounds();
83631
+ if (!bounds2) {
83632
+ return;
83633
+ }
83634
+ const [min, max] = bounds2;
83635
+ const center2 = new Vector3(min).add(max).divide([2, 2, 2]);
83636
+ worldMatrix.transformAsPoint(center2, center2);
83637
+ const halfSize = new Vector3(max).subtract(min).divide([2, 2, 2]);
83638
+ worldMatrix.transformAsVector(halfSize, halfSize);
83639
+ for (let v = 0; v < 8; v++) {
83640
+ const position = new Vector3(v & 1 ? -1 : 1, v & 2 ? -1 : 1, v & 4 ? -1 : 1).multiply(halfSize).add(center2);
83641
+ for (let i2 = 0; i2 < 3; i2++) {
83642
+ result[0][i2] = Math.min(result[0][i2], position[i2]);
83643
+ result[1][i2] = Math.max(result[1][i2], position[i2]);
83644
+ }
83645
+ }
83646
+ });
83647
+ if (!Number.isFinite(result[0][0])) {
83648
+ return null;
83649
+ }
83650
+ return result;
83651
+ }
83611
83652
  traverse(visitor) {
83612
83653
  let {
83613
83654
  worldMatrix = new Matrix4()
@@ -83857,6 +83898,7 @@ class ModelNode extends ScenegraphNode {
83857
83898
  } else {
83858
83899
  this.model = new Model(gl, props2);
83859
83900
  }
83901
+ this.bounds = null;
83860
83902
  this.managedResources = props2.managedResources || [];
83861
83903
  }
83862
83904
  setProps(props2) {
@@ -83864,6 +83906,9 @@ class ModelNode extends ScenegraphNode {
83864
83906
  this._setModelNodeProps(props2);
83865
83907
  return this;
83866
83908
  }
83909
+ getBounds() {
83910
+ return this.bounds;
83911
+ }
83867
83912
  delete() {
83868
83913
  if (this.model) {
83869
83914
  this.model.delete();
@@ -84048,17 +84093,21 @@ function createGLTFModel(gl, options) {
84048
84093
  const managedResources = [];
84049
84094
  managedResources.push(...materialParser.generatedTextures);
84050
84095
  managedResources.push(...Object.values(attributes).map((attribute) => attribute.buffer));
84051
- const model = new ModelNode(gl, Object.assign({
84096
+ const model = new ModelNode(gl, {
84052
84097
  id,
84053
84098
  drawMode,
84054
84099
  vertexCount,
84055
84100
  modules: [pbr],
84056
- defines: materialParser.defines,
84057
84101
  parameters: materialParser.parameters,
84058
84102
  vs: addVersionToShader(gl, vs$7),
84059
84103
  fs: addVersionToShader(gl, fs$7),
84060
- managedResources
84061
- }, modelOptions));
84104
+ managedResources,
84105
+ ...modelOptions,
84106
+ defines: {
84107
+ ...materialParser.defines,
84108
+ ...modelOptions.defines
84109
+ }
84110
+ });
84062
84111
  model.setProps({
84063
84112
  attributes
84064
84113
  });
@@ -84153,13 +84202,15 @@ class GLTFInstantiator {
84153
84202
  log$2.warn("getVertexCount() not found")();
84154
84203
  }
84155
84204
  createPrimitive(gltfPrimitive, i2, gltfMesh) {
84156
- return createGLTFModel(this.gl, Object.assign({
84205
+ const model = createGLTFModel(this.gl, Object.assign({
84157
84206
  id: gltfPrimitive.name || "".concat(gltfMesh.name || gltfMesh.id, "-primitive-").concat(i2),
84158
84207
  drawMode: gltfPrimitive.mode || 4,
84159
84208
  vertexCount: gltfPrimitive.indices ? gltfPrimitive.indices.count : this.getVertexCount(gltfPrimitive.attributes),
84160
84209
  attributes: this.createAttributes(gltfPrimitive.attributes, gltfPrimitive.indices),
84161
84210
  material: gltfPrimitive.material
84162
84211
  }, this.options));
84212
+ model.bounds = [gltfPrimitive.attributes.POSITION.min, gltfPrimitive.attributes.POSITION.max];
84213
+ return model;
84163
84214
  }
84164
84215
  createAttributes(attributes, indices) {
84165
84216
  const loadedAttributes = {};
@@ -92087,15 +92138,11 @@ class Tile3DLayer extends CompositeLayer {
92087
92138
  info,
92088
92139
  sourceLayer
92089
92140
  }) {
92090
- const {
92091
- layerMap
92092
- } = this.state;
92093
- const layerId = sourceLayer && sourceLayer.id;
92094
- if (layerId) {
92095
- const substr = layerId.substring(this.id.length + 1);
92096
- const tileId = substr.substring(substr.indexOf("-") + 1);
92097
- info.object = layerMap[tileId] && layerMap[tileId].tile;
92141
+ const sourceTile = sourceLayer && sourceLayer.props.tile;
92142
+ if (info.picked) {
92143
+ info.object = sourceTile;
92098
92144
  }
92145
+ info.sourceTile = sourceTile;
92099
92146
  return info;
92100
92147
  }
92101
92148
  filterSubLayer({
@@ -92111,8 +92158,10 @@ class Tile3DLayer extends CompositeLayer {
92111
92158
  return tile.selected && tile.viewportIds.includes(viewportId);
92112
92159
  }
92113
92160
  _updateAutoHighlight(info) {
92114
- if (info.sourceLayer) {
92115
- info.sourceLayer.updateAutoHighlight(info);
92161
+ const sourceTile = info.sourceTile;
92162
+ const layerCache = this.state.layerMap[sourceTile === null || sourceTile === void 0 ? void 0 : sourceTile.id];
92163
+ if (layerCache && layerCache.layer) {
92164
+ layerCache.layer.updateAutoHighlight(info);
92116
92165
  }
92117
92166
  }
92118
92167
  async _loadTileset(tilesetUrl) {
@@ -132561,16 +132610,16 @@ function addDecoder(cases, importFn) {
132561
132610
  }
132562
132611
  cases.forEach((c) => registry$1.set(c, importFn));
132563
132612
  }
132564
- addDecoder([void 0, 1], () => import("./raw-7b8f8ab9.js").then((m) => m.default));
132565
- addDecoder(5, () => import("./lzw-72ff5da2.js").then((m) => m.default));
132613
+ addDecoder([void 0, 1], () => import("./raw-70e6b59a.js").then((m) => m.default));
132614
+ addDecoder(5, () => import("./lzw-a69646f9.js").then((m) => m.default));
132566
132615
  addDecoder(6, () => {
132567
132616
  throw new Error("old style JPEG compression is not supported.");
132568
132617
  });
132569
- addDecoder(7, () => import("./jpeg-793f8655.js").then((m) => m.default));
132570
- addDecoder([8, 32946], () => import("./deflate-3d857d4d.js").then((m) => m.default));
132571
- addDecoder(32773, () => import("./packbits-f9a71497.js").then((m) => m.default));
132572
- addDecoder(34887, () => import("./lerc-e636506e.js").then((m) => m.default));
132573
- addDecoder(50001, () => import("./webimage-bddf84dc.js").then((m) => m.default));
132618
+ addDecoder(7, () => import("./jpeg-aa77b6ec.js").then((m) => m.default));
132619
+ addDecoder([8, 32946], () => import("./deflate-9263f588.js").then((m) => m.default));
132620
+ addDecoder(32773, () => import("./packbits-fe4063d1.js").then((m) => m.default));
132621
+ addDecoder(34887, () => import("./lerc-1fcb6280.js").then((m) => m.default));
132622
+ addDecoder(50001, () => import("./webimage-093820b7.js").then((m) => m.default));
132574
132623
  function decodeRowAcc(row, stride) {
132575
132624
  let length2 = row.length - stride;
132576
132625
  let offset5 = 0;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, H } from "./index-3c0e8e85.js";
1
+ import { a, H } from "./index-6515eb5d.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-3c0e8e85.js";
1
+ import { B as BaseDecoder } from "./index-6515eb5d.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -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-3c0e8e85.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-6515eb5d.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-3c0e8e85.js";
1
+ import { B as BaseDecoder } from "./index-6515eb5d.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-3c0e8e85.js";
1
+ import { B as BaseDecoder } from "./index-6515eb5d.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-3c0e8e85.js";
1
+ import { B as BaseDecoder } from "./index-6515eb5d.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-3c0e8e85.js";
1
+ import { B as BaseDecoder } from "./index-6515eb5d.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/heatmap",
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
  "uuid": "^9.0.0",
22
22
  "react-aria": "^3.28.0",
23
- "@vitessce/constants-internal": "3.3.0",
24
- "@vitessce/legend": "3.3.0",
25
- "@vitessce/sets-utils": "3.3.0",
26
- "@vitessce/gl": "3.3.0",
27
- "@vitessce/tooltip": "3.3.0",
28
- "@vitessce/utils": "3.3.0",
29
- "@vitessce/vit-s": "3.3.0",
30
- "@vitessce/workers": "3.3.0"
23
+ "@vitessce/constants-internal": "3.3.1",
24
+ "@vitessce/legend": "3.3.1",
25
+ "@vitessce/sets-utils": "3.3.1",
26
+ "@vitessce/gl": "3.3.1",
27
+ "@vitessce/tooltip": "3.3.1",
28
+ "@vitessce/utils": "3.3.1",
29
+ "@vitessce/workers": "3.3.1",
30
+ "@vitessce/vit-s": "3.3.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "^5.16.4",