higlass 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,6 +90,10 @@ class BarTrack extends HorizontalLine1DPixiTrack {
90
90
  }
91
91
 
92
92
  const { graphics } = tile;
93
+ const numBins =
94
+ this.tilesetInfo.tile_size ||
95
+ this.tilesetInfo.bins_per_dimension ||
96
+ tile.tileData.dense.length;
93
97
 
94
98
  // Reset svg data to avoid overplotting
95
99
  tile.svgData = undefined;
@@ -97,7 +101,7 @@ class BarTrack extends HorizontalLine1DPixiTrack {
97
101
  const { tileX, tileWidth } = this.getTilePosAndDimensions(
98
102
  tile.tileData.zoomLevel,
99
103
  tile.tileData.tilePos,
100
- this.tilesetInfo.bins_per_dimension || this.tilesetInfo.tile_size,
104
+ numBins,
101
105
  );
102
106
  const tileValues = tile.tileData.dense;
103
107
 
@@ -142,10 +146,7 @@ class BarTrack extends HorizontalLine1DPixiTrack {
142
146
  // this scale should go from an index in the data array to
143
147
  // a position in the genome coordinates
144
148
  const tileXScale = scaleLinear()
145
- .domain([
146
- 0,
147
- this.tilesetInfo.tile_size || this.tilesetInfo.bins_per_dimension,
148
- ])
149
+ .domain([0, numBins])
149
150
  .range([tileX, tileX + tileWidth]);
150
151
 
151
152
  const strokeWidth = 0;
@@ -212,13 +212,17 @@ class Tiled1DPixiTrack extends TiledPixiTrack {
212
212
  const { tileX, tileWidth } = this.getTilePosAndDimensions(
213
213
  tile.tileData.zoomLevel,
214
214
  tile.tileData.tilePos,
215
- this.tilesetInfo.bins_per_dimension || this.tilesetInfo.tile_size,
215
+ this.tilesetInfo.bins_per_dimension ||
216
+ this.tilesetInfo.tile_size ||
217
+ tile.tileData.dense.length,
216
218
  );
217
219
 
218
220
  const tileXScale = scaleLinear()
219
221
  .domain([
220
222
  0,
221
- this.tilesetInfo.tile_size || this.tilesetInfo.bins_per_dimension,
223
+ this.tilesetInfo.tile_size ||
224
+ this.tilesetInfo.bins_per_dimension ||
225
+ tile.tileData.dense.length,
222
226
  ])
223
227
  .range([tileX, tileX + tileWidth]);
224
228
 
@@ -450,7 +450,7 @@ export default class DataFetcher {
450
450
  // we need to extract the row corresponding to the data we need
451
451
 
452
452
  const tilesetUid = dictValues(returnedTiles)[0].tilesetUid;
453
- // console.log('tilesetUid:', tilesetUid);
453
+
454
454
  /** @type {Record<string, Tile>} */
455
455
  const newTiles = {};
456
456
 
@@ -486,6 +486,7 @@ export default class DataFetcher {
486
486
  sliceIndex,
487
487
  1,
488
488
  );
489
+
489
490
  for (let j = 0; j < dataSlice.length; j++) {
490
491
  dataSlice[j] += mirroredDataSlice[j];
491
492
  }
@@ -483,7 +483,11 @@ export function calculateTileAndPosInTile(
483
483
  : 256;
484
484
 
485
485
  if (!isLegacyTilesetInfo(tilesetInfo)) {
486
- tileWidth = tilesetInfo.resolutions[zoomLevel] * pixelsPerTile;
486
+ const sortedResolutions = tilesetInfo.resolutions
487
+ .map((x) => +x)
488
+ .sort((a, b) => b - a);
489
+
490
+ tileWidth = sortedResolutions[zoomLevel] * pixelsPerTile;
487
491
  } else {
488
492
  tileWidth = maxDim / 2 ** zoomLevel;
489
493
  }
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.1"
12609
+ "2.3.2"
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) => {
@@ -49038,7 +49038,8 @@
49038
49038
  let tileWidth = null;
49039
49039
  const pixelsPerTile = isLegacyTilesetInfo(tilesetInfo) ? tilesetInfo.bins_per_dimension ?? 256 : 256;
49040
49040
  if (!isLegacyTilesetInfo(tilesetInfo)) {
49041
- tileWidth = tilesetInfo.resolutions[zoomLevel] * pixelsPerTile;
49041
+ const sortedResolutions = tilesetInfo.resolutions.map((x) => +x).sort((a, b) => b - a);
49042
+ tileWidth = sortedResolutions[zoomLevel] * pixelsPerTile;
49042
49043
  } else {
49043
49044
  tileWidth = maxDim / 2 ** zoomLevel;
49044
49045
  }
@@ -78861,8 +78862,8 @@ ${x}` : x, "");
78861
78862
  const {
78862
78863
  tileX,
78863
78864
  tileWidth
78864
- } = this.getTilePosAndDimensions(tile.tileData.zoomLevel, tile.tileData.tilePos, this.tilesetInfo.bins_per_dimension || this.tilesetInfo.tile_size);
78865
- const tileXScale = linear().domain([0, this.tilesetInfo.tile_size || this.tilesetInfo.bins_per_dimension]).range([tileX, tileX + tileWidth]);
78865
+ } = this.getTilePosAndDimensions(tile.tileData.zoomLevel, tile.tileData.tilePos, this.tilesetInfo.bins_per_dimension || this.tilesetInfo.tile_size || tile.tileData.dense.length);
78866
+ const tileXScale = linear().domain([0, this.tilesetInfo.tile_size || this.tilesetInfo.bins_per_dimension || tile.tileData.dense.length]).range([tileX, tileX + tileWidth]);
78866
78867
  const start2 = Math.max(0, Math.round(tileXScale.invert(this._xScale.invert(visible[0]))));
78867
78868
  const end2 = Math.min(tile.tileData.dense.length, Math.round(tileXScale.invert(this._xScale.invert(visible[1]))));
78868
78869
  return [start2, end2];
@@ -83317,11 +83318,12 @@ ${x}` : x, "");
83317
83318
  const {
83318
83319
  graphics
83319
83320
  } = tile;
83321
+ const numBins = this.tilesetInfo.tile_size || this.tilesetInfo.bins_per_dimension || tile.tileData.dense.length;
83320
83322
  tile.svgData = void 0;
83321
83323
  const {
83322
83324
  tileX,
83323
83325
  tileWidth
83324
- } = this.getTilePosAndDimensions(tile.tileData.zoomLevel, tile.tileData.tilePos, this.tilesetInfo.bins_per_dimension || this.tilesetInfo.tile_size);
83326
+ } = this.getTilePosAndDimensions(tile.tileData.zoomLevel, tile.tileData.tilePos, numBins);
83325
83327
  const tileValues = tile.tileData.dense;
83326
83328
  if (tileValues.length === 0) return;
83327
83329
  const [valueScale, pseudocount] = this.makeValueScale(this.minValue(), this.medianVisibleValue, this.maxValue(), 0);
@@ -83337,7 +83339,7 @@ ${x}` : x, "");
83337
83339
  return;
83338
83340
  }
83339
83341
  const stroke = colorToHex(this.options.lineStrokeColor || "blue");
83340
- const tileXScale = linear().domain([0, this.tilesetInfo.tile_size || this.tilesetInfo.bins_per_dimension]).range([tileX, tileX + tileWidth]);
83342
+ const tileXScale = linear().domain([0, numBins]).range([tileX, tileX + tileWidth]);
83341
83343
  const strokeWidth = 0;
83342
83344
  graphics.lineStyle(strokeWidth, stroke, 1);
83343
83345
  const color2 = this.options.barFillColor || "grey";
@@ -93787,7 +93789,7 @@ ${x}` : x, "");
93787
93789
  toJSON,
93788
93790
  toString
93789
93791
  });
93790
- const version = "2.3.1";
93792
+ const version = "2.3.2";
93791
93793
  const configs = {
93792
93794
  ..._configs,
93793
93795
  IS_TRACK_RANGE_SELECTABLE,