@vitessce/scatterplot-embedding 3.2.2 → 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-c4323615.js";
2
+ import { B as BaseDecoder } from "./index-1989acf5.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -4462,9 +4462,9 @@ const schemePlasma = [[13, 8, 135], [16, 7, 136], [19, 7, 137], [22, 7, 138], [2
4462
4462
  function rgbSpline(spline) {
4463
4463
  return (colors) => {
4464
4464
  const n2 = colors.length;
4465
- let r2 = new Array(n2);
4466
- let g2 = new Array(n2);
4467
- let b = new Array(n2);
4465
+ const r2 = new Array(n2);
4466
+ const g2 = new Array(n2);
4467
+ const b = new Array(n2);
4468
4468
  let i2;
4469
4469
  let color2;
4470
4470
  for (i2 = 0; i2 < n2; ++i2) {
@@ -4473,10 +4473,10 @@ function rgbSpline(spline) {
4473
4473
  g2[i2] = color2[1] || 0;
4474
4474
  b[i2] = color2[2] || 0;
4475
4475
  }
4476
- r2 = spline(r2);
4477
- g2 = spline(g2);
4478
- b = spline(b);
4479
- return (t2) => [r2(t2), g2(t2), b(t2)];
4476
+ const rFunc = spline(r2);
4477
+ const gFunc = spline(g2);
4478
+ const bFunc = spline(b);
4479
+ return (t2) => [rFunc(t2), gFunc(t2), bFunc(t2)];
4480
4480
  };
4481
4481
  }
4482
4482
  function basis(values2) {
@@ -11068,6 +11068,7 @@ const DataType$2 = {
11068
11068
  const FileType$1 = {
11069
11069
  // Joint file types
11070
11070
  ANNDATA_ZARR: "anndata.zarr",
11071
+ SPATIALDATA_ZARR: "spatialdata.zarr",
11071
11072
  // Atomic file types
11072
11073
  OBS_EMBEDDING_CSV: "obsEmbedding.csv",
11073
11074
  OBS_SPOTS_CSV: "obsSpots.csv",
@@ -11090,6 +11091,16 @@ const FileType$1 = {
11090
11091
  OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
11091
11092
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
11092
11093
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
11094
+ // SpatialData
11095
+ IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
11096
+ LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
11097
+ SHAPES_SPATIALDATA_ZARR: "shapes.spatialdata.zarr",
11098
+ OBS_FEATURE_MATRIX_SPATIALDATA_ZARR: "obsFeatureMatrix.spatialdata.zarr",
11099
+ OBS_SETS_SPATIALDATA_ZARR: "obsSets.spatialdata.zarr",
11100
+ OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
11101
+ // TODO:
11102
+ // OBS_POINTS_SPATIALDATA_ZARR: 'obsPoints.spatialdata.zarr',
11103
+ // OBS_LOCATIONS_SPATIALDATA_ZARR: 'obsLocations.spatialdata.zarr',
11093
11104
  // MuData
11094
11105
  OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
11095
11106
  OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
@@ -11891,9 +11902,30 @@ z.object({
11891
11902
  offsetsUrl: z.string().optional(),
11892
11903
  coordinateTransformations: omeCoordinateTransformations.optional()
11893
11904
  });
11894
- z.object({
11905
+ const imageOmeZarrSchema = z.object({
11895
11906
  coordinateTransformations: omeCoordinateTransformations.optional()
11896
11907
  });
11908
+ imageOmeZarrSchema.extend({
11909
+ path: z.string()
11910
+ });
11911
+ z.object({
11912
+ path: z.string()
11913
+ });
11914
+ z.object({
11915
+ path: z.string()
11916
+ });
11917
+ z.object({
11918
+ path: z.string(),
11919
+ tablePath: z.string().optional().describe("The path to a table which annotates the spots. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected.")
11920
+ });
11921
+ annDataObsFeatureMatrix.extend({
11922
+ region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional()
11923
+ });
11924
+ z.object({
11925
+ region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional(),
11926
+ tablePath: z.string().optional().describe("The path to a table which contains the index for the set values."),
11927
+ obsSets: annDataObsSets
11928
+ });
11897
11929
  z.object({
11898
11930
  obsIndex: z.string(),
11899
11931
  obsEmbedding: z.array(z.string()).length(2)
@@ -22188,7 +22220,7 @@ const jsonLoader = {
22188
22220
  testText: isJSON,
22189
22221
  parseTextSync: JSON.parse
22190
22222
  };
22191
- const version = "8.8.20";
22223
+ const version = "8.8.27";
22192
22224
  const existingVersion = globalThis.deck && globalThis.deck.VERSION;
22193
22225
  if (existingVersion && existingVersion !== version) {
22194
22226
  throw new Error("deck.gl - multiple versions detected: ".concat(existingVersion, " vs ").concat(version));
@@ -23387,9 +23419,8 @@ function cssToDeviceRatio(gl) {
23387
23419
  luma
23388
23420
  } = gl;
23389
23421
  if (gl.canvas && luma) {
23390
- const {
23391
- clientWidth
23392
- } = luma.canvasSizeInfo;
23422
+ const cachedSize = luma.canvasSizeInfo;
23423
+ const clientWidth = "clientWidth" in cachedSize ? cachedSize.clientWidth : gl.canvas.clientWidth;
23393
23424
  return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;
23394
23425
  }
23395
23426
  return 1;
@@ -23645,7 +23676,7 @@ function setDevicePixelRatio(gl, devicePixelRatio, options) {
23645
23676
  });
23646
23677
  }
23647
23678
  }
23648
- const VERSION$7 = "8.5.16";
23679
+ const VERSION$7 = "8.5.21";
23649
23680
  const STARTUP_MESSAGE = "set luma.log.level=1 (or higher) to trace rendering";
23650
23681
  class StatsManager {
23651
23682
  constructor() {
@@ -23766,7 +23797,6 @@ let Resource$1 = class Resource {
23766
23797
  this._handle = this._createHandle();
23767
23798
  }
23768
23799
  this.byteLength = 0;
23769
- this._initStats();
23770
23800
  this._addStats();
23771
23801
  }
23772
23802
  toString() {
@@ -23902,9 +23932,6 @@ let Resource$1 = class Resource {
23902
23932
  this.gl.luma = this.gl.luma || {};
23903
23933
  return this.gl.luma;
23904
23934
  }
23905
- _initStats() {
23906
- this.gl.stats = this.gl.stats || new StatsManager();
23907
- }
23908
23935
  _addStats() {
23909
23936
  const name2 = this[Symbol.toStringTag];
23910
23937
  const stats = lumaStats.get("Resource Counts");
@@ -23919,27 +23946,29 @@ let Resource$1 = class Resource {
23919
23946
  }
23920
23947
  _trackAllocatedMemory(bytes) {
23921
23948
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
23922
- this._doTrackAllocatedMemory(bytes, name2);
23923
- this._doTrackAllocatedMemory(bytes, name2, this.gl.stats.get("Memory Usage"));
23949
+ this._trackAllocatedMemoryForContext(bytes, name2);
23950
+ this._trackAllocatedMemoryForContext(bytes, name2, this.gl.canvas && this.gl.canvas.id);
23951
+ this.byteLength = bytes;
23924
23952
  }
23925
- _doTrackAllocatedMemory(bytes) {
23953
+ _trackAllocatedMemoryForContext(bytes) {
23926
23954
  let name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this[Symbol.toStringTag];
23927
- let stats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lumaStats.get("Memory Usage");
23955
+ let id = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
23956
+ const stats = lumaStats.get("Memory Usage".concat(id));
23928
23957
  stats.get("GPU Memory").addCount(bytes);
23929
23958
  stats.get("".concat(name2, " Memory")).addCount(bytes);
23930
- this.byteLength = bytes;
23931
23959
  }
23932
23960
  _trackDeallocatedMemory() {
23933
23961
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
23934
- this._doTrackDeallocatedMemory(name2);
23935
- this._doTrackDeallocatedMemory(name2, this.gl.stats.get("Memory Usage"));
23962
+ this._trackDeallocatedMemoryForContext(name2);
23963
+ this._trackDeallocatedMemoryForContext(name2, this.gl.canvas && this.gl.canvas.id);
23964
+ this.byteLength = 0;
23936
23965
  }
23937
- _doTrackDeallocatedMemory() {
23966
+ _trackDeallocatedMemoryForContext() {
23938
23967
  let name2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this[Symbol.toStringTag];
23939
- let stats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : lumaStats.get("Memory Usage");
23968
+ let id = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
23969
+ const stats = lumaStats.get("Memory Usage".concat(id));
23940
23970
  stats.get("GPU Memory").subtractCount(this.byteLength);
23941
23971
  stats.get("".concat(name2, " Memory")).subtractCount(this.byteLength);
23942
- this.byteLength = 0;
23943
23972
  }
23944
23973
  };
23945
23974
  const ERR_TYPE_DEDUCTION = "Failed to deduce GL constant from typed array";
@@ -37155,6 +37184,7 @@ const picking = {
37155
37184
  inject: {
37156
37185
  "vs:DECKGL_FILTER_GL_POSITION": "\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n ",
37157
37186
  "vs:DECKGL_FILTER_COLOR": "\n picking_setPickingColor(geometry.pickingColor);\n ",
37187
+ "fs:#decl": "\nuniform bool picking_uAttribute;\n ",
37158
37188
  "fs:DECKGL_FILTER_COLOR": {
37159
37189
  order: 99,
37160
37190
  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 "
@@ -37965,6 +37995,9 @@ class Viewport {
37965
37995
  this.projectFlat = this.projectFlat.bind(this);
37966
37996
  this.unprojectFlat = this.unprojectFlat.bind(this);
37967
37997
  }
37998
+ get subViewports() {
37999
+ return null;
38000
+ }
37968
38001
  get metersPerPixel() {
37969
38002
  return this.distanceScales.metersPerUnit[2] / this.scale;
37970
38003
  }
@@ -46856,7 +46889,7 @@ class Attribute extends DataColumn {
46856
46889
  const {
46857
46890
  startIndices
46858
46891
  } = this;
46859
- const vertexIndex = startIndices ? startIndices[row] : row;
46892
+ const vertexIndex = startIndices ? row < startIndices.length ? startIndices[row] : this.numInstances : row;
46860
46893
  return vertexIndex * this.size;
46861
46894
  }
46862
46895
  getShaderAttributes() {
@@ -49500,7 +49533,7 @@ class Layer extends Component {
49500
49533
  if (Array.isArray(highlightColor)) {
49501
49534
  parameters.pickingHighlightColor = highlightColor;
49502
49535
  }
49503
- if (Number.isInteger(highlightedObjectIndex)) {
49536
+ if (forceUpdate || highlightedObjectIndex !== oldProps.highlightedObjectIndex) {
49504
49537
  parameters.pickingSelectedColor = Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0 ? this.encodePickingColor(highlightedObjectIndex) : null;
49505
49538
  }
49506
49539
  this.setModuleParameters(parameters);
@@ -50863,7 +50896,7 @@ function interpolateQuad(quad, ut, vt) {
50863
50896
  }
50864
50897
  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";
50865
50898
  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";
50866
- 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");
50899
+ 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");
50867
50900
  const defaultProps$I = {
50868
50901
  image: {
50869
50902
  type: "image",
@@ -59003,18 +59036,22 @@ function getBoundingBox(viewport, zRange, extent2) {
59003
59036
  }
59004
59037
  function getCullBounds({
59005
59038
  viewport,
59006
- z: z2,
59039
+ z: z2 = 0,
59007
59040
  cullRect
59008
59041
  }) {
59009
- const x2 = cullRect.x - viewport.x;
59010
- const y2 = cullRect.y - viewport.y;
59011
- const {
59012
- width,
59013
- height
59014
- } = cullRect;
59042
+ const subViewports = viewport.subViewports || [viewport];
59043
+ return subViewports.map((v) => getCullBoundsInViewport(v, z2, cullRect));
59044
+ }
59045
+ function getCullBoundsInViewport(viewport, z2, cullRect) {
59015
59046
  if (!Array.isArray(z2)) {
59047
+ const x2 = cullRect.x - viewport.x;
59048
+ const y2 = cullRect.y - viewport.y;
59049
+ const {
59050
+ width,
59051
+ height
59052
+ } = cullRect;
59016
59053
  const unprojectOption = {
59017
- targetZ: z2 || 0
59054
+ targetZ: z2
59018
59055
  };
59019
59056
  const topLeft = viewport.unproject([x2, y2], unprojectOption);
59020
59057
  const topRight = viewport.unproject([x2 + width, y2], unprojectOption);
@@ -59022,16 +59059,8 @@ function getCullBounds({
59022
59059
  const bottomRight = viewport.unproject([x2 + width, y2 + height], unprojectOption);
59023
59060
  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])];
59024
59061
  }
59025
- const bounds0 = getCullBounds({
59026
- viewport,
59027
- z: z2[0],
59028
- cullRect
59029
- });
59030
- const bounds1 = getCullBounds({
59031
- viewport,
59032
- z: z2[1],
59033
- cullRect
59034
- });
59062
+ const bounds0 = getCullBoundsInViewport(viewport, z2[0], cullRect);
59063
+ const bounds1 = getCullBoundsInViewport(viewport, z2[1], cullRect);
59035
59064
  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])];
59036
59065
  }
59037
59066
  function getIndexingCoords(bbox2, scale2, modelMatrixInverse) {
@@ -59261,7 +59290,7 @@ class Tileset2D {
59261
59290
  return false;
59262
59291
  }
59263
59292
  if (cullRect && this._viewport) {
59264
- const [minX, minY, maxX, maxY] = getCullBounds({
59293
+ const boundsArr = this._getCullBounds({
59265
59294
  viewport: this._viewport,
59266
59295
  z: this._zRange,
59267
59296
  cullRect
@@ -59269,12 +59298,20 @@ class Tileset2D {
59269
59298
  const {
59270
59299
  bbox: bbox2
59271
59300
  } = tile;
59272
- if ("west" in bbox2) {
59273
- return bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
59301
+ for (const [minX, minY, maxX, maxY] of boundsArr) {
59302
+ let overlaps;
59303
+ if ("west" in bbox2) {
59304
+ overlaps = bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
59305
+ } else {
59306
+ const y02 = Math.min(bbox2.top, bbox2.bottom);
59307
+ const y12 = Math.max(bbox2.top, bbox2.bottom);
59308
+ overlaps = bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
59309
+ }
59310
+ if (overlaps) {
59311
+ return true;
59312
+ }
59274
59313
  }
59275
- const y02 = Math.min(bbox2.top, bbox2.bottom);
59276
- const y12 = Math.max(bbox2.top, bbox2.bottom);
59277
- return bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
59314
+ return false;
59278
59315
  }
59279
59316
  return true;
59280
59317
  }
@@ -59723,14 +59760,19 @@ class TileLayer extends CompositeLayer {
59723
59760
  info,
59724
59761
  sourceLayer
59725
59762
  }) {
59763
+ const sourceTile = sourceLayer.props.tile;
59726
59764
  if (info.picked) {
59727
- info.tile = sourceLayer.props.tile;
59765
+ info.tile = sourceTile;
59728
59766
  }
59767
+ info.sourceTile = sourceTile;
59729
59768
  return info;
59730
59769
  }
59731
59770
  _updateAutoHighlight(info) {
59732
- if (info.sourceLayer) {
59733
- info.sourceLayer.updateAutoHighlight(info);
59771
+ const sourceTile = info.sourceTile;
59772
+ if (sourceTile && sourceTile.layers) {
59773
+ for (const layer of sourceTile.layers) {
59774
+ layer.updateAutoHighlight(info);
59775
+ }
59734
59776
  }
59735
59777
  }
59736
59778
  renderLayers() {
@@ -72048,6 +72090,9 @@ class ScenegraphNode {
72048
72090
  toString() {
72049
72091
  return "{type: ScenegraphNode, id: ".concat(this.id, ")}");
72050
72092
  }
72093
+ getBounds() {
72094
+ return null;
72095
+ }
72051
72096
  setPosition(position) {
72052
72097
  assert$8(position.length === 3, "setPosition requires vector argument");
72053
72098
  this.position = position;
@@ -72198,6 +72243,34 @@ class GroupNode extends ScenegraphNode {
72198
72243
  this.removeAll();
72199
72244
  super.delete();
72200
72245
  }
72246
+ getBounds() {
72247
+ const result = [[Infinity, Infinity, Infinity], [-Infinity, -Infinity, -Infinity]];
72248
+ this.traverse((node, _ref) => {
72249
+ let {
72250
+ worldMatrix
72251
+ } = _ref;
72252
+ const bounds2 = node.getBounds();
72253
+ if (!bounds2) {
72254
+ return;
72255
+ }
72256
+ const [min, max] = bounds2;
72257
+ const center2 = new Vector3(min).add(max).divide([2, 2, 2]);
72258
+ worldMatrix.transformAsPoint(center2, center2);
72259
+ const halfSize = new Vector3(max).subtract(min).divide([2, 2, 2]);
72260
+ worldMatrix.transformAsVector(halfSize, halfSize);
72261
+ for (let v = 0; v < 8; v++) {
72262
+ const position = new Vector3(v & 1 ? -1 : 1, v & 2 ? -1 : 1, v & 4 ? -1 : 1).multiply(halfSize).add(center2);
72263
+ for (let i2 = 0; i2 < 3; i2++) {
72264
+ result[0][i2] = Math.min(result[0][i2], position[i2]);
72265
+ result[1][i2] = Math.max(result[1][i2], position[i2]);
72266
+ }
72267
+ }
72268
+ });
72269
+ if (!Number.isFinite(result[0][0])) {
72270
+ return null;
72271
+ }
72272
+ return result;
72273
+ }
72201
72274
  traverse(visitor) {
72202
72275
  let {
72203
72276
  worldMatrix = new Matrix4()
@@ -72447,6 +72520,7 @@ class ModelNode extends ScenegraphNode {
72447
72520
  } else {
72448
72521
  this.model = new Model(gl, props2);
72449
72522
  }
72523
+ this.bounds = null;
72450
72524
  this.managedResources = props2.managedResources || [];
72451
72525
  }
72452
72526
  setProps(props2) {
@@ -72454,6 +72528,9 @@ class ModelNode extends ScenegraphNode {
72454
72528
  this._setModelNodeProps(props2);
72455
72529
  return this;
72456
72530
  }
72531
+ getBounds() {
72532
+ return this.bounds;
72533
+ }
72457
72534
  delete() {
72458
72535
  if (this.model) {
72459
72536
  this.model.delete();
@@ -72638,17 +72715,21 @@ function createGLTFModel(gl, options) {
72638
72715
  const managedResources = [];
72639
72716
  managedResources.push(...materialParser.generatedTextures);
72640
72717
  managedResources.push(...Object.values(attributes).map((attribute) => attribute.buffer));
72641
- const model = new ModelNode(gl, Object.assign({
72718
+ const model = new ModelNode(gl, {
72642
72719
  id,
72643
72720
  drawMode,
72644
72721
  vertexCount,
72645
72722
  modules: [pbr],
72646
- defines: materialParser.defines,
72647
72723
  parameters: materialParser.parameters,
72648
72724
  vs: addVersionToShader(gl, vs$7),
72649
72725
  fs: addVersionToShader(gl, fs$7),
72650
- managedResources
72651
- }, modelOptions));
72726
+ managedResources,
72727
+ ...modelOptions,
72728
+ defines: {
72729
+ ...materialParser.defines,
72730
+ ...modelOptions.defines
72731
+ }
72732
+ });
72652
72733
  model.setProps({
72653
72734
  attributes
72654
72735
  });
@@ -72743,13 +72824,15 @@ class GLTFInstantiator {
72743
72824
  log$2.warn("getVertexCount() not found")();
72744
72825
  }
72745
72826
  createPrimitive(gltfPrimitive, i2, gltfMesh) {
72746
- return createGLTFModel(this.gl, Object.assign({
72827
+ const model = createGLTFModel(this.gl, Object.assign({
72747
72828
  id: gltfPrimitive.name || "".concat(gltfMesh.name || gltfMesh.id, "-primitive-").concat(i2),
72748
72829
  drawMode: gltfPrimitive.mode || 4,
72749
72830
  vertexCount: gltfPrimitive.indices ? gltfPrimitive.indices.count : this.getVertexCount(gltfPrimitive.attributes),
72750
72831
  attributes: this.createAttributes(gltfPrimitive.attributes, gltfPrimitive.indices),
72751
72832
  material: gltfPrimitive.material
72752
72833
  }, this.options));
72834
+ model.bounds = [gltfPrimitive.attributes.POSITION.min, gltfPrimitive.attributes.POSITION.max];
72835
+ return model;
72753
72836
  }
72754
72837
  createAttributes(attributes, indices) {
72755
72838
  const loadedAttributes = {};
@@ -80677,15 +80760,11 @@ class Tile3DLayer extends CompositeLayer {
80677
80760
  info,
80678
80761
  sourceLayer
80679
80762
  }) {
80680
- const {
80681
- layerMap
80682
- } = this.state;
80683
- const layerId = sourceLayer && sourceLayer.id;
80684
- if (layerId) {
80685
- const substr = layerId.substring(this.id.length + 1);
80686
- const tileId = substr.substring(substr.indexOf("-") + 1);
80687
- info.object = layerMap[tileId] && layerMap[tileId].tile;
80763
+ const sourceTile = sourceLayer && sourceLayer.props.tile;
80764
+ if (info.picked) {
80765
+ info.object = sourceTile;
80688
80766
  }
80767
+ info.sourceTile = sourceTile;
80689
80768
  return info;
80690
80769
  }
80691
80770
  filterSubLayer({
@@ -80701,8 +80780,10 @@ class Tile3DLayer extends CompositeLayer {
80701
80780
  return tile.selected && tile.viewportIds.includes(viewportId);
80702
80781
  }
80703
80782
  _updateAutoHighlight(info) {
80704
- if (info.sourceLayer) {
80705
- info.sourceLayer.updateAutoHighlight(info);
80783
+ const sourceTile = info.sourceTile;
80784
+ const layerCache = this.state.layerMap[sourceTile === null || sourceTile === void 0 ? void 0 : sourceTile.id];
80785
+ if (layerCache && layerCache.layer) {
80786
+ layerCache.layer.updateAutoHighlight(info);
80706
80787
  }
80707
80788
  }
80708
80789
  async _loadTileset(tilesetUrl) {
@@ -121180,16 +121261,16 @@ function addDecoder(cases, importFn) {
121180
121261
  }
121181
121262
  cases.forEach((c2) => registry$1.set(c2, importFn));
121182
121263
  }
121183
- addDecoder([void 0, 1], () => import("./raw-562e7d1c.js").then((m2) => m2.default));
121184
- addDecoder(5, () => import("./lzw-0659de0e.js").then((m2) => m2.default));
121264
+ addDecoder([void 0, 1], () => import("./raw-87e3335a.js").then((m2) => m2.default));
121265
+ addDecoder(5, () => import("./lzw-7366b7df.js").then((m2) => m2.default));
121185
121266
  addDecoder(6, () => {
121186
121267
  throw new Error("old style JPEG compression is not supported.");
121187
121268
  });
121188
- addDecoder(7, () => import("./jpeg-0c6f4d5b.js").then((m2) => m2.default));
121189
- addDecoder([8, 32946], () => import("./deflate-49eb8bd8.js").then((m2) => m2.default));
121190
- addDecoder(32773, () => import("./packbits-f0484b5e.js").then((m2) => m2.default));
121191
- addDecoder(34887, () => import("./lerc-157806a7.js").then((m2) => m2.default));
121192
- addDecoder(50001, () => import("./webimage-ab07cd7f.js").then((m2) => m2.default));
121269
+ addDecoder(7, () => import("./jpeg-da8c250c.js").then((m2) => m2.default));
121270
+ addDecoder([8, 32946], () => import("./deflate-fd4358a6.js").then((m2) => m2.default));
121271
+ addDecoder(32773, () => import("./packbits-8da18e40.js").then((m2) => m2.default));
121272
+ addDecoder(34887, () => import("./lerc-d5bf01c3.js").then((m2) => m2.default));
121273
+ addDecoder(50001, () => import("./webimage-6b9ff4dc.js").then((m2) => m2.default));
121193
121274
  function decodeRowAcc(row, stride) {
121194
121275
  let length2 = row.length - stride;
121195
121276
  let offset5 = 0;
@@ -145530,9 +145611,9 @@ function Legend(props2) {
145530
145611
  const hasSubLabel = subLabel !== null;
145531
145612
  if (!isSetColor) {
145532
145613
  g2.append("text").attr("text-anchor", hasSubLabel ? "start" : "end").attr("dominant-baseline", "hanging").attr("x", hasSubLabel ? 0 : width).attr("y", 0).text(mainLabel).style("font-size", "10px").style("fill", foregroundColor);
145533
- }
145534
- if (hasSubLabel) {
145535
- g2.append("text").attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("x", width).attr("y", titleHeight).text(subLabel).style("font-size", "9px").style("fill", foregroundColor);
145614
+ if (hasSubLabel) {
145615
+ g2.append("text").attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("x", width).attr("y", titleHeight).text(subLabel).style("font-size", "9px").style("fill", foregroundColor);
145616
+ }
145536
145617
  }
145537
145618
  }, [
145538
145619
  width,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E } from "./index-c4323615.js";
1
+ import { E } from "./index-1989acf5.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-c4323615.js";
1
+ import { B as BaseDecoder } from "./index-1989acf5.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-c4323615.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-1989acf5.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-c4323615.js";
1
+ import { B as BaseDecoder } from "./index-1989acf5.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-c4323615.js";
1
+ import { B as BaseDecoder } from "./index-1989acf5.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-c4323615.js";
1
+ import { B as BaseDecoder } from "./index-1989acf5.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-c4323615.js";
1
+ import { B as BaseDecoder } from "./index-1989acf5.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/scatterplot-embedding",
3
- "version": "3.2.2",
3
+ "version": "3.3.1",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,12 +20,12 @@
20
20
  "d3-array": "^2.4.0",
21
21
  "lodash-es": "^4.17.21",
22
22
  "react-aria": "^3.28.0",
23
- "@vitessce/constants-internal": "3.2.2",
24
- "@vitessce/legend": "3.2.2",
25
- "@vitessce/scatterplot": "3.2.2",
26
- "@vitessce/sets-utils": "3.2.2",
27
- "@vitessce/utils": "3.2.2",
28
- "@vitessce/vit-s": "3.2.2"
23
+ "@vitessce/constants-internal": "3.3.1",
24
+ "@vitessce/scatterplot": "3.3.1",
25
+ "@vitessce/legend": "3.3.1",
26
+ "@vitessce/sets-utils": "3.3.1",
27
+ "@vitessce/utils": "3.3.1",
28
+ "@vitessce/vit-s": "3.3.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "react": "^18.0.0",