higlass 1.13.5 → 1.13.6
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.
- package/README.md +48 -54
- package/app/globals.d.ts +1 -1
- package/app/missing-types.d.ts +4 -1
- package/app/scripts/AddTrackDialog.jsx +3 -3
- package/app/scripts/AddTrackPositionMenu.jsx +2 -2
- package/app/scripts/Annotations1dTrack.js +1 -1
- package/app/scripts/Annotations2dTrack.js +3 -5
- package/app/scripts/Autocomplete.jsx +14 -21
- package/app/scripts/AxisPixi.js +6 -10
- package/app/scripts/BarTrack.js +3 -3
- package/app/scripts/BedLikeTrack.js +12 -13
- package/app/scripts/Button.jsx +1 -1
- package/app/scripts/CNVIntervalTrack.js +1 -1
- package/app/scripts/CenterTrack.jsx +8 -7
- package/app/scripts/Chromosome2DAnnotations.js +1 -1
- package/app/scripts/Chromosome2DLabels.js +1 -1
- package/app/scripts/ChromosomeGrid.js +49 -38
- package/app/scripts/ChromosomeInfo.js +1 -1
- package/app/scripts/CombinedTrack.js +3 -1
- package/app/scripts/ConfigTrackMenu.jsx +1 -1
- package/app/scripts/ConfigViewMenu.jsx +2 -2
- package/app/scripts/ContextMenuContainer.jsx +1 -2
- package/app/scripts/ContextMenuItem.jsx +1 -0
- package/app/scripts/CrossRule.js +1 -1
- package/app/scripts/CustomTrackDialog.jsx +2 -2
- package/app/scripts/Dialog.jsx +2 -2
- package/app/scripts/DragListeningDiv.jsx +1 -1
- package/app/scripts/DraggableDiv.jsx +2 -3
- package/app/scripts/ExportLinkDialog.jsx +1 -1
- package/app/scripts/GalleryTracks.jsx +77 -78
- package/app/scripts/GenomePositionSearchBox.jsx +10 -9
- package/app/scripts/HeatmapOptions.jsx +4 -2
- package/app/scripts/HeatmapTiledPixiTrack.js +23 -32
- package/app/scripts/HiGlassComponent.jsx +75 -98
- package/app/scripts/Horizontal1dHeatmapTrack.js +1 -1
- package/app/scripts/Horizontal2DDomainsTrack.js +1 -1
- package/app/scripts/HorizontalChromosomeLabels.js +28 -22
- package/app/scripts/HorizontalGeneAnnotationsTrack.js +1 -1
- package/app/scripts/HorizontalHeatmapTrack.js +2 -2
- package/app/scripts/HorizontalMultivecTrack.js +6 -7
- package/app/scripts/HorizontalRule.js +1 -2
- package/app/scripts/HorizontalTiled1DPixiTrack.js +4 -4
- package/app/scripts/HorizontalTiledPlot.jsx +9 -9
- package/app/scripts/LeftTrackModifier.js +4 -0
- package/app/scripts/ListWrapper.jsx +1 -2
- package/app/scripts/MapboxTilesTrack.js +1 -2
- package/app/scripts/Modal.jsx +2 -2
- package/app/scripts/MoveableTrack.jsx +10 -12
- package/app/scripts/NestedContextMenu.jsx +2 -1
- package/app/scripts/OSMTileIdsTrack.js +1 -1
- package/app/scripts/OverlayTrack.js +4 -4
- package/app/scripts/PixiTrack.js +27 -13
- package/app/scripts/PlotTypeChooser.jsx +3 -4
- package/app/scripts/SearchField.js +5 -5
- package/app/scripts/SeriesListItems.jsx +3 -4
- package/app/scripts/SeriesListMenu.jsx +6 -11
- package/app/scripts/SeriesListSubmenuMixin.jsx +1 -1
- package/app/scripts/SketchInlinePicker.jsx +2 -2
- package/app/scripts/SortableList.jsx +1 -1
- package/app/scripts/Tiled1DPixiTrack.js +5 -1
- package/app/scripts/TiledPixiTrack.js +232 -99
- package/app/scripts/TiledPlot.jsx +33 -43
- package/app/scripts/TilesetFinder.jsx +12 -4
- package/app/scripts/Track.js +1 -1
- package/app/scripts/TrackArea.jsx +4 -0
- package/app/scripts/TrackControl.jsx +2 -2
- package/app/scripts/TrackRenderer.jsx +30 -31
- package/app/scripts/ValueIntervalTrack.js +1 -1
- package/app/scripts/VerticalRule.js +2 -2
- package/app/scripts/VerticalTiledPlot.jsx +7 -7
- package/app/scripts/ViewConfigEditor.jsx +1 -1
- package/app/scripts/ViewContextMenu.jsx +4 -4
- package/app/scripts/ViewHeader.jsx +6 -7
- package/app/scripts/ViewportTracker2D.js +1 -1
- package/app/scripts/api.js +5 -6
- package/app/scripts/configs/available-track-types.js +1 -1
- package/app/scripts/configs/positions-by-datatype.js +2 -2
- package/app/scripts/configs/themes.js +0 -1
- package/app/scripts/configs/tracks-info-by-type.js +11 -8
- package/app/scripts/configs/tracks-info.js +2 -2
- package/app/scripts/d3-context-menu.js +3 -4
- package/app/scripts/data-fetchers/DataFetcher.js +35 -36
- package/app/scripts/data-fetchers/genbank-fetcher.js +6 -10
- package/app/scripts/data-fetchers/local-tile-fetcher.js +2 -6
- package/app/scripts/hglib.jsx +1 -1
- package/app/scripts/hocs/with-modal.jsx +32 -10
- package/app/scripts/hocs/with-pub-sub.js +12 -3
- package/app/scripts/hocs/with-theme.jsx +21 -14
- package/app/scripts/icons.jsx +3 -2
- package/app/scripts/mixwith.js +2 -2
- package/app/scripts/plugins/get-data-fetcher.js +2 -3
- package/app/scripts/services/chrom-info.js +32 -4
- package/app/scripts/services/element-resize-listener.js +2 -2
- package/app/scripts/services/index.js +0 -1
- package/app/scripts/services/tile-proxy.js +368 -281
- package/app/scripts/services/worker.js +30 -28
- package/app/scripts/test-helpers/test-helpers.jsx +3 -3
- package/app/scripts/types.ts +50 -44
- package/app/scripts/utils/LruCache.js +3 -2
- package/app/scripts/utils/assert.js +19 -0
- package/app/scripts/utils/background-task-scheduler.js +2 -0
- package/app/scripts/utils/color-domain-to-rgba-array.js +13 -3
- package/app/scripts/utils/dict-items.js +1 -0
- package/app/scripts/utils/dict-keys.js +1 -0
- package/app/scripts/utils/dict-values.js +1 -0
- package/app/scripts/utils/expand-combined-tracks.js +11 -7
- package/app/scripts/utils/fill-in-min-widths.js +47 -21
- package/app/scripts/utils/flatten.js +0 -1
- package/app/scripts/utils/get-aggregation-function.js +1 -1
- package/app/scripts/utils/get-default-track-for-datatype.js +36 -10
- package/app/scripts/utils/get-higlass-components.js +27 -3
- package/app/scripts/utils/get-track-position-by-uid.js +8 -1
- package/app/scripts/utils/get-xylofon.js +12 -9
- package/app/scripts/utils/has-parent.js +5 -5
- package/app/scripts/utils/hex-string-to-int.js +1 -1
- package/app/scripts/utils/interval-tree.js +222 -177
- package/app/scripts/utils/load-chrom-infos.js +4 -1
- package/app/scripts/utils/pixi-text-to-svg.js +5 -9
- package/app/scripts/utils/range-query-2d.js +3 -3
- package/app/scripts/utils/reduce.js +12 -5
- package/app/scripts/utils/segments-to-rows.js +14 -11
- package/app/scripts/utils/show-mouse-position.js +16 -0
- package/app/scripts/utils/svg-line.js +7 -8
- package/app/scripts/utils/type-guards.js +16 -7
- package/app/scripts/utils/visit-positioned-tracks.js +7 -5
- package/app/styles/d3-context-menu.css +0 -1
- package/app/styles/prism.css +1 -0
- package/dist/hglib.js +78064 -77770
- package/dist/hglib.min.js +109 -109
- package/dist/higlass.mjs +82736 -82442
- package/package.json +13 -18
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import ndarray from 'ndarray';
|
|
3
2
|
import { brushY } from 'd3-brush';
|
|
4
3
|
import { format } from 'd3-format';
|
|
5
4
|
import { scaleLinear } from 'd3-scale';
|
|
6
5
|
import { select } from 'd3-selection';
|
|
6
|
+
import ndarray from 'ndarray';
|
|
7
7
|
import slugid from 'slugid';
|
|
8
8
|
|
|
9
|
-
// Utils
|
|
10
|
-
import colorToRgba from './utils/color-to-rgba';
|
|
11
9
|
import absToChr from './utils/abs-to-chr';
|
|
12
10
|
import colorDomainToRgbaArray from './utils/color-domain-to-rgba-array';
|
|
13
11
|
import colorToHex from './utils/color-to-hex';
|
|
12
|
+
// Utils
|
|
13
|
+
import colorToRgba from './utils/color-to-rgba';
|
|
14
14
|
import { download } from './utils/download';
|
|
15
15
|
import ndarrayAssign from './utils/ndarray-assign';
|
|
16
16
|
import ndarrayFlatten from './utils/ndarray-flatten';
|
|
@@ -18,23 +18,23 @@ import objVals from './utils/obj-vals';
|
|
|
18
18
|
import showMousePosition from './utils/show-mouse-position';
|
|
19
19
|
import valueToColor from './utils/value-to-color';
|
|
20
20
|
|
|
21
|
-
import TiledPixiTrack, { getValueScale } from './TiledPixiTrack';
|
|
22
21
|
import AxisPixi from './AxisPixi';
|
|
22
|
+
import TiledPixiTrack, { getValueScale } from './TiledPixiTrack';
|
|
23
23
|
|
|
24
24
|
// Services
|
|
25
25
|
import {
|
|
26
|
-
|
|
26
|
+
calculateResolution,
|
|
27
27
|
calculateTileWidth,
|
|
28
|
-
calculateTilesFromResolution,
|
|
29
28
|
calculateTiles,
|
|
30
|
-
|
|
31
|
-
calculateZoomLevelFromResolutions,
|
|
29
|
+
calculateTilesFromResolution,
|
|
32
30
|
calculateZoomLevel,
|
|
31
|
+
calculateZoomLevelFromResolutions,
|
|
32
|
+
tileDataToPixData,
|
|
33
33
|
} from './services/tile-proxy';
|
|
34
34
|
|
|
35
|
-
import GLOBALS from './configs/globals';
|
|
36
|
-
import { NUM_PRECOMP_SUBSETS_PER_2D_TTILE } from './configs/dense-data-extrema-config';
|
|
37
35
|
import { HEATED_OBJECT_MAP } from './configs/colormaps';
|
|
36
|
+
import { NUM_PRECOMP_SUBSETS_PER_2D_TTILE } from './configs/dense-data-extrema-config';
|
|
37
|
+
import GLOBALS from './configs/globals';
|
|
38
38
|
|
|
39
39
|
const COLORBAR_MAX_HEIGHT = 200;
|
|
40
40
|
const COLORBAR_WIDTH = 10;
|
|
@@ -99,7 +99,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
99
99
|
// not a d3 color scale for speed
|
|
100
100
|
this.colorScale = HEATED_OBJECT_MAP;
|
|
101
101
|
|
|
102
|
-
if (options
|
|
102
|
+
if (options?.colorRange) {
|
|
103
103
|
this.colorScale = colorDomainToRgbaArray(options.colorRange);
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -131,11 +131,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
if (
|
|
135
|
-
this.options &&
|
|
136
|
-
this.options.showMousePosition &&
|
|
137
|
-
!this.hideMousePosition
|
|
138
|
-
) {
|
|
134
|
+
if (this.options?.showMousePosition && !this.hideMousePosition) {
|
|
139
135
|
this.hideMousePosition = showMousePosition(
|
|
140
136
|
this,
|
|
141
137
|
this.is2d,
|
|
@@ -313,7 +309,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
313
309
|
}
|
|
314
310
|
|
|
315
311
|
const [scaleType, valueScale] = getValueScale(
|
|
316
|
-
|
|
312
|
+
this.options?.heatmapValueScaling || 'log',
|
|
317
313
|
minValue,
|
|
318
314
|
this.medianVisibleValue,
|
|
319
315
|
maxValue,
|
|
@@ -363,7 +359,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
363
359
|
// the normalization method may have changed
|
|
364
360
|
this.calculateVisibleTiles();
|
|
365
361
|
|
|
366
|
-
if (options
|
|
362
|
+
if (options?.colorRange) {
|
|
367
363
|
this.colorScale = colorDomainToRgbaArray(options.colorRange);
|
|
368
364
|
}
|
|
369
365
|
|
|
@@ -377,11 +373,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
377
373
|
this.hideMousePosition = undefined;
|
|
378
374
|
}
|
|
379
375
|
|
|
380
|
-
if (
|
|
381
|
-
this.options &&
|
|
382
|
-
this.options.showMousePosition &&
|
|
383
|
-
!this.hideMousePosition
|
|
384
|
-
) {
|
|
376
|
+
if (this.options?.showMousePosition && !this.hideMousePosition) {
|
|
385
377
|
this.hideMousePosition = showMousePosition(
|
|
386
378
|
this,
|
|
387
379
|
this.is2d,
|
|
@@ -501,10 +493,10 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
501
493
|
// Fritz: I am disabling ESLint here twice because moving the slash onto the
|
|
502
494
|
// next line breaks my editors style template somehow.
|
|
503
495
|
const startPercent =
|
|
504
|
-
(startDomain - axisValueScale.domain()[0]) /
|
|
496
|
+
(startDomain - axisValueScale.domain()[0]) /
|
|
505
497
|
(axisValueScale.domain()[1] - axisValueScale.domain()[0]);
|
|
506
498
|
const endPercent =
|
|
507
|
-
(endDomain - axisValueScale.domain()[0]) /
|
|
499
|
+
(endDomain - axisValueScale.domain()[0]) /
|
|
508
500
|
(axisValueScale.domain()[1] - axisValueScale.domain()[0]);
|
|
509
501
|
|
|
510
502
|
newOptions.scaleStartPercent = startPercent.toFixed(SCALE_LIMIT_PRECISION);
|
|
@@ -912,7 +904,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
912
904
|
);
|
|
913
905
|
} else {
|
|
914
906
|
// when no tiles are loaded, color will be undefined and we don't want to crash
|
|
915
|
-
rectColor.setAttribute('style',
|
|
907
|
+
rectColor.setAttribute('style', 'fill: rgb(255,255,255,0)');
|
|
916
908
|
}
|
|
917
909
|
}
|
|
918
910
|
|
|
@@ -1016,7 +1008,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
1016
1008
|
Math.ceil((limitedYDomain[1] - limitedYDomain[0]) / tileRes),
|
|
1017
1009
|
);
|
|
1018
1010
|
|
|
1019
|
-
const out = ndarray(new Array(binHeight * binWidth).fill(NaN), [
|
|
1011
|
+
const out = ndarray(new Array(binHeight * binWidth).fill(Number.NaN), [
|
|
1020
1012
|
binHeight,
|
|
1021
1013
|
binWidth,
|
|
1022
1014
|
]);
|
|
@@ -1224,12 +1216,12 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
1224
1216
|
this.renderingTiles.add(tile.tileId);
|
|
1225
1217
|
|
|
1226
1218
|
if (this.tilesetInfo.tile_size) {
|
|
1227
|
-
if (tile.tileData.dense
|
|
1219
|
+
if (tile.tileData.dense?.length < this.tilesetInfo.tile_size) {
|
|
1228
1220
|
// we haven't gotten a full tile from the server so we want to pad
|
|
1229
1221
|
// it with nan values
|
|
1230
1222
|
const newArray = new Float32Array(this.tilesetInfo.tile_size);
|
|
1231
1223
|
|
|
1232
|
-
newArray.fill(NaN);
|
|
1224
|
+
newArray.fill(Number.NaN);
|
|
1233
1225
|
newArray.set(tile.tileData.dense);
|
|
1234
1226
|
|
|
1235
1227
|
tile.tileData.dense = newArray;
|
|
@@ -1575,8 +1567,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
1575
1567
|
tilesToId(xTiles, yTiles, zoomLevel) {
|
|
1576
1568
|
const rows = xTiles;
|
|
1577
1569
|
const cols = yTiles;
|
|
1578
|
-
const dataTransform =
|
|
1579
|
-
(this.options && this.options.dataTransform) || 'default';
|
|
1570
|
+
const dataTransform = this.options?.dataTransform || 'default';
|
|
1580
1571
|
|
|
1581
1572
|
// if we're mirroring tiles, then we only need tiles along the diagonal
|
|
1582
1573
|
const tiles = [];
|
|
@@ -1864,7 +1855,7 @@ class HeatmapTiledPixiTrack extends TiledPixiTrack {
|
|
|
1864
1855
|
zoomLevel = Math.min(zoomLevel, this.maxZoom);
|
|
1865
1856
|
}
|
|
1866
1857
|
|
|
1867
|
-
if (this.options
|
|
1858
|
+
if (this.options?.maxZoom) {
|
|
1868
1859
|
if (this.options.maxZoom >= 0) {
|
|
1869
1860
|
zoomLevel = Math.min(this.options.maxZoom, zoomLevel);
|
|
1870
1861
|
} else {
|