gosling.js 1.0.1 → 1.0.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.
- package/dist/compiler.js +12 -0
- package/dist/compiler.js.map +1 -0
- package/dist/{exported-utils-ce57b459.js → exported-compiler-e419fb4a.js} +48 -126
- package/dist/exported-compiler-e419fb4a.js.map +1 -0
- package/dist/exported-utils-26226ee9.js +89 -0
- package/dist/exported-utils-26226ee9.js.map +1 -0
- package/dist/gosling.js +31 -30
- package/dist/gosling.js.map +1 -1
- package/dist/src/exported-compiler.d.ts +2 -0
- package/dist/src/exported-compiler.d.ts.map +1 -0
- package/dist/utils.js +11 -10
- package/dist/utils.js.map +1 -1
- package/package.json +5 -1
- package/dist/exported-utils-ce57b459.js.map +0 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import "./exported-compiler-e419fb4a.js";
|
|
8
|
+
import { bisector } from "d3-array";
|
|
9
|
+
import { RemoteFile as RemoteFile$1 } from "generic-filehandle";
|
|
10
|
+
function filterUsingGenoPos(data, [minX, maxX], config) {
|
|
11
|
+
const { x, xe, x1, x1e } = config;
|
|
12
|
+
const definedXFields = [x, xe, x1, x1e].filter((f) => f);
|
|
13
|
+
return data.filter((d) => {
|
|
14
|
+
if (definedXFields.length === 0) {
|
|
15
|
+
return true;
|
|
16
|
+
} else if (definedXFields.length === 1) {
|
|
17
|
+
const value = +d[definedXFields[0]];
|
|
18
|
+
return typeof value === "number" && minX < value && value <= maxX;
|
|
19
|
+
} else {
|
|
20
|
+
const values = definedXFields.map((f) => +d[f]).filter((v) => !isNaN(v));
|
|
21
|
+
const minValue = Math.min(...values);
|
|
22
|
+
const maxValue = Math.max(...values);
|
|
23
|
+
return minX <= maxValue && minValue <= maxX;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
bisector((d) => d.pos).left;
|
|
28
|
+
function sanitizeChrName(chrName, assembly, chromosomePrefix) {
|
|
29
|
+
if (Array.isArray(assembly)) {
|
|
30
|
+
return chrName;
|
|
31
|
+
}
|
|
32
|
+
if (chromosomePrefix) {
|
|
33
|
+
chrName = chrName.replace(chromosomePrefix, "chr");
|
|
34
|
+
} else if (!chrName.includes("chr")) {
|
|
35
|
+
chrName = `chr${chrName}`;
|
|
36
|
+
}
|
|
37
|
+
return chrName;
|
|
38
|
+
}
|
|
39
|
+
class RemoteFile extends RemoteFile$1 {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
// Overrides `read` to eagerly read 200 or 206 response
|
|
43
|
+
// from https://github.com/GMOD/generic-filehandle/blob/0e8209be25e3097307bd15e964edd8c017e808d7/src/remoteFile.ts#L100-L162
|
|
44
|
+
__publicField(this, "read", async (buffer, offset = 0, length, position = 0, opts = {}) => {
|
|
45
|
+
const { headers = {}, signal, overrides = {} } = opts;
|
|
46
|
+
if (length < Infinity) {
|
|
47
|
+
headers.range = `bytes=${position}-${position + length}`;
|
|
48
|
+
} else if (length === Infinity && position !== 0) {
|
|
49
|
+
headers.range = `bytes=${position}-`;
|
|
50
|
+
}
|
|
51
|
+
const args = {
|
|
52
|
+
// @ts-expect-error private property
|
|
53
|
+
...this.baseOverrides,
|
|
54
|
+
...overrides,
|
|
55
|
+
headers: {
|
|
56
|
+
...headers,
|
|
57
|
+
...overrides.headers,
|
|
58
|
+
// @ts-expect-error private property
|
|
59
|
+
...this.baseOverrides.headers
|
|
60
|
+
},
|
|
61
|
+
method: "GET",
|
|
62
|
+
redirect: "follow",
|
|
63
|
+
mode: "cors",
|
|
64
|
+
signal
|
|
65
|
+
};
|
|
66
|
+
const response = await this.fetch(this.url, args);
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
throw new Error(`HTTP ${response.status} ${response.statusText} ${this.url}`);
|
|
69
|
+
}
|
|
70
|
+
if (response.status === 200 || response.status === 206) {
|
|
71
|
+
const responseData = await this.getBufferFromResponse(response);
|
|
72
|
+
const bytesCopied = responseData.copy(buffer, offset, 0, Math.min(length, responseData.length));
|
|
73
|
+
const res = response.headers.get("content-range");
|
|
74
|
+
const sizeMatch = /\/(\d+)$/.exec(res || "");
|
|
75
|
+
if (sizeMatch && sizeMatch[1]) {
|
|
76
|
+
this._stat = { size: parseInt(sizeMatch[1], 10) };
|
|
77
|
+
}
|
|
78
|
+
return { bytesRead: bytesCopied, buffer };
|
|
79
|
+
}
|
|
80
|
+
throw new Error(`HTTP ${response.status} fetching ${this.url}`);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
RemoteFile as R,
|
|
86
|
+
filterUsingGenoPos as f,
|
|
87
|
+
sanitizeChrName as s
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=exported-utils-26226ee9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exported-utils-26226ee9.js","sources":["../src/data-fetchers/utils.ts"],"sourcesContent":["import { bisector } from 'd3-array';\nimport { RemoteFile as _RemoteFile } from 'generic-filehandle';\n\nimport type * as HiGlass from '@higlass/types';\nimport type { Assembly, ChromSizes, Datum } from '@gosling-lang/gosling-schema';\n\nexport type CommonDataConfig = {\n assembly: Assembly;\n x?: string;\n xe?: string;\n x1?: string;\n x1e?: string;\n urlFetchOptions?: RequestInit;\n};\n\nexport class DataSource<File, Options> {\n chromInfo: ExtendedChromInfo;\n tilesetInfo: ReturnType<typeof tilesetInfoFromChromInfo>;\n\n constructor(public file: File, chromSizes: ChromSizes, public options: Options) {\n this.chromInfo = sizesToChromInfo(chromSizes);\n this.tilesetInfo = tilesetInfoFromChromInfo(this.chromInfo);\n }\n}\n\n/**\n * Filter data before sending to a track considering the visible genomic area in the track.\n * TODO(2022-Jul-13): Consider genomic `y` channels as well.\n */\nexport function filterUsingGenoPos(\n data: Datum[],\n [minX, maxX]: [number, number],\n config: Omit<CommonDataConfig, 'assembly'>\n) {\n const { x, xe, x1, x1e } = config;\n const definedXFields = [x, xe, x1, x1e].filter(f => f) as string[];\n return data.filter((d: Datum) => {\n if (definedXFields.length === 0) {\n // no filter applies\n return true;\n } else if (definedXFields.length === 1) {\n // filter based on one genomic position\n const value = +d[definedXFields[0]];\n return typeof value === 'number' && minX < value && value <= maxX;\n } else {\n // filter based on two genomic positions, i.e., check overlaps\n const values = definedXFields.map(f => +d[f]).filter(v => !isNaN(v));\n const minValue = Math.min(...values);\n const maxValue = Math.max(...values);\n return minX <= maxValue && minValue <= maxX;\n }\n });\n}\n\nconst chromInfoBisector = bisector((d: { pos: number }) => d.pos).left;\n\nconst chrToAbs = (chrom: string, chromPos: number, chromInfo: HiGlass.ChromInfo) =>\n chromInfo.chrPositions[chrom].pos + chromPos;\n\nconst absToChr = (absPosition: number, chromInfo: HiGlass.ChromInfo) => {\n if (!chromInfo || !chromInfo.cumPositions || !chromInfo.cumPositions.length) {\n return null;\n }\n\n let insertPoint = chromInfoBisector(chromInfo.cumPositions, absPosition);\n const lastChr = chromInfo.cumPositions[chromInfo.cumPositions.length - 1].chr;\n const lastLength = chromInfo.chromLengths[lastChr];\n\n // @ts-expect-error\n insertPoint -= insertPoint > 0 && 1;\n\n let chrPosition = Math.floor(absPosition - chromInfo.cumPositions[insertPoint].pos);\n let offset = 0;\n\n if (chrPosition < 0) {\n // before the start of the genome\n offset = chrPosition - 1;\n chrPosition = 1;\n }\n\n if (insertPoint === chromInfo.cumPositions.length - 1 && chrPosition > lastLength) {\n // beyond the last chromosome\n offset = chrPosition - lastLength;\n chrPosition = lastLength;\n }\n\n return [chromInfo.cumPositions[insertPoint].chr, chrPosition, offset, insertPoint] as const;\n};\n\n/**\n * Get a chromosome name for the consistentcy, e.g., `1` --> `chr1`.\n * @param chrName A chromosome name to be sanitized\n * @param assembly A genome assembly of the data\n * @param chromosomePrefix A prefix string that can be replaced to 'chr'\n * @returns\n */\nexport function sanitizeChrName(chrName: string, assembly: Assembly, chromosomePrefix?: string) {\n if (Array.isArray(assembly)) {\n // this is a custom assembly, so use this as is\n return chrName;\n }\n\n // For assemblies in Gosling, we use the `chr` prefix consistently\n if (chromosomePrefix) {\n // `hs1` --> `chr1`\n chrName = chrName.replace(chromosomePrefix, 'chr');\n } else if (!chrName.includes('chr')) {\n // `1` --> `chr1`\n chrName = `chr${chrName}`;\n }\n return chrName;\n}\n\nexport type ExtendedChromInfo = HiGlass.ChromInfo & {\n absToChr(absPos: number): ReturnType<typeof absToChr> | null;\n chrToAbs(chr: [name: string, pos: number]): number | null;\n};\n\nexport function tilesetInfoFromChromInfo(chromInfo: ExtendedChromInfo, tileSize = 1024) {\n return {\n tile_size: tileSize,\n bins_per_dimension: tileSize,\n max_zoom: Math.ceil(Math.log(chromInfo.totalLength / tileSize) / Math.log(2)),\n max_width: chromInfo.totalLength,\n min_pos: [0],\n max_pos: [chromInfo.totalLength]\n };\n}\n\nexport function sizesToChromInfo(sizes: [string, number][]): ExtendedChromInfo {\n const info: HiGlass.ChromInfo = {\n cumPositions: [],\n chromLengths: {},\n chrPositions: {},\n totalLength: 0\n };\n\n sizes.forEach(([chr, length], i) => {\n const chrPosition = { id: i, chr, pos: info.totalLength };\n info.chrPositions[chr] = chrPosition;\n info.chromLengths[chr] = length;\n info.cumPositions.push(chrPosition);\n info.totalLength += length;\n });\n\n return {\n ...info,\n absToChr: absPos => (info.chrPositions ? absToChr(absPos, info) : null),\n chrToAbs: ([chrName, chrPos]) => (info.chrPositions ? chrToAbs(chrName, chrPos, info) : null)\n };\n}\n\nexport class RemoteFile extends _RemoteFile {\n // Overrides `read` to eagerly read 200 or 206 response\n // from https://github.com/GMOD/generic-filehandle/blob/0e8209be25e3097307bd15e964edd8c017e808d7/src/remoteFile.ts#L100-L162\n public read: _RemoteFile['read'] = async (\n buffer,\n offset = 0,\n length,\n position = 0,\n opts = {}\n ): Promise<{ bytesRead: number; buffer: Buffer }> => {\n const { headers = {}, signal, overrides = {} } = opts;\n\n if (length < Infinity) {\n headers.range = `bytes=${position}-${position + length}`;\n } else if (length === Infinity && position !== 0) {\n headers.range = `bytes=${position}-`;\n }\n const args = {\n // @ts-expect-error private property\n ...this.baseOverrides,\n ...overrides,\n headers: {\n ...headers,\n ...overrides.headers,\n // @ts-expect-error private property\n ...this.baseOverrides.headers\n },\n method: 'GET',\n redirect: 'follow',\n mode: 'cors',\n signal\n };\n const response = await this.fetch(this.url, args);\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status} ${response.statusText} ${this.url}`);\n }\n\n // Just read the response if it was successful.\n if (response.status === 200 || response.status === 206) {\n // @ts-expect-error private method\n const responseData = await this.getBufferFromResponse(response);\n const bytesCopied = responseData.copy(buffer, offset, 0, Math.min(length, responseData.length));\n\n // try to parse out the size of the remote file\n const res = response.headers.get('content-range');\n const sizeMatch = /\\/(\\d+)$/.exec(res || '');\n if (sizeMatch && sizeMatch[1]) {\n // @ts-expect-error private property\n this._stat = { size: parseInt(sizeMatch[1], 10) };\n }\n\n return { bytesRead: bytesCopied, buffer };\n }\n\n // TODO: try harder here to gather more information about what the problem is\n throw new Error(`HTTP ${response.status} fetching ${this.url}`);\n };\n}\n\nexport interface TabularDataFetcher<Tile> {\n getTabularData(tileIds: string[]): Promise<Tile[]>;\n MAX_TILE_WIDTH?: number;\n}\n"],"names":["_RemoteFile"],"mappings":";;;;;;;;;AA6BO,SAAS,mBACZ,MACA,CAAC,MAAM,IAAI,GACX,QACF;AACE,QAAM,EAAE,GAAG,IAAI,IAAI,QAAQ;AACrB,QAAA,iBAAiB,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,OAAO,CAAA,MAAK,CAAC;AAC9C,SAAA,KAAK,OAAO,CAAC,MAAa;AACzB,QAAA,eAAe,WAAW,GAAG;AAEtB,aAAA;AAAA,IAAA,WACA,eAAe,WAAW,GAAG;AAEpC,YAAM,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC;AAClC,aAAO,OAAO,UAAU,YAAY,OAAO,SAAS,SAAS;AAAA,IAAA,OAC1D;AAEH,YAAM,SAAS,eAAe,IAAI,CAAA,MAAK,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAA,MAAK,CAAC,MAAM,CAAC,CAAC;AACnE,YAAM,WAAW,KAAK,IAAI,GAAG,MAAM;AACnC,YAAM,WAAW,KAAK,IAAI,GAAG,MAAM;AAC5B,aAAA,QAAQ,YAAY,YAAY;AAAA,IAC3C;AAAA,EAAA,CACH;AACL;AAE0B,SAAS,CAAC,MAAuB,EAAE,GAAG,EAAE;AA0ClD,SAAA,gBAAgB,SAAiB,UAAoB,kBAA2B;AACxF,MAAA,MAAM,QAAQ,QAAQ,GAAG;AAElB,WAAA;AAAA,EACX;AAGA,MAAI,kBAAkB;AAER,cAAA,QAAQ,QAAQ,kBAAkB,KAAK;AAAA,EAC1C,WAAA,CAAC,QAAQ,SAAS,KAAK,GAAG;AAEjC,cAAU,MAAM,OAAO;AAAA,EAC3B;AACO,SAAA;AACX;AAyCO,MAAM,mBAAmBA,aAAY;AAAA,EAArC;AAAA;AAGI;AAAA;AAAA,gCAA4B,OAC/B,QACA,SAAS,GACT,QACA,WAAW,GACX,OAAO,OAC0C;AAC3C,YAAA,EAAE,UAAU,IAAI,QAAQ,YAAY,CAAA,EAAO,IAAA;AAEjD,UAAI,SAAS,UAAU;AACnB,gBAAQ,QAAQ,SAAS,QAAQ,IAAI,WAAW,MAAM;AAAA,MAC/C,WAAA,WAAW,YAAY,aAAa,GAAG;AACtC,gBAAA,QAAQ,SAAS,QAAQ;AAAA,MACrC;AACA,YAAM,OAAO;AAAA;AAAA,QAET,GAAG,KAAK;AAAA,QACR,GAAG;AAAA,QACH,SAAS;AAAA,UACL,GAAG;AAAA,UACH,GAAG,UAAU;AAAA;AAAA,UAEb,GAAG,KAAK,cAAc;AAAA,QAC1B;AAAA,QACA,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAM;AAAA,QACN;AAAA,MAAA;AAEJ,YAAM,WAAW,MAAM,KAAK,MAAM,KAAK,KAAK,IAAI;AAE5C,UAAA,CAAC,SAAS,IAAI;AACR,cAAA,IAAI,MAAM,QAAQ,SAAS,MAAM,IAAI,SAAS,UAAU,IAAI,KAAK,GAAG,EAAE;AAAA,MAChF;AAGA,UAAI,SAAS,WAAW,OAAO,SAAS,WAAW,KAAK;AAEpD,cAAM,eAAe,MAAM,KAAK,sBAAsB,QAAQ;AACxD,cAAA,cAAc,aAAa,KAAK,QAAQ,QAAQ,GAAG,KAAK,IAAI,QAAQ,aAAa,MAAM,CAAC;AAG9F,cAAM,MAAM,SAAS,QAAQ,IAAI,eAAe;AAChD,cAAM,YAAY,WAAW,KAAK,OAAO,EAAE;AACvC,YAAA,aAAa,UAAU,CAAC,GAAG;AAEtB,eAAA,QAAQ,EAAE,MAAM,SAAS,UAAU,CAAC,GAAG,EAAE;QAClD;AAEO,eAAA,EAAE,WAAW,aAAa;MACrC;AAGM,YAAA,IAAI,MAAM,QAAQ,SAAS,MAAM,aAAa,KAAK,GAAG,EAAE;AAAA,IAAA;AAAA;AAEtE;"}
|
package/dist/gosling.js
CHANGED
|
@@ -34,8 +34,8 @@ import "bezier-js";
|
|
|
34
34
|
import { scaleLinear, scaleSequential, scaleOrdinal, scaleBand } from "d3-scale";
|
|
35
35
|
import { sampleSize, isEqual, uniqBy, cloneDeepWith } from "lodash-es";
|
|
36
36
|
import { interpolateViridis } from "d3-scale-chromatic";
|
|
37
|
-
import { g as getTextStyle, c as computeChromSizes, a as cartesianToPolar, u as uuid, R as RADIAN_GAP, v as valueToRadian, p as pointsToDegree, b as commonjsGlobal,
|
|
38
|
-
import {
|
|
37
|
+
import { g as getTextStyle, c as computeChromSizes, a as cartesianToPolar, u as uuid, R as RADIAN_GAP, v as valueToRadian, p as pointsToDegree, b as commonjsGlobal, I as IsOneOfFilter, d as IsRangeFilter, e as IsIncludeFilter, f as getChannelKeysByAggregateFnc, h as getChannelKeysByType, i as IsChannelDeep, j as IsDataDeepTileset, k as isThereTheme, l as getTheme$1, H as HIGLASS_AXIS_SIZE, S as SUPPORTED_CHANNELS, m as getGenomicChannelKeyFromTrack, n as getGenomicChannelFromTrack, o as IsChannelValue, q as logicalComparison, r as getValueUsingChannel, s as rectProperty, t as pointProperty, w as barProperty, x as IsStackedChannel, y as IsDomainArray, z as getNumericDomain, P as PREDEFINED_COLOR_STR_MAP, A as IsRangeArray, B as validateTrack, C as Is2DTrack, D as isTabularDataFetcher, E as drawPreEmbellishment, F as drawMark, G as drawPostEmbellishment, J as getRelativeGenomicPosition, K as shareScaleAcrossTracks, L as hasDataTransform, M as resolveSuperposedTracks, N as IsXAxis, O as IsMouseEventsDeep, Q as colorToHex, T as flatArrayToPairArray, U as GenomicPositionHelper, V as isObject, W as validateGoslingSpec, X as compile, Y as GoslingTemplates } from "./exported-compiler-e419fb4a.js";
|
|
38
|
+
import { Z, _ } from "./exported-compiler-e419fb4a.js";
|
|
39
39
|
import higlassRegister from "higlass-register";
|
|
40
40
|
import { TextTrack } from "higlass-text";
|
|
41
41
|
import RBush from "rbush";
|
|
@@ -46,6 +46,7 @@ import { spawn } from "threads";
|
|
|
46
46
|
import { Buffer as Buffer2 } from "buffer";
|
|
47
47
|
import QuickLRU from "quick-lru";
|
|
48
48
|
import { RemoteFile as RemoteFile$1, LocalFile } from "generic-filehandle";
|
|
49
|
+
import { R as RemoteFile, s as sanitizeChrName, f as filterUsingGenoPos } from "./exported-utils-26226ee9.js";
|
|
49
50
|
import { dsvFormat } from "d3-dsv";
|
|
50
51
|
import PubSub$1 from "pubsub-js";
|
|
51
52
|
import React, { forwardRef, useState, useEffect, useMemo, useRef, useImperativeHandle, useCallback } from "react";
|
|
@@ -53,7 +54,7 @@ import require$$0 from "react-dom";
|
|
|
53
54
|
import { HiGlassComponent } from "higlass";
|
|
54
55
|
import { ResizeSensor } from "css-element-queries";
|
|
55
56
|
const name = "gosling.js";
|
|
56
|
-
const version = "1.0.
|
|
57
|
+
const version = "1.0.2";
|
|
57
58
|
const $ref = "#/definitions/Theme";
|
|
58
59
|
const $schema = "http://json-schema.org/draft-07/schema#";
|
|
59
60
|
const definitions = {
|
|
@@ -1354,7 +1355,7 @@ const isCircleWithinRange = (range, x, radius = 5) => {
|
|
|
1354
1355
|
return isPointInsideRange(range, x - radius) && isPointInsideRange(range, x + radius);
|
|
1355
1356
|
};
|
|
1356
1357
|
const isAllPointsWithinRange = (range, path) => {
|
|
1357
|
-
return path.filter((
|
|
1358
|
+
return path.filter((_2, i) => i % 2 === 0).every((x) => isPointInsideRange(range, x));
|
|
1358
1359
|
};
|
|
1359
1360
|
const isPointNearLine = ([x, y], path, dist = 5) => {
|
|
1360
1361
|
let x1;
|
|
@@ -1444,19 +1445,19 @@ class MouseEventModel {
|
|
|
1444
1445
|
* Find the first event data that is within the mouse position.
|
|
1445
1446
|
*/
|
|
1446
1447
|
find(x, y, reverse = false) {
|
|
1447
|
-
const
|
|
1448
|
+
const _2 = Array.from(this.data);
|
|
1448
1449
|
if (reverse)
|
|
1449
|
-
|
|
1450
|
-
return
|
|
1450
|
+
_2.reverse();
|
|
1451
|
+
return _2.find((d) => this.isMouseWithin(d, x, y));
|
|
1451
1452
|
}
|
|
1452
1453
|
/**
|
|
1453
1454
|
* Find all event data that is within the mouse position.
|
|
1454
1455
|
*/
|
|
1455
1456
|
findAll(x, y, reverse = false) {
|
|
1456
|
-
const
|
|
1457
|
+
const _2 = Array.from(this.data);
|
|
1457
1458
|
if (reverse)
|
|
1458
|
-
|
|
1459
|
-
return
|
|
1459
|
+
_2.reverse();
|
|
1460
|
+
return _2.filter((d) => this.isMouseWithin(d, x, y));
|
|
1460
1461
|
}
|
|
1461
1462
|
/**
|
|
1462
1463
|
* Find all event data that matches the id values in the source and return them.
|
|
@@ -1467,7 +1468,7 @@ class MouseEventModel {
|
|
|
1467
1468
|
source.forEach((s) => {
|
|
1468
1469
|
const id = s.value[idField];
|
|
1469
1470
|
if (id) {
|
|
1470
|
-
siblings.push(...this.data.filter((
|
|
1471
|
+
siblings.push(...this.data.filter((_2) => _2.value[idField] === id && sourceUids.indexOf(_2.uid) === -1));
|
|
1471
1472
|
}
|
|
1472
1473
|
});
|
|
1473
1474
|
return siblings;
|
|
@@ -1490,10 +1491,10 @@ class MouseEventModel {
|
|
|
1490
1491
|
* Find all event data that is within the range along the x-axis.
|
|
1491
1492
|
*/
|
|
1492
1493
|
findAllWithinRange(x1, x2, reverse = false) {
|
|
1493
|
-
const
|
|
1494
|
+
const _2 = Array.from(this.data);
|
|
1494
1495
|
if (reverse)
|
|
1495
|
-
|
|
1496
|
-
return
|
|
1496
|
+
_2.reverse();
|
|
1497
|
+
return _2.filter((d) => this.isWithinRange(d, x1, x2));
|
|
1497
1498
|
}
|
|
1498
1499
|
/**
|
|
1499
1500
|
* Test if a given object is within an 1D range.
|
|
@@ -1772,7 +1773,7 @@ class Context {
|
|
|
1772
1773
|
});
|
|
1773
1774
|
}
|
|
1774
1775
|
getUnresolvedReferences() {
|
|
1775
|
-
return Array.from(this.references).filter(([
|
|
1776
|
+
return Array.from(this.references).filter(([_2, reference]) => !reference.resolved && !reference.requested).map(([alias, _2]) => alias);
|
|
1776
1777
|
}
|
|
1777
1778
|
}
|
|
1778
1779
|
const aliasRegistry = /* @__PURE__ */ new Map();
|
|
@@ -3140,7 +3141,7 @@ function abortableFetchDecorator(patchTargets) {
|
|
|
3140
3141
|
if (signal.aborted) {
|
|
3141
3142
|
return Promise.reject(abortError);
|
|
3142
3143
|
}
|
|
3143
|
-
var cancellation = new Promise(function(
|
|
3144
|
+
var cancellation = new Promise(function(_2, reject) {
|
|
3144
3145
|
signal.addEventListener("abort", function() {
|
|
3145
3146
|
return reject(abortError);
|
|
3146
3147
|
}, {
|
|
@@ -9086,8 +9087,8 @@ function concatString(concat, data) {
|
|
|
9086
9087
|
});
|
|
9087
9088
|
return output;
|
|
9088
9089
|
}
|
|
9089
|
-
function replaceString(
|
|
9090
|
-
const { field, replace, newField } =
|
|
9090
|
+
function replaceString(_2, data) {
|
|
9091
|
+
const { field, replace, newField } = _2;
|
|
9091
9092
|
let output = Array.from(data);
|
|
9092
9093
|
output = output.map((d) => {
|
|
9093
9094
|
d[newField] = d[field];
|
|
@@ -9114,8 +9115,8 @@ function calculateData(log, data) {
|
|
|
9114
9115
|
});
|
|
9115
9116
|
return output;
|
|
9116
9117
|
}
|
|
9117
|
-
function calculateGenomicLength(
|
|
9118
|
-
const { startField, endField, newField } =
|
|
9118
|
+
function calculateGenomicLength(_2, data) {
|
|
9119
|
+
const { startField, endField, newField } = _2;
|
|
9119
9120
|
const output = Array.from(data);
|
|
9120
9121
|
output.forEach((d) => {
|
|
9121
9122
|
const s = d[startField];
|
|
@@ -9127,8 +9128,8 @@ function calculateGenomicLength(_, data) {
|
|
|
9127
9128
|
});
|
|
9128
9129
|
return output;
|
|
9129
9130
|
}
|
|
9130
|
-
function inferSvType(
|
|
9131
|
-
const { firstBp, secondBp, newField } =
|
|
9131
|
+
function inferSvType(_2, data) {
|
|
9132
|
+
const { firstBp, secondBp, newField } = _2;
|
|
9132
9133
|
const output = Array.from(data);
|
|
9133
9134
|
const [DUP, TRA, DEL, t2tINV, h2hINV] = ["DUP", "TRA", "DEL", "t2tINV", "h2hINV"];
|
|
9134
9135
|
output.forEach((d) => {
|
|
@@ -9169,8 +9170,8 @@ function inferSvType(_, data) {
|
|
|
9169
9170
|
});
|
|
9170
9171
|
return output;
|
|
9171
9172
|
}
|
|
9172
|
-
function aggregateCoverage(
|
|
9173
|
-
const { startField, endField, newField, groupField } =
|
|
9173
|
+
function aggregateCoverage(_2, data, scale) {
|
|
9174
|
+
const { startField, endField, newField, groupField } = _2;
|
|
9174
9175
|
const coverage = {};
|
|
9175
9176
|
const binSize = 1;
|
|
9176
9177
|
data.forEach((d) => {
|
|
@@ -9304,8 +9305,8 @@ function splitExon(split, data, assembly = "hg38") {
|
|
|
9304
9305
|
}).reduce((a, b) => a.concat(b), []);
|
|
9305
9306
|
return output;
|
|
9306
9307
|
}
|
|
9307
|
-
function parseSubJSON(
|
|
9308
|
-
const { field, genomicField, baseGenomicField, genomicLengthField } =
|
|
9308
|
+
function parseSubJSON(_2, data) {
|
|
9309
|
+
const { field, genomicField, baseGenomicField, genomicLengthField } = _2;
|
|
9309
9310
|
let output = Array.from(data);
|
|
9310
9311
|
output = output.map((d) => {
|
|
9311
9312
|
let newRows = JSON.parse(d[field]);
|
|
@@ -12572,7 +12573,7 @@ const preverseZoomStatus = (newSpec, prevSpec) => {
|
|
|
12572
12573
|
if (isNewView) {
|
|
12573
12574
|
const { locksByViewUid } = newSpec.zoomLocks;
|
|
12574
12575
|
const lockUid = locksByViewUid[viewUid];
|
|
12575
|
-
const linkedViewUid = (_a = Object.entries(locksByViewUid).find(([
|
|
12576
|
+
const linkedViewUid = (_a = Object.entries(locksByViewUid).find(([_2, uid]) => _2 && uid === lockUid)) == null ? void 0 : _a[0];
|
|
12576
12577
|
const linkedViewExistedPrev = !!prevSpec.views.find((v) => v.uid === linkedViewUid);
|
|
12577
12578
|
if (linkedViewUid && linkedViewExistedPrev) {
|
|
12578
12579
|
view.initialXDomain = (_b = prevSpec.views.find((v) => v.uid === linkedViewUid)) == null ? void 0 : _b.initialXDomain;
|
|
@@ -12798,7 +12799,7 @@ function embed(element, spec, opts = {}) {
|
|
|
12798
12799
|
};
|
|
12799
12800
|
compile(
|
|
12800
12801
|
spec,
|
|
12801
|
-
async (hsSpec, size,
|
|
12802
|
+
async (hsSpec, size, _2, trackInfos, idTable) => {
|
|
12802
12803
|
const hg = await launchHiglass(element, hsSpec, size, options);
|
|
12803
12804
|
const api = createApi(hg, hsSpec, trackInfos, theme, idTable);
|
|
12804
12805
|
resolve(api);
|
|
@@ -12813,10 +12814,10 @@ function embed(element, spec, opts = {}) {
|
|
|
12813
12814
|
}
|
|
12814
12815
|
export {
|
|
12815
12816
|
GoslingComponent,
|
|
12816
|
-
|
|
12817
|
+
Z as GoslingSchema,
|
|
12817
12818
|
GoslingTemplates,
|
|
12818
12819
|
theme_schema as ThemeSchema,
|
|
12819
|
-
|
|
12820
|
+
_ as Themes,
|
|
12820
12821
|
compile,
|
|
12821
12822
|
embed,
|
|
12822
12823
|
getTheme$1 as getTheme,
|