@vitessce/layer-controller 4.1.2 → 4.2.0

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-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-KPdFdtqD.js";
2
+ import { B as BaseDecoder } from "./index-mXavO7HF.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -22487,6 +22487,8 @@ const CoordinationType = {
22487
22487
  SPATIAL_SEGMENTATION_FILLED: "spatialSegmentationFilled",
22488
22488
  SPATIAL_SEGMENTATION_STROKE_WIDTH: "spatialSegmentationStrokeWidth",
22489
22489
  SPATIAL_POINT_STROKE_WIDTH: "spatialPointStrokeWidth",
22490
+ SPATIAL_POINT_RADIUS: "spatialPointRadius",
22491
+ SPATIAL_POINT_PROJECTION_SPACING: "spatialPointProjectionSpacing",
22490
22492
  SPATIAL_CHANNEL_COLOR: "spatialChannelColor",
22491
22493
  SPATIAL_CHANNEL_VISIBLE: "spatialChannelVisible",
22492
22494
  SPATIAL_CHANNEL_OPACITY: "spatialChannelOpacity",
@@ -22501,6 +22503,12 @@ const CoordinationType = {
22501
22503
  // Per-spatial-layer
22502
22504
  SPATIAL_MAX_RESOLUTION: "spatialMaxResolution",
22503
22505
  // Per-image-channel (for spatial-accelerated)
22506
+ SPATIAL_AXIS_LINES_VISIBLE: "spatialAxisLinesVisible",
22507
+ // axisLines' visibility in Neuroglancer View
22508
+ SPATIAL_BOUNDS_VISIBLE: "spatialBoundsVisible",
22509
+ // annotationBounds' visibility in Neuroglancer View
22510
+ SPATIAL_SCALE_BAR_VISIBLE: "spatialScaleBarVisible",
22511
+ SPATIAL_BACKGROUND_THEME: "spatialBackgroundTheme",
22504
22512
  // For clipping plane sliders
22505
22513
  SPATIAL_SLICE_X: "spatialSliceX",
22506
22514
  SPATIAL_SLICE_Y: "spatialSliceY",
@@ -22510,6 +22518,7 @@ const CoordinationType = {
22510
22518
  POINT_LAYER: "pointLayer",
22511
22519
  SPATIAL_SPOT_RADIUS: "spatialSpotRadius",
22512
22520
  // In micrometers?
22521
+ SPATIAL_SPOT_SHAPE: "spatialSpotShape",
22513
22522
  SPATIAL_SPOT_FILLED: "spatialSpotFilled",
22514
22523
  SPATIAL_SPOT_STROKE_WIDTH: "spatialSpotStrokeWidth",
22515
22524
  SPATIAL_LAYER_COLOR: "spatialLayerColor",
@@ -22606,7 +22615,13 @@ const COMPONENT_COORDINATION_TYPES = {
22606
22615
  CoordinationType.SPATIAL_CHANNEL_OPACITY,
22607
22616
  CoordinationType.SPATIAL_CHANNEL_VISIBLE,
22608
22617
  CoordinationType.LEGEND_VISIBLE,
22609
- CoordinationType.SPATIAL_POINT_STROKE_WIDTH
22618
+ CoordinationType.SPATIAL_POINT_STROKE_WIDTH,
22619
+ CoordinationType.SPATIAL_POINT_RADIUS,
22620
+ CoordinationType.SPATIAL_AXIS_LINES_VISIBLE,
22621
+ CoordinationType.SPATIAL_BOUNDS_VISIBLE,
22622
+ CoordinationType.SPATIAL_POINT_PROJECTION_SPACING,
22623
+ CoordinationType.SPATIAL_SCALE_BAR_VISIBLE,
22624
+ CoordinationType.SPATIAL_BACKGROUND_THEME
22610
22625
  ],
22611
22626
  [ViewType.SCATTERPLOT]: [
22612
22627
  CoordinationType.DATASET,
@@ -22855,6 +22870,7 @@ const COMPONENT_COORDINATION_TYPES = {
22855
22870
  CoordinationType.SPOT_LAYER,
22856
22871
  CoordinationType.POINT_LAYER,
22857
22872
  CoordinationType.SPATIAL_SPOT_RADIUS,
22873
+ CoordinationType.SPATIAL_SPOT_SHAPE,
22858
22874
  CoordinationType.SPATIAL_SPOT_FILLED,
22859
22875
  CoordinationType.SPATIAL_SPOT_STROKE_WIDTH,
22860
22876
  CoordinationType.SPATIAL_LAYER_COLOR,
@@ -22872,7 +22888,10 @@ const COMPONENT_COORDINATION_TYPES = {
22872
22888
  CoordinationType.ANNOTATION_OVERLAY_VISIBLE,
22873
22889
  CoordinationType.ANNOTATION_TRANSITION_DURATION,
22874
22890
  CoordinationType.ANNOTATION_EDITABLE,
22875
- CoordinationType.ANNOTATION_SEMANTIC_ZOOM
22891
+ CoordinationType.ANNOTATION_SEMANTIC_ZOOM,
22892
+ CoordinationType.SPATIAL_POINT_RADIUS,
22893
+ CoordinationType.SPATIAL_POINT_STROKE_WIDTH,
22894
+ CoordinationType.SPATIAL_BACKGROUND_THEME
22876
22895
  ],
22877
22896
  [ViewType.ANNOTATION_CONTROLLER]: [
22878
22897
  CoordinationType.DATASET,
@@ -23037,6 +23056,7 @@ const COMPONENT_COORDINATION_TYPES = {
23037
23056
  CoordinationType.SPATIAL_SEGMENTATION_FILLED,
23038
23057
  CoordinationType.SPATIAL_SEGMENTATION_STROKE_WIDTH,
23039
23058
  CoordinationType.SPATIAL_POINT_STROKE_WIDTH,
23059
+ CoordinationType.SPATIAL_POINT_RADIUS,
23040
23060
  CoordinationType.IMAGE_CHANNEL,
23041
23061
  CoordinationType.IMAGE_LAYER,
23042
23062
  CoordinationType.SEGMENTATION_CHANNEL,
@@ -23055,6 +23075,7 @@ const COMPONENT_COORDINATION_TYPES = {
23055
23075
  CoordinationType.SPOT_LAYER,
23056
23076
  CoordinationType.POINT_LAYER,
23057
23077
  CoordinationType.SPATIAL_SPOT_RADIUS,
23078
+ CoordinationType.SPATIAL_SPOT_SHAPE,
23058
23079
  CoordinationType.SPATIAL_SPOT_FILLED,
23059
23080
  CoordinationType.SPATIAL_SPOT_STROKE_WIDTH,
23060
23081
  CoordinationType.SPATIAL_LAYER_COLOR,
@@ -106044,223 +106065,373 @@ function requireLayerMouseEvent() {
106044
106065
  return layerMouseEvent;
106045
106066
  }
106046
106067
  var nebulaLayer = {};
106047
- var events;
106068
+ var events = { exports: {} };
106048
106069
  var hasRequiredEvents;
106049
106070
  function requireEvents() {
106050
- if (hasRequiredEvents) return events;
106071
+ if (hasRequiredEvents) return events.exports;
106051
106072
  hasRequiredEvents = 1;
106073
+ var R = typeof Reflect === "object" ? Reflect : null;
106074
+ var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
106075
+ return Function.prototype.apply.call(target, receiver, args);
106076
+ };
106077
+ var ReflectOwnKeys;
106078
+ if (R && typeof R.ownKeys === "function") {
106079
+ ReflectOwnKeys = R.ownKeys;
106080
+ } else if (Object.getOwnPropertySymbols) {
106081
+ ReflectOwnKeys = function ReflectOwnKeys2(target) {
106082
+ return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
106083
+ };
106084
+ } else {
106085
+ ReflectOwnKeys = function ReflectOwnKeys2(target) {
106086
+ return Object.getOwnPropertyNames(target);
106087
+ };
106088
+ }
106089
+ function ProcessEmitWarning(warning) {
106090
+ if (console && console.warn) console.warn(warning);
106091
+ }
106092
+ var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
106093
+ return value !== value;
106094
+ };
106052
106095
  function EventEmitter() {
106053
- this._events = this._events || {};
106054
- this._maxListeners = this._maxListeners || void 0;
106096
+ EventEmitter.init.call(this);
106055
106097
  }
106056
- events = EventEmitter;
106098
+ events.exports = EventEmitter;
106099
+ events.exports.once = once;
106057
106100
  EventEmitter.EventEmitter = EventEmitter;
106058
106101
  EventEmitter.prototype._events = void 0;
106102
+ EventEmitter.prototype._eventsCount = 0;
106059
106103
  EventEmitter.prototype._maxListeners = void 0;
106060
- EventEmitter.defaultMaxListeners = 10;
106061
- EventEmitter.prototype.setMaxListeners = function(n2) {
106062
- if (!isNumber2(n2) || n2 < 0 || isNaN(n2))
106063
- throw TypeError("n must be a positive number");
106104
+ var defaultMaxListeners = 10;
106105
+ function checkListener(listener) {
106106
+ if (typeof listener !== "function") {
106107
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
106108
+ }
106109
+ }
106110
+ Object.defineProperty(EventEmitter, "defaultMaxListeners", {
106111
+ enumerable: true,
106112
+ get: function() {
106113
+ return defaultMaxListeners;
106114
+ },
106115
+ set: function(arg2) {
106116
+ if (typeof arg2 !== "number" || arg2 < 0 || NumberIsNaN(arg2)) {
106117
+ throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg2 + ".");
106118
+ }
106119
+ defaultMaxListeners = arg2;
106120
+ }
106121
+ });
106122
+ EventEmitter.init = function() {
106123
+ if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
106124
+ this._events = /* @__PURE__ */ Object.create(null);
106125
+ this._eventsCount = 0;
106126
+ }
106127
+ this._maxListeners = this._maxListeners || void 0;
106128
+ };
106129
+ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n2) {
106130
+ if (typeof n2 !== "number" || n2 < 0 || NumberIsNaN(n2)) {
106131
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + ".");
106132
+ }
106064
106133
  this._maxListeners = n2;
106065
106134
  return this;
106066
106135
  };
106067
- EventEmitter.prototype.emit = function(type) {
106068
- var er, handler, len2, args, i2, listeners;
106069
- if (!this._events)
106070
- this._events = {};
106071
- if (type === "error") {
106072
- if (!this._events.error || isObject2(this._events.error) && !this._events.error.length) {
106073
- er = arguments[1];
106074
- if (er instanceof Error) {
106075
- throw er;
106076
- } else {
106077
- var err2 = new Error('Uncaught, unspecified "error" event. (' + er + ")");
106078
- err2.context = er;
106079
- throw err2;
106080
- }
106081
- }
106082
- }
106083
- handler = this._events[type];
106084
- if (isUndefined(handler))
106136
+ function _getMaxListeners(that) {
106137
+ if (that._maxListeners === void 0)
106138
+ return EventEmitter.defaultMaxListeners;
106139
+ return that._maxListeners;
106140
+ }
106141
+ EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
106142
+ return _getMaxListeners(this);
106143
+ };
106144
+ EventEmitter.prototype.emit = function emit(type) {
106145
+ var args = [];
106146
+ for (var i2 = 1; i2 < arguments.length; i2++) args.push(arguments[i2]);
106147
+ var doError = type === "error";
106148
+ var events2 = this._events;
106149
+ if (events2 !== void 0)
106150
+ doError = doError && events2.error === void 0;
106151
+ else if (!doError)
106085
106152
  return false;
106086
- if (isFunction2(handler)) {
106087
- switch (arguments.length) {
106088
- // fast cases
106089
- case 1:
106090
- handler.call(this);
106091
- break;
106092
- case 2:
106093
- handler.call(this, arguments[1]);
106094
- break;
106095
- case 3:
106096
- handler.call(this, arguments[1], arguments[2]);
106097
- break;
106098
- // slower
106099
- default:
106100
- args = Array.prototype.slice.call(arguments, 1);
106101
- handler.apply(this, args);
106102
- }
106103
- } else if (isObject2(handler)) {
106104
- args = Array.prototype.slice.call(arguments, 1);
106105
- listeners = handler.slice();
106106
- len2 = listeners.length;
106107
- for (i2 = 0; i2 < len2; i2++)
106108
- listeners[i2].apply(this, args);
106153
+ if (doError) {
106154
+ var er;
106155
+ if (args.length > 0)
106156
+ er = args[0];
106157
+ if (er instanceof Error) {
106158
+ throw er;
106159
+ }
106160
+ var err2 = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
106161
+ err2.context = er;
106162
+ throw err2;
106163
+ }
106164
+ var handler = events2[type];
106165
+ if (handler === void 0)
106166
+ return false;
106167
+ if (typeof handler === "function") {
106168
+ ReflectApply(handler, this, args);
106169
+ } else {
106170
+ var len2 = handler.length;
106171
+ var listeners = arrayClone(handler, len2);
106172
+ for (var i2 = 0; i2 < len2; ++i2)
106173
+ ReflectApply(listeners[i2], this, args);
106109
106174
  }
106110
106175
  return true;
106111
106176
  };
106112
- EventEmitter.prototype.addListener = function(type, listener) {
106177
+ function _addListener(target, type, listener, prepend) {
106113
106178
  var m;
106114
- if (!isFunction2(listener))
106115
- throw TypeError("listener must be a function");
106116
- if (!this._events)
106117
- this._events = {};
106118
- if (this._events.newListener)
106119
- this.emit(
106120
- "newListener",
106121
- type,
106122
- isFunction2(listener.listener) ? listener.listener : listener
106123
- );
106124
- if (!this._events[type])
106125
- this._events[type] = listener;
106126
- else if (isObject2(this._events[type]))
106127
- this._events[type].push(listener);
106128
- else
106129
- this._events[type] = [this._events[type], listener];
106130
- if (isObject2(this._events[type]) && !this._events[type].warned) {
106131
- if (!isUndefined(this._maxListeners)) {
106132
- m = this._maxListeners;
106179
+ var events2;
106180
+ var existing;
106181
+ checkListener(listener);
106182
+ events2 = target._events;
106183
+ if (events2 === void 0) {
106184
+ events2 = target._events = /* @__PURE__ */ Object.create(null);
106185
+ target._eventsCount = 0;
106186
+ } else {
106187
+ if (events2.newListener !== void 0) {
106188
+ target.emit(
106189
+ "newListener",
106190
+ type,
106191
+ listener.listener ? listener.listener : listener
106192
+ );
106193
+ events2 = target._events;
106194
+ }
106195
+ existing = events2[type];
106196
+ }
106197
+ if (existing === void 0) {
106198
+ existing = events2[type] = listener;
106199
+ ++target._eventsCount;
106200
+ } else {
106201
+ if (typeof existing === "function") {
106202
+ existing = events2[type] = prepend ? [listener, existing] : [existing, listener];
106203
+ } else if (prepend) {
106204
+ existing.unshift(listener);
106133
106205
  } else {
106134
- m = EventEmitter.defaultMaxListeners;
106206
+ existing.push(listener);
106135
106207
  }
106136
- if (m && m > 0 && this._events[type].length > m) {
106137
- this._events[type].warned = true;
106138
- console.error(
106139
- "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
106140
- this._events[type].length
106141
- );
106142
- if (typeof console.trace === "function") {
106143
- console.trace();
106144
- }
106208
+ m = _getMaxListeners(target);
106209
+ if (m > 0 && existing.length > m && !existing.warned) {
106210
+ existing.warned = true;
106211
+ var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
106212
+ w2.name = "MaxListenersExceededWarning";
106213
+ w2.emitter = target;
106214
+ w2.type = type;
106215
+ w2.count = existing.length;
106216
+ ProcessEmitWarning(w2);
106145
106217
  }
106146
106218
  }
106147
- return this;
106219
+ return target;
106220
+ }
106221
+ EventEmitter.prototype.addListener = function addListener(type, listener) {
106222
+ return _addListener(this, type, listener, false);
106148
106223
  };
106149
106224
  EventEmitter.prototype.on = EventEmitter.prototype.addListener;
106150
- EventEmitter.prototype.once = function(type, listener) {
106151
- if (!isFunction2(listener))
106152
- throw TypeError("listener must be a function");
106153
- var fired = false;
106154
- function g2() {
106155
- this.removeListener(type, g2);
106156
- if (!fired) {
106157
- fired = true;
106158
- listener.apply(this, arguments);
106159
- }
106160
- }
106161
- g2.listener = listener;
106162
- this.on(type, g2);
106225
+ EventEmitter.prototype.prependListener = function prependListener(type, listener) {
106226
+ return _addListener(this, type, listener, true);
106227
+ };
106228
+ function onceWrapper() {
106229
+ if (!this.fired) {
106230
+ this.target.removeListener(this.type, this.wrapFn);
106231
+ this.fired = true;
106232
+ if (arguments.length === 0)
106233
+ return this.listener.call(this.target);
106234
+ return this.listener.apply(this.target, arguments);
106235
+ }
106236
+ }
106237
+ function _onceWrap(target, type, listener) {
106238
+ var state = { fired: false, wrapFn: void 0, target, type, listener };
106239
+ var wrapped = onceWrapper.bind(state);
106240
+ wrapped.listener = listener;
106241
+ state.wrapFn = wrapped;
106242
+ return wrapped;
106243
+ }
106244
+ EventEmitter.prototype.once = function once2(type, listener) {
106245
+ checkListener(listener);
106246
+ this.on(type, _onceWrap(this, type, listener));
106247
+ return this;
106248
+ };
106249
+ EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
106250
+ checkListener(listener);
106251
+ this.prependListener(type, _onceWrap(this, type, listener));
106163
106252
  return this;
106164
106253
  };
106165
- EventEmitter.prototype.removeListener = function(type, listener) {
106166
- var list, position2, length2, i2;
106167
- if (!isFunction2(listener))
106168
- throw TypeError("listener must be a function");
106169
- if (!this._events || !this._events[type])
106254
+ EventEmitter.prototype.removeListener = function removeListener(type, listener) {
106255
+ var list, events2, position2, i2, originalListener;
106256
+ checkListener(listener);
106257
+ events2 = this._events;
106258
+ if (events2 === void 0)
106170
106259
  return this;
106171
- list = this._events[type];
106172
- length2 = list.length;
106173
- position2 = -1;
106174
- if (list === listener || isFunction2(list.listener) && list.listener === listener) {
106175
- delete this._events[type];
106176
- if (this._events.removeListener)
106177
- this.emit("removeListener", type, listener);
106178
- } else if (isObject2(list)) {
106179
- for (i2 = length2; i2-- > 0; ) {
106180
- if (list[i2] === listener || list[i2].listener && list[i2].listener === listener) {
106260
+ list = events2[type];
106261
+ if (list === void 0)
106262
+ return this;
106263
+ if (list === listener || list.listener === listener) {
106264
+ if (--this._eventsCount === 0)
106265
+ this._events = /* @__PURE__ */ Object.create(null);
106266
+ else {
106267
+ delete events2[type];
106268
+ if (events2.removeListener)
106269
+ this.emit("removeListener", type, list.listener || listener);
106270
+ }
106271
+ } else if (typeof list !== "function") {
106272
+ position2 = -1;
106273
+ for (i2 = list.length - 1; i2 >= 0; i2--) {
106274
+ if (list[i2] === listener || list[i2].listener === listener) {
106275
+ originalListener = list[i2].listener;
106181
106276
  position2 = i2;
106182
106277
  break;
106183
106278
  }
106184
106279
  }
106185
106280
  if (position2 < 0)
106186
106281
  return this;
106187
- if (list.length === 1) {
106188
- list.length = 0;
106189
- delete this._events[type];
106190
- } else {
106191
- list.splice(position2, 1);
106282
+ if (position2 === 0)
106283
+ list.shift();
106284
+ else {
106285
+ spliceOne(list, position2);
106192
106286
  }
106193
- if (this._events.removeListener)
106194
- this.emit("removeListener", type, listener);
106287
+ if (list.length === 1)
106288
+ events2[type] = list[0];
106289
+ if (events2.removeListener !== void 0)
106290
+ this.emit("removeListener", type, originalListener || listener);
106195
106291
  }
106196
106292
  return this;
106197
106293
  };
106198
- EventEmitter.prototype.removeAllListeners = function(type) {
106199
- var key, listeners;
106200
- if (!this._events)
106294
+ EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
106295
+ EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
106296
+ var listeners, events2, i2;
106297
+ events2 = this._events;
106298
+ if (events2 === void 0)
106201
106299
  return this;
106202
- if (!this._events.removeListener) {
106203
- if (arguments.length === 0)
106204
- this._events = {};
106205
- else if (this._events[type])
106206
- delete this._events[type];
106300
+ if (events2.removeListener === void 0) {
106301
+ if (arguments.length === 0) {
106302
+ this._events = /* @__PURE__ */ Object.create(null);
106303
+ this._eventsCount = 0;
106304
+ } else if (events2[type] !== void 0) {
106305
+ if (--this._eventsCount === 0)
106306
+ this._events = /* @__PURE__ */ Object.create(null);
106307
+ else
106308
+ delete events2[type];
106309
+ }
106207
106310
  return this;
106208
106311
  }
106209
106312
  if (arguments.length === 0) {
106210
- for (key in this._events) {
106313
+ var keys2 = Object.keys(events2);
106314
+ var key;
106315
+ for (i2 = 0; i2 < keys2.length; ++i2) {
106316
+ key = keys2[i2];
106211
106317
  if (key === "removeListener") continue;
106212
106318
  this.removeAllListeners(key);
106213
106319
  }
106214
106320
  this.removeAllListeners("removeListener");
106215
- this._events = {};
106321
+ this._events = /* @__PURE__ */ Object.create(null);
106322
+ this._eventsCount = 0;
106216
106323
  return this;
106217
106324
  }
106218
- listeners = this._events[type];
106219
- if (isFunction2(listeners)) {
106325
+ listeners = events2[type];
106326
+ if (typeof listeners === "function") {
106220
106327
  this.removeListener(type, listeners);
106221
- } else if (listeners) {
106222
- while (listeners.length)
106223
- this.removeListener(type, listeners[listeners.length - 1]);
106328
+ } else if (listeners !== void 0) {
106329
+ for (i2 = listeners.length - 1; i2 >= 0; i2--) {
106330
+ this.removeListener(type, listeners[i2]);
106331
+ }
106224
106332
  }
106225
- delete this._events[type];
106226
106333
  return this;
106227
106334
  };
106228
- EventEmitter.prototype.listeners = function(type) {
106229
- var ret;
106230
- if (!this._events || !this._events[type])
106231
- ret = [];
106232
- else if (isFunction2(this._events[type]))
106233
- ret = [this._events[type]];
106234
- else
106235
- ret = this._events[type].slice();
106236
- return ret;
106335
+ function _listeners(target, type, unwrap) {
106336
+ var events2 = target._events;
106337
+ if (events2 === void 0)
106338
+ return [];
106339
+ var evlistener = events2[type];
106340
+ if (evlistener === void 0)
106341
+ return [];
106342
+ if (typeof evlistener === "function")
106343
+ return unwrap ? [evlistener.listener || evlistener] : [evlistener];
106344
+ return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
106345
+ }
106346
+ EventEmitter.prototype.listeners = function listeners(type) {
106347
+ return _listeners(this, type, true);
106348
+ };
106349
+ EventEmitter.prototype.rawListeners = function rawListeners(type) {
106350
+ return _listeners(this, type, false);
106237
106351
  };
106238
- EventEmitter.prototype.listenerCount = function(type) {
106239
- if (this._events) {
106240
- var evlistener = this._events[type];
106241
- if (isFunction2(evlistener))
106352
+ EventEmitter.listenerCount = function(emitter, type) {
106353
+ if (typeof emitter.listenerCount === "function") {
106354
+ return emitter.listenerCount(type);
106355
+ } else {
106356
+ return listenerCount.call(emitter, type);
106357
+ }
106358
+ };
106359
+ EventEmitter.prototype.listenerCount = listenerCount;
106360
+ function listenerCount(type) {
106361
+ var events2 = this._events;
106362
+ if (events2 !== void 0) {
106363
+ var evlistener = events2[type];
106364
+ if (typeof evlistener === "function") {
106242
106365
  return 1;
106243
- else if (evlistener)
106366
+ } else if (evlistener !== void 0) {
106244
106367
  return evlistener.length;
106368
+ }
106245
106369
  }
106246
106370
  return 0;
106371
+ }
106372
+ EventEmitter.prototype.eventNames = function eventNames() {
106373
+ return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
106247
106374
  };
106248
- EventEmitter.listenerCount = function(emitter, type) {
106249
- return emitter.listenerCount(type);
106250
- };
106251
- function isFunction2(arg2) {
106252
- return typeof arg2 === "function";
106375
+ function arrayClone(arr, n2) {
106376
+ var copy2 = new Array(n2);
106377
+ for (var i2 = 0; i2 < n2; ++i2)
106378
+ copy2[i2] = arr[i2];
106379
+ return copy2;
106253
106380
  }
106254
- function isNumber2(arg2) {
106255
- return typeof arg2 === "number";
106381
+ function spliceOne(list, index2) {
106382
+ for (; index2 + 1 < list.length; index2++)
106383
+ list[index2] = list[index2 + 1];
106384
+ list.pop();
106385
+ }
106386
+ function unwrapListeners(arr) {
106387
+ var ret = new Array(arr.length);
106388
+ for (var i2 = 0; i2 < ret.length; ++i2) {
106389
+ ret[i2] = arr[i2].listener || arr[i2];
106390
+ }
106391
+ return ret;
106392
+ }
106393
+ function once(emitter, name2) {
106394
+ return new Promise(function(resolve, reject) {
106395
+ function errorListener(err2) {
106396
+ emitter.removeListener(name2, resolver);
106397
+ reject(err2);
106398
+ }
106399
+ function resolver() {
106400
+ if (typeof emitter.removeListener === "function") {
106401
+ emitter.removeListener("error", errorListener);
106402
+ }
106403
+ resolve([].slice.call(arguments));
106404
+ }
106405
+ eventTargetAgnosticAddListener(emitter, name2, resolver, { once: true });
106406
+ if (name2 !== "error") {
106407
+ addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
106408
+ }
106409
+ });
106256
106410
  }
106257
- function isObject2(arg2) {
106258
- return typeof arg2 === "object" && arg2 !== null;
106411
+ function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
106412
+ if (typeof emitter.on === "function") {
106413
+ eventTargetAgnosticAddListener(emitter, "error", handler, flags);
106414
+ }
106259
106415
  }
106260
- function isUndefined(arg2) {
106261
- return arg2 === void 0;
106416
+ function eventTargetAgnosticAddListener(emitter, name2, listener, flags) {
106417
+ if (typeof emitter.on === "function") {
106418
+ if (flags.once) {
106419
+ emitter.once(name2, listener);
106420
+ } else {
106421
+ emitter.on(name2, listener);
106422
+ }
106423
+ } else if (typeof emitter.addEventListener === "function") {
106424
+ emitter.addEventListener(name2, function wrapListener(arg2) {
106425
+ if (flags.once) {
106426
+ emitter.removeEventListener(name2, wrapListener);
106427
+ }
106428
+ listener(arg2);
106429
+ });
106430
+ } else {
106431
+ throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
106432
+ }
106262
106433
  }
106263
- return events;
106434
+ return events.exports;
106264
106435
  }
106265
106436
  var getRandomValues = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != "undefined" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto);
106266
106437
  var rnds8 = new Uint8Array(16);
@@ -127220,22 +127391,22 @@ function addDecoder(cases, importFn) {
127220
127391
  }
127221
127392
  cases.forEach((c) => registry$1.set(c, importFn));
127222
127393
  }
127223
- addDecoder([void 0, 1], () => import("./raw-CQ1-Oqp0.js").then((m) => m.default));
127224
- addDecoder(5, () => import("./lzw-NyHi0pOJ.js").then((m) => m.default));
127394
+ addDecoder([void 0, 1], () => import("./raw-B0KKXSNf.js").then((m) => m.default));
127395
+ addDecoder(5, () => import("./lzw-CVtIesEK.js").then((m) => m.default));
127225
127396
  addDecoder(6, () => {
127226
127397
  throw new Error("old style JPEG compression is not supported.");
127227
127398
  });
127228
- addDecoder(7, () => import("./jpeg-BKMAcEDV.js").then((m) => m.default));
127229
- addDecoder([8, 32946], () => import("./deflate-Bn_X6_zo.js").then((m) => m.default));
127230
- addDecoder(32773, () => import("./packbits-W8xQwU7O.js").then((m) => m.default));
127399
+ addDecoder(7, () => import("./jpeg-BSwqwK8c.js").then((m) => m.default));
127400
+ addDecoder([8, 32946], () => import("./deflate-B8DpVQEX.js").then((m) => m.default));
127401
+ addDecoder(32773, () => import("./packbits-Dfl3UJMF.js").then((m) => m.default));
127231
127402
  addDecoder(
127232
127403
  34887,
127233
- () => import("./lerc-DrRHpq46.js").then(async (m) => {
127404
+ () => import("./lerc-CKc0tAyZ.js").then(async (m) => {
127234
127405
  await m.zstd.init();
127235
127406
  return m;
127236
127407
  }).then((m) => m.default)
127237
127408
  );
127238
- addDecoder(50001, () => import("./webimage-DckhYFL0.js").then((m) => m.default));
127409
+ addDecoder(50001, () => import("./webimage-BfBDKChT.js").then((m) => m.default));
127239
127410
  function decodeRowAcc(row, stride) {
127240
127411
  let length2 = row.length - stride;
127241
127412
  let offset2 = 0;
@@ -138013,14 +138184,14 @@ vec4 colormap(float intensity) {
138013
138184
  }
138014
138185
  };
138015
138186
  }
138016
- const defaultProps$4$1 = {
138187
+ const defaultProps$4$2 = {
138017
138188
  colormap: { type: "string", value: "viridis", compare: true },
138018
138189
  opacity: { type: "number", value: 1, compare: true },
138019
138190
  useTransparentColor: { type: "boolean", value: false, compare: true }
138020
138191
  };
138021
138192
  const AdditiveColormapExtension = class extends LayerExtension {
138022
138193
  getShaders() {
138023
- const name2 = this?.props?.colormap || defaultProps$4$1.colormap.value;
138194
+ const name2 = this?.props?.colormap || defaultProps$4$2.colormap.value;
138024
138195
  const apply_cmap = cmaps[name2];
138025
138196
  if (!apply_cmap) {
138026
138197
  throw Error(`No colormap named ${name2} found in registry`);
@@ -138039,8 +138210,8 @@ const AdditiveColormapExtension = class extends LayerExtension {
138039
138210
  }
138040
138211
  draw() {
138041
138212
  const {
138042
- useTransparentColor = defaultProps$4$1.useTransparentColor.value,
138043
- opacity = defaultProps$4$1.opacity.value
138213
+ useTransparentColor = defaultProps$4$2.useTransparentColor.value,
138214
+ opacity = defaultProps$4$2.opacity.value
138044
138215
  } = this.props;
138045
138216
  const uniforms = {
138046
138217
  opacity,
@@ -138050,7 +138221,7 @@ const AdditiveColormapExtension = class extends LayerExtension {
138050
138221
  }
138051
138222
  };
138052
138223
  AdditiveColormapExtension.extensionName = "AdditiveColormapExtension";
138053
- AdditiveColormapExtension.defaultProps = defaultProps$4$1;
138224
+ AdditiveColormapExtension.defaultProps = defaultProps$4$2;
138054
138225
  const fs$1$2 = `uniform vec3 transparentColor;
138055
138226
  uniform bool useTransparentColor;
138056
138227
  uniform float opacity;
@@ -139343,7 +139514,7 @@ const ImageLayer = class extends CompositeLayer {
139343
139514
  };
139344
139515
  ImageLayer.layerName = "ImageLayer";
139345
139516
  ImageLayer.defaultProps = defaultProps$5;
139346
- const defaultProps$4 = {
139517
+ const defaultProps$4$1 = {
139347
139518
  pickable: { type: "boolean", value: true, compare: true },
139348
139519
  onHover: { type: "function", value: null, compare: false },
139349
139520
  contrastLimits: { type: "array", value: [], compare: true },
@@ -139455,7 +139626,7 @@ const MultiscaleImageLayer = class extends CompositeLayer {
139455
139626
  }
139456
139627
  };
139457
139628
  MultiscaleImageLayer.layerName = "MultiscaleImageLayer";
139458
- MultiscaleImageLayer.defaultProps = defaultProps$4;
139629
+ MultiscaleImageLayer.defaultProps = defaultProps$4$1;
139459
139630
  const defaultProps$3$1 = {
139460
139631
  pickable: { type: "boolean", value: true, compare: true },
139461
139632
  loader: {
@@ -140556,7 +140727,7 @@ function padWithDefault$1(arr, defaultValue2, padWidth) {
140556
140727
  }
140557
140728
  return newArr;
140558
140729
  }
140559
- const defaultProps$3 = {
140730
+ const defaultProps$4 = {
140560
140731
  hoveredCell: { type: "number", value: null, compare: true },
140561
140732
  // We do not want to deep-compare cellColorData,
140562
140733
  // as it is potentially a TypedArray with millions of elements.
@@ -140673,7 +140844,7 @@ let BitmaskLayer$1 = class BitmaskLayer extends XRLayer {
140673
140844
  }
140674
140845
  };
140675
140846
  BitmaskLayer$1.layerName = "BitmaskLayer";
140676
- BitmaskLayer$1.defaultProps = defaultProps$3;
140847
+ BitmaskLayer$1.defaultProps = defaultProps$4;
140677
140848
  const vs = `
140678
140849
  #define SHADER_NAME bitmask-layer-vertex-shader
140679
140850
 
@@ -141015,7 +141186,7 @@ function isEqualShallow(prevArr, nextArr) {
141015
141186
  }
141016
141187
  return prevArr === nextArr;
141017
141188
  }
141018
- const defaultProps$2 = {
141189
+ const defaultProps$3 = {
141019
141190
  channelStrokeWidths: { type: "array", value: null, compare: true },
141020
141191
  channelsFilled: { type: "array", value: null, compare: true },
141021
141192
  channelOpacities: { type: "array", value: null, compare: true },
@@ -141279,7 +141450,7 @@ class BitmaskLayer2 extends XRLayer {
141279
141450
  }
141280
141451
  }
141281
141452
  BitmaskLayer2.layerName = "BitmaskLayer";
141282
- BitmaskLayer2.defaultProps = defaultProps$2;
141453
+ BitmaskLayer2.defaultProps = defaultProps$3;
141283
141454
  function geomEach(geojson, callback) {
141284
141455
  var i2, j, g2, geometry2, stopG, geometryMaybeCollection, isGeometryCollection, featureProperties, featureBBox, featureId2, featureIndex = 0, isFeatureCollection = geojson.type === "FeatureCollection", isFeature = geojson.type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
141285
141456
  for (i2 = 0; i2 < stop; i2++) {
@@ -144368,7 +144539,7 @@ function distance(from2, to, options = {}) {
144368
144539
  );
144369
144540
  }
144370
144541
  const DEFAULT_THRESHOLD = 1;
144371
- const defaultProps$1 = {
144542
+ const defaultProps$2 = {
144372
144543
  // for text
144373
144544
  obsSetPath: { type: "object" },
144374
144545
  sampleSetPath: { type: "object" },
@@ -144542,7 +144713,7 @@ class ContourLayerWithText extends ContourLayer {
144542
144713
  }
144543
144714
  }
144544
144715
  ContourLayerWithText.layerName = "ContourLayerWithText";
144545
- ContourLayerWithText.defaultProps = defaultProps$1;
144716
+ ContourLayerWithText.defaultProps = defaultProps$2;
144546
144717
  const ARROW_SCREEN_PX = 14;
144547
144718
  const LABEL_FONT_FAMILY = '"Roboto", "Helvetica", "Arial", sans-serif';
144548
144719
  const LABEL_FONT_WEIGHT = "bold";
@@ -145549,7 +145720,7 @@ function createAnnotationLayers(shapes = [], zoom = 0, selectedShapeUid = null,
145549
145720
  });
145550
145721
  return [...selectionLayers, ...layers, ...measureLayers];
145551
145722
  }
145552
- const defaultProps = {
145723
+ const defaultProps$1 = {
145553
145724
  // Array of annotation shape objects (see annotationShapeObj in @vitessce/schemas).
145554
145725
  data: { type: "object", value: [], compare: true },
145555
145726
  // UID of the shape to highlight with a selection halo.
@@ -145608,7 +145779,101 @@ class AnnotationLayer extends CompositeLayer {
145608
145779
  }
145609
145780
  }
145610
145781
  AnnotationLayer.layerName = "AnnotationLayer";
145611
- AnnotationLayer.defaultProps = defaultProps;
145782
+ AnnotationLayer.defaultProps = defaultProps$1;
145783
+ const DIST_TO_CENTER_ORIGINAL = "float distToCenter = length(unitPosition) * outerRadiusPixels;";
145784
+ const DIST_TO_CENTER_REPLACEMENT = `float distToCenter = (
145785
+ uIsSquare
145786
+ ? max(abs(unitPosition.x), abs(unitPosition.y))
145787
+ : length(unitPosition)
145788
+ ) * outerRadiusPixels;`;
145789
+ const defaultProps = {
145790
+ spotShape: { type: "string", value: "circle", compare: true }
145791
+ };
145792
+ class SpotLayer extends ScatterplotLayer {
145793
+ getShaders() {
145794
+ const shaders = super.getShaders();
145795
+ if (!shaders.fs.includes(DIST_TO_CENTER_ORIGINAL)) {
145796
+ log$5.warn("SpotLayer: unable to modify ScatterplotLayer fragment shader; spots will be rendered as circles.");
145797
+ return shaders;
145798
+ }
145799
+ return {
145800
+ ...shaders,
145801
+ fs: shaders.fs.replace("uniform bool antialiasing;", "uniform bool antialiasing;\nuniform bool uIsSquare;").replace(DIST_TO_CENTER_ORIGINAL, DIST_TO_CENTER_REPLACEMENT)
145802
+ };
145803
+ }
145804
+ draw(opts) {
145805
+ const { spotShape } = this.props;
145806
+ super.draw({
145807
+ ...opts,
145808
+ uniforms: {
145809
+ ...opts.uniforms,
145810
+ uIsSquare: spotShape === "square"
145811
+ }
145812
+ });
145813
+ }
145814
+ }
145815
+ SpotLayer.layerName = "SpotLayer";
145816
+ SpotLayer.defaultProps = defaultProps;
145817
+ makeStyles()(() => ({
145818
+ toolButton: {
145819
+ display: "inline-flex",
145820
+ "&:active": {
145821
+ opacity: ".65",
145822
+ extend: "iconClicked"
145823
+ }
145824
+ },
145825
+ tool: {
145826
+ position: "absolute",
145827
+ display: "inline",
145828
+ zIndex: "1000",
145829
+ opacity: ".65",
145830
+ color: "black",
145831
+ "&:hover": {
145832
+ opacity: ".90"
145833
+ }
145834
+ },
145835
+ iconClicked: {
145836
+ // Styles for the clicked state
145837
+ boxShadow: "none",
145838
+ transform: "scale(0.98)"
145839
+ // make the button slightly smaller
145840
+ },
145841
+ toolIcon: {
145842
+ // btn btn-outline-secondary mr-2 icon
145843
+ padding: "0",
145844
+ height: "2em",
145845
+ width: "2em",
145846
+ backgroundColor: "white",
145847
+ display: "inline-block",
145848
+ fontWeight: "400",
145849
+ textAlign: "center",
145850
+ verticalAlign: "middle",
145851
+ cursor: "pointer",
145852
+ userSelect: "none",
145853
+ border: "1px solid #6c757d",
145854
+ fontSize: "16px",
145855
+ lineHeight: "1.5",
145856
+ borderRadius: "4px",
145857
+ transition: "color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out",
145858
+ color: "#6c757d",
145859
+ marginRight: "8px",
145860
+ "& > svg": {
145861
+ verticalAlign: "middle",
145862
+ display: "inline-block",
145863
+ color: "black"
145864
+ },
145865
+ "&:active": {
145866
+ extend: "iconClicked"
145867
+ }
145868
+ },
145869
+ toolActive: {
145870
+ // active
145871
+ color: "#fff",
145872
+ backgroundColor: "#6c757d",
145873
+ borderColor: "#6c757d",
145874
+ boxShadow: "0 0 0 3px rgba(108, 117, 125, 0.5)"
145875
+ }
145876
+ }));
145612
145877
  const toRgbUIString = (on, arr, theme) => {
145613
145878
  const color2 = on || theme !== "dark" && arr?.every((i2) => i2 === 255) ? [220, 220, 220] : arr;
145614
145879
  return `rgb(${color2})`;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C, a, L, V, i, d, c, e, f, b, h, u } from "./index-KPdFdtqD.js";
1
+ import { C, a, L, V, i, d, c, e, f, b, h, u } from "./index-mXavO7HF.js";
2
2
  export {
3
3
  C as CHANNELS_SORT_ORDER_OPTIONS,
4
4
  a as LayerController,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-KPdFdtqD.js";
1
+ import { B as BaseDecoder } from "./index-mXavO7HF.js";
2
2
  const dctZigZag = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-KPdFdtqD.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-mXavO7HF.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-KPdFdtqD.js";
1
+ import { B as BaseDecoder } from "./index-mXavO7HF.js";
2
2
  const MIN_BITS = 9;
3
3
  const CLEAR_CODE = 256;
4
4
  const EOI_CODE = 257;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-KPdFdtqD.js";
1
+ import { B as BaseDecoder } from "./index-mXavO7HF.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-KPdFdtqD.js";
1
+ import { B as BaseDecoder } from "./index-mXavO7HF.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-KPdFdtqD.js";
1
+ import { B as BaseDecoder } from "./index-mXavO7HF.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/layer-controller",
3
- "version": "4.1.2",
3
+ "version": "4.2.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,12 +19,12 @@
19
19
  "lodash-es": "^4.17.21",
20
20
  "math.gl": "^3.5.6",
21
21
  "react-aria": "^3.47.0",
22
- "@vitessce/constants-internal": "4.1.2",
23
- "@vitessce/gl": "4.1.2",
24
- "@vitessce/spatial-utils": "4.1.2",
25
- "@vitessce/utils": "4.1.2",
26
- "@vitessce/vit-s": "4.1.2",
27
- "@vitessce/styles": "4.1.2"
22
+ "@vitessce/styles": "4.2.0",
23
+ "@vitessce/constants-internal": "4.2.0",
24
+ "@vitessce/gl": "4.2.0",
25
+ "@vitessce/spatial-utils": "4.2.0",
26
+ "@vitessce/utils": "4.2.0",
27
+ "@vitessce/vit-s": "4.2.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "react": "19.2.6",