higlass 2.3.0 → 2.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.
@@ -5187,6 +5187,12 @@ class HiGlassComponent extends React.Component {
5187
5187
  x.type === 'vertical-chromosome-labels' ||
5188
5188
  x.type === 'chromosome-labels',
5189
5189
  );
5190
+ const uniqueAnnotationTilesets = new Set(
5191
+ annotationTracks.map((x) => x.tilesetUid),
5192
+ );
5193
+ const uniqueChromSizesTilesets = new Set(
5194
+ chromSizesTracks.map((x) => x.tilesetUid),
5195
+ );
5190
5196
 
5191
5197
  const getGenomePositionSearchBox = (isFocused, onFocus) => (
5192
5198
  <GenomePositionSearchBox
@@ -5197,18 +5203,26 @@ class HiGlassComponent extends React.Component {
5197
5203
  }}
5198
5204
  // Custom props
5199
5205
  autocompleteId={
5200
- annotationTracks.length === 1
5206
+ annotationTracks.length >= 1 &&
5207
+ uniqueAnnotationTilesets.size === 1
5201
5208
  ? annotationTracks[0].tilesetUid
5202
5209
  : null
5203
5210
  }
5204
5211
  autocompleteServer={
5205
- annotationTracks.length === 1 ? annotationTracks[0].server : null
5212
+ annotationTracks.length >= 1 &&
5213
+ uniqueAnnotationTilesets.size === 1
5214
+ ? annotationTracks[0].server
5215
+ : null
5206
5216
  }
5207
5217
  chromInfoId={
5208
- chromSizesTracks.length ? chromSizesTracks[0].tilesetUid : null
5218
+ (chromSizesTracks.length && chromSizesTracks[0].tilesetUid) ||
5219
+ view.genomePositionSearchBox?.chromInfoId ||
5220
+ null
5209
5221
  }
5210
5222
  chromInfoServer={
5211
- chromSizesTracks.length ? chromSizesTracks[0].server : null
5223
+ (chromSizesTracks.length && chromSizesTracks[0].server) ||
5224
+ view.genomePositionSearchBox?.chromInfoServer ||
5225
+ null
5212
5226
  }
5213
5227
  isFocused={isFocused}
5214
5228
  // the chromInfoId is either specified in the viewconfig or guessed based on
@@ -5229,8 +5243,10 @@ class HiGlassComponent extends React.Component {
5229
5243
  (chromSizesTracks.length === 0 &&
5230
5244
  'no chromosome track present') ||
5231
5245
  (chromSizesTracks.length >= 2 &&
5246
+ uniqueChromSizesTilesets.size > 1 &&
5232
5247
  'multiple chromosome tracks present') ||
5233
5248
  (annotationTracks.length >= 2 &&
5249
+ uniqueAnnotationTilesets.size > 1 &&
5234
5250
  'multiple annotation tracks present')
5235
5251
  }
5236
5252
  />
package/dist/hglib.js CHANGED
@@ -12606,7 +12606,7 @@
12606
12606
  /** @type {const} */
12607
12607
  [window, map$4((c) => c.charCodeAt(0))(
12608
12608
  // @ts-expect-error - A global added by `vite.config.js`.
12609
- "2.3.0"
12609
+ "2.3.1"
12610
12610
  ).map((number3) => number3 <= 999 ? `00${number3}`.slice(-3) : number3).join("")]
12611
12611
  );
12612
12612
  const gradient = (steps, width = 1, height = 100, fromX = 0, fromY = 0, toX = 0, toY = 100) => {
@@ -93787,7 +93787,7 @@ ${x}` : x, "");
93787
93787
  toJSON,
93788
93788
  toString
93789
93789
  });
93790
- const version = "2.3.0";
93790
+ const version = "2.3.1";
93791
93791
  const configs = {
93792
93792
  ..._configs,
93793
93793
  IS_TRACK_RANGE_SELECTABLE,
@@ -111050,6 +111050,8 @@ ${svgString}`;
111050
111050
  const looseTracks = positionedTracksToAllTracks(view.tracks);
111051
111051
  const annotationTracks = looseTracks.filter((x) => x.type === "horizontal-gene-annotations" || x.type === "vertical-gene-annotations" || x.type === "gene-annotations");
111052
111052
  const chromSizesTracks = looseTracks.filter((x) => x.type === "horizontal-chromosome-labels" || x.type === "vertical-chromosome-labels" || x.type === "chromosome-labels");
111053
+ const uniqueAnnotationTilesets = new Set(annotationTracks.map((x) => x.tilesetUid));
111054
+ const uniqueChromSizesTilesets = new Set(chromSizesTracks.map((x) => x.tilesetUid));
111053
111055
  const getGenomePositionSearchBox = (isFocused, onFocus) => /* @__PURE__ */ React.createElement(
111054
111056
  GenomePositionSearchBox$1,
111055
111057
  {
@@ -111057,10 +111059,10 @@ ${svgString}`;
111057
111059
  ref: (c) => {
111058
111060
  this.genomePositionSearchBoxes[view.uid] = c;
111059
111061
  },
111060
- autocompleteId: annotationTracks.length === 1 ? annotationTracks[0].tilesetUid : null,
111061
- autocompleteServer: annotationTracks.length === 1 ? annotationTracks[0].server : null,
111062
- chromInfoId: chromSizesTracks.length ? chromSizesTracks[0].tilesetUid : null,
111063
- chromInfoServer: chromSizesTracks.length ? chromSizesTracks[0].server : null,
111062
+ autocompleteId: annotationTracks.length >= 1 && uniqueAnnotationTilesets.size === 1 ? annotationTracks[0].tilesetUid : null,
111063
+ autocompleteServer: annotationTracks.length >= 1 && uniqueAnnotationTilesets.size === 1 ? annotationTracks[0].server : null,
111064
+ chromInfoId: chromSizesTracks.length && chromSizesTracks[0].tilesetUid || view.genomePositionSearchBox?.chromInfoId || null,
111065
+ chromInfoServer: chromSizesTracks.length && chromSizesTracks[0].server || view.genomePositionSearchBox?.chromInfoServer || null,
111064
111066
  isFocused,
111065
111067
  onFocus,
111066
111068
  registerViewportChangedListener: (listener) => this.addScalesChangedListener(view.uid, view.uid, listener),
@@ -111068,7 +111070,7 @@ ${svgString}`;
111068
111070
  setCenters: (centerX, centerY, k, animateTime) => this.setCenters[view.uid](centerX, centerY, k, false, animateTime),
111069
111071
  trackSourceServers: this.state.viewConfig.trackSourceServers,
111070
111072
  twoD: true,
111071
- error: chromSizesTracks.length === 0 && "no chromosome track present" || chromSizesTracks.length >= 2 && "multiple chromosome tracks present" || annotationTracks.length >= 2 && "multiple annotation tracks present"
111073
+ error: chromSizesTracks.length === 0 && "no chromosome track present" || chromSizesTracks.length >= 2 && uniqueChromSizesTilesets.size > 1 && "multiple chromosome tracks present" || annotationTracks.length >= 2 && uniqueAnnotationTilesets.size > 1 && "multiple annotation tracks present"
111072
111074
  }
111073
111075
  );
111074
111076
  const multiTrackHeader = this.isEditable() && !this.isViewHeaderDisabled() && !this.state.viewConfig.hideHeader ? /* @__PURE__ */ React.createElement(ViewHeader$1, {