@jbrowse/core 1.4.4 → 1.5.3
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/BaseFeatureWidget/BaseFeatureDetail.d.ts +4 -4
- package/BaseFeatureWidget/BaseFeatureDetail.js +27 -8
- package/BaseFeatureWidget/SequenceFeatureDetails.js +10 -10
- package/BaseFeatureWidget/index.js +1 -1
- package/BaseFeatureWidget/types.d.ts +1 -1
- package/BaseFeatureWidget/util.js +3 -3
- package/CorePlugin.d.ts +0 -1
- package/CorePlugin.js +13 -1
- package/PluginLoader.d.ts +26 -4
- package/PluginLoader.js +337 -51
- package/PluginManager.d.ts +18 -11
- package/PluginManager.js +53 -31
- package/ReExports/list.js +1 -1
- package/ReExports/material-ui-colors.js +38 -38
- package/ReExports/modules.d.ts +19 -20
- package/ReExports/modules.js +10 -3
- package/TextSearch/BaseResults.d.ts +5 -14
- package/TextSearch/BaseResults.js +16 -58
- package/TextSearch/BaseResults.test.js +1 -11
- package/TextSearch/TextSearchManager.d.ts +3 -3
- package/TextSearch/TextSearchManager.js +1 -1
- package/assemblyManager/assembly.d.ts +21 -8
- package/assemblyManager/assembly.js +163 -120
- package/assemblyManager/assemblyConfigSchema.d.ts +3 -0
- package/assemblyManager/{assemblyConfigSchemas.js → assemblyConfigSchema.js} +35 -27
- package/assemblyManager/assemblyManager.d.ts +169 -60
- package/assemblyManager/index.d.ts +1 -1
- package/assemblyManager/index.js +5 -5
- package/configuration/configurationSchema.d.ts +3 -2
- package/configuration/configurationSchema.js +7 -10
- package/configuration/configurationSchema.test.js +4 -2
- package/configuration/configurationSlot.js +5 -4
- package/configuration/index.js +4 -4
- package/configuration/util.js +5 -5
- package/data_adapters/BaseAdapter.d.ts +5 -3
- package/data_adapters/BaseAdapter.js +7 -4
- package/data_adapters/BaseAdapter.test.js +4 -2
- package/data_adapters/CytobandAdapter.d.ts +8 -0
- package/data_adapters/CytobandAdapter.js +128 -0
- package/data_adapters/dataAdapterCache.js +3 -3
- package/package.json +7 -7
- package/pluggableElementTypes/AdapterType.d.ts +9 -1
- package/pluggableElementTypes/AdapterType.js +20 -0
- package/pluggableElementTypes/InternetAccountType.d.ts +12 -0
- package/pluggableElementTypes/InternetAccountType.js +64 -0
- package/pluggableElementTypes/PluggableElementBase.d.ts +1 -2
- package/pluggableElementTypes/PluggableElementBase.js +2 -3
- package/pluggableElementTypes/RpcMethodType.d.ts +3 -0
- package/pluggableElementTypes/RpcMethodType.js +269 -26
- package/pluggableElementTypes/RpcMethodType.test.d.ts +4 -0
- package/pluggableElementTypes/RpcMethodType.test.js +118 -0
- package/pluggableElementTypes/ViewType.d.ts +1 -1
- package/pluggableElementTypes/WidgetType.d.ts +1 -0
- package/pluggableElementTypes/index.d.ts +7 -3
- package/pluggableElementTypes/index.js +127 -1
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +6 -6
- package/pluggableElementTypes/models/BaseDisplayModel.js +1 -3
- package/pluggableElementTypes/models/BaseViewModel.js +13 -15
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +24 -0
- package/pluggableElementTypes/models/InternetAccountModel.js +85 -0
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +4 -0
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +25 -0
- package/pluggableElementTypes/models/index.d.ts +3 -0
- package/pluggableElementTypes/models/index.js +24 -8
- package/pluggableElementTypes/renderers/BoxRendererType.js +1 -1
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +15 -6
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +3 -3
- package/pluggableElementTypes/renderers/FeatureRendererType.js +17 -8
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -0
- package/pluggableElementTypes/renderers/RendererType.js +4 -1
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +1 -1
- package/pluggableElementTypes/renderers/index.d.ts +9 -0
- package/pluggableElementTypes/renderers/index.js +63 -0
- package/rpc/BaseRpcDriver.js +5 -9
- package/rpc/BaseRpcDriver.test.js +6 -6
- package/rpc/RpcManager.d.ts +1 -1
- package/rpc/RpcManager.js +44 -16
- package/rpc/WebWorkerRpcDriver.js +3 -3
- package/rpc/coreRpcMethods.d.ts +2 -1
- package/rpc/coreRpcMethods.js +109 -75
- package/rpc/remoteAbortSignals.js +2 -2
- package/ui/App.d.ts +17 -4
- package/ui/App.js +55 -41
- package/ui/Drawer.d.ts +6 -14
- package/ui/Drawer.js +11 -12
- package/ui/DrawerWidget.d.ts +5 -3
- package/ui/DrawerWidget.js +100 -61
- package/ui/ErrorMessage.d.ts +5 -0
- package/ui/ErrorMessage.js +54 -0
- package/ui/FileSelector/FileSelector.d.ts +11 -0
- package/ui/FileSelector/FileSelector.js +198 -0
- package/ui/FileSelector/LocalFileChooser.d.ts +7 -0
- package/ui/FileSelector/LocalFileChooser.js +79 -0
- package/ui/FileSelector/UrlChooser.d.ts +9 -0
- package/ui/FileSelector/UrlChooser.js +41 -0
- package/ui/FileSelector/index.d.ts +2 -0
- package/ui/FileSelector/index.js +13 -0
- package/ui/Icons.d.ts +4 -0
- package/ui/Icons.js +34 -0
- package/ui/Logo.js +1 -1
- package/ui/PrerenderedCanvas.d.ts +1 -0
- package/ui/PrerenderedCanvas.js +4 -1
- package/ui/ResizeHandle.d.ts +2 -3
- package/ui/ResizeHandle.js +6 -7
- package/ui/SanitizedHTML.js +1 -1
- package/ui/Snackbar.js +4 -6
- package/ui/SnackbarModel.d.ts +16 -0
- package/ui/SnackbarModel.js +56 -0
- package/ui/Tooltip.d.ts +1 -1
- package/ui/index.js +24 -24
- package/ui/theme.js +5 -5
- package/util/QuickLRU.d.ts +1 -1
- package/util/QuickLRU.js +3 -3
- package/util/aborting.d.ts +1 -1
- package/util/aborting.js +10 -11
- package/util/analytics.d.ts +2 -2
- package/util/analytics.js +20 -7
- package/util/blockTypes.d.ts +11 -6
- package/util/blockTypes.js +7 -1
- package/util/color/cssColorsLevel4.js +1 -1
- package/util/color/index.js +5 -5
- package/util/compositeMap.js +3 -3
- package/util/index.d.ts +6 -16
- package/util/index.js +76 -100
- package/util/io/RemoteFileWithRangeCache.d.ts +17 -0
- package/util/io/RemoteFileWithRangeCache.js +266 -0
- package/util/io/index.d.ts +4 -2
- package/util/io/index.js +134 -25
- package/util/jexl.js +4 -1
- package/util/layouts/BaseLayout.d.ts +3 -0
- package/util/layouts/GranularRectLayout.d.ts +19 -10
- package/util/layouts/GranularRectLayout.js +459 -100
- package/util/layouts/GranularRectLayout.test.js +57 -10
- package/util/layouts/PrecomputedLayout.js +2 -1
- package/util/layouts/index.d.ts +7 -0
- package/util/layouts/index.js +68 -0
- package/util/mst-reflection.js +3 -3
- package/util/offscreenCanvasPonyfill.js +1 -1
- package/util/range.js +1 -1
- package/util/simpleFeature.js +1 -1
- package/util/stats.js +2 -2
- package/util/tracks.d.ts +31 -362
- package/util/tracks.js +74 -190
- package/util/types/index.d.ts +54 -10
- package/util/types/index.js +110 -8
- package/util/types/mst.d.ts +46 -2
- package/util/types/mst.js +56 -8
- package/util/types/util.d.ts +1 -1
- package/util/when.js +1 -1
- package/assemblyManager/assemblyConfigSchemas.d.ts +0 -7
- package/ui/FileSelector.d.ts +0 -9
- package/ui/FileSelector.js +0 -150
- package/util/io/LocalFile.d.ts +0 -18
- package/util/io/LocalFile.js +0 -220
- package/util/io/rangeFetcher.d.ts +0 -3
- package/util/io/rangeFetcher.js +0 -236
- package/value.d.ts +0 -1
- package/value.js +0 -10
package/util/io/index.js
CHANGED
|
@@ -5,28 +5,27 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
Object.defineProperty(exports, "RemoteFileWithRangeCache", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _RemoteFileWithRangeCache.RemoteFileWithRangeCache;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
8
14
|
exports.openLocation = openLocation;
|
|
9
|
-
exports.openUrl = void 0;
|
|
10
|
-
|
|
11
|
-
var _genericFilehandle = require("generic-filehandle");
|
|
12
15
|
|
|
13
|
-
var
|
|
16
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
14
17
|
|
|
15
|
-
var
|
|
18
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
19
|
|
|
17
|
-
var
|
|
20
|
+
var _genericFilehandle = require("generic-filehandle");
|
|
18
21
|
|
|
19
|
-
var
|
|
22
|
+
var _RemoteFileWithRangeCache = require("./RemoteFileWithRangeCache");
|
|
20
23
|
|
|
21
|
-
var
|
|
22
|
-
return (0, _rangeFetcher.openUrl)(arg);
|
|
23
|
-
};
|
|
24
|
+
var _types = require("../types");
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
var _tracks = require("../tracks");
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
return 'uri' in location;
|
|
29
|
-
}
|
|
28
|
+
var _detectNode = _interopRequireDefault(require("detect-node"));
|
|
30
29
|
|
|
31
30
|
function isLocalPathLocation(location) {
|
|
32
31
|
return 'localPath' in location;
|
|
@@ -36,7 +35,51 @@ function isBlobLocation(location) {
|
|
|
36
35
|
return 'blobId' in location;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
function openLocation(location) {
|
|
38
|
+
function openLocation(location, pluginManager) {
|
|
39
|
+
function checkAuthNeededFetch(_x, _x2) {
|
|
40
|
+
return _checkAuthNeededFetch.apply(this, arguments);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function _checkAuthNeededFetch() {
|
|
44
|
+
_checkAuthNeededFetch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, opts) {
|
|
45
|
+
var response, authHeaders;
|
|
46
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
47
|
+
while (1) {
|
|
48
|
+
switch (_context.prev = _context.next) {
|
|
49
|
+
case 0:
|
|
50
|
+
_context.next = 2;
|
|
51
|
+
return fetch(url, opts);
|
|
52
|
+
|
|
53
|
+
case 2:
|
|
54
|
+
response = _context.sent;
|
|
55
|
+
|
|
56
|
+
if (!(response.status === 401)) {
|
|
57
|
+
_context.next = 7;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
authHeaders = response.headers.get('WWW-Authenticate');
|
|
62
|
+
|
|
63
|
+
if (!((0, _types.isUriLocation)(location) && authHeaders && authHeaders.includes('Basic'))) {
|
|
64
|
+
_context.next = 7;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
throw new _types.AuthNeededError('Accessing HTTPBasic resource without authentication', location);
|
|
69
|
+
|
|
70
|
+
case 7:
|
|
71
|
+
return _context.abrupt("return", response);
|
|
72
|
+
|
|
73
|
+
case 8:
|
|
74
|
+
case "end":
|
|
75
|
+
return _context.stop();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, _callee);
|
|
79
|
+
}));
|
|
80
|
+
return _checkAuthNeededFetch.apply(this, arguments);
|
|
81
|
+
}
|
|
82
|
+
|
|
40
83
|
if (!location) {
|
|
41
84
|
throw new Error('must provide a location to openLocation');
|
|
42
85
|
}
|
|
@@ -46,21 +89,13 @@ function openLocation(location) {
|
|
|
46
89
|
throw new Error('No local path provided');
|
|
47
90
|
}
|
|
48
91
|
|
|
49
|
-
if (
|
|
50
|
-
return new
|
|
92
|
+
if (_detectNode.default) {
|
|
93
|
+
return new _genericFilehandle.LocalFile(location.localPath);
|
|
51
94
|
} else {
|
|
52
95
|
throw new Error("can't use local files in the browser");
|
|
53
96
|
}
|
|
54
97
|
}
|
|
55
98
|
|
|
56
|
-
if (isUriLocation(location)) {
|
|
57
|
-
if (!location.uri) {
|
|
58
|
-
throw new Error('No URI provided');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return openUrl(location.baseUri ? new URL(location.uri, location.baseUri).href : location.uri);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
99
|
if (isBlobLocation(location)) {
|
|
65
100
|
// special case where blob is not directly stored on the model, use a getter
|
|
66
101
|
var blob = (0, _tracks.getBlob)(location.blobId);
|
|
@@ -72,5 +107,79 @@ function openLocation(location) {
|
|
|
72
107
|
return new _genericFilehandle.BlobFile(blob);
|
|
73
108
|
}
|
|
74
109
|
|
|
110
|
+
if ((0, _types.isUriLocation)(location)) {
|
|
111
|
+
if (!location.uri) {
|
|
112
|
+
throw new Error('No URI provided');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (location.internetAccountPreAuthorization) {
|
|
116
|
+
if (!pluginManager) {
|
|
117
|
+
throw new Error('need plugin manager to open locations with an internet account');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var rootModel = pluginManager.rootModel;
|
|
121
|
+
|
|
122
|
+
if (rootModel && !(0, _types.isAppRootModel)(rootModel)) {
|
|
123
|
+
throw new Error('This context does not support internet accounts');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var internetAccount;
|
|
127
|
+
|
|
128
|
+
if (rootModel) {
|
|
129
|
+
internetAccount = rootModel.findAppropriateInternetAccount(location);
|
|
130
|
+
} else {
|
|
131
|
+
var internetAccountType = pluginManager.getInternetAccountType(location.internetAccountPreAuthorization.internetAccountType);
|
|
132
|
+
internetAccount = internetAccountType.stateModel.create({
|
|
133
|
+
type: location.internetAccountPreAuthorization.internetAccountType,
|
|
134
|
+
configuration: location.internetAccountPreAuthorization.authInfo.configuration
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
if (!location.internetAccountPreAuthorization.authInfo.token) {
|
|
138
|
+
throw new Error('Failed to obtain token from internet account. Try reloading the page');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (!internetAccount) {
|
|
143
|
+
throw new Error('Could not find associated internet account');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return internetAccount.openLocation(location);
|
|
147
|
+
} else if (location.internetAccountId) {
|
|
148
|
+
if (!pluginManager) {
|
|
149
|
+
throw new Error('need plugin manager to open locations with an internet account');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
var _rootModel = pluginManager.rootModel;
|
|
153
|
+
|
|
154
|
+
if (_rootModel && !(0, _types.isAppRootModel)(_rootModel)) {
|
|
155
|
+
throw new Error('This context does not support internet accounts');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (_rootModel) {
|
|
159
|
+
var modifiedLocation = JSON.parse(JSON.stringify(location));
|
|
160
|
+
|
|
161
|
+
var _internetAccount = _rootModel.findAppropriateInternetAccount(location);
|
|
162
|
+
|
|
163
|
+
if (!_internetAccount) {
|
|
164
|
+
throw new Error('Could not find associated internet account');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
_internetAccount.getPreAuthorizationInformation(location).then( // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
168
|
+
function (preAuthInfo) {
|
|
169
|
+
return modifiedLocation.internetAccountPreAuthorization = preAuthInfo;
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
return _internetAccount.openLocation(modifiedLocation);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
throw new Error('Could not pre-authorize location');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var url = location.baseUri ? new URL(location.uri, location.baseUri).href : location.uri;
|
|
179
|
+
return new _RemoteFileWithRangeCache.RemoteFileWithRangeCache(url, {
|
|
180
|
+
fetch: checkAuthNeededFetch
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
75
184
|
throw new Error('invalid fileLocation');
|
|
76
185
|
}
|
package/util/jexl.js
CHANGED
|
@@ -9,7 +9,9 @@ exports.default = _default;
|
|
|
9
9
|
|
|
10
10
|
var _jexl = _interopRequireDefault(require("jexl"));
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function
|
|
13
|
+
/* config?: any*/
|
|
14
|
+
_default() {
|
|
13
15
|
var j = new _jexl.default.Jexl(); // someday will make sure all of configs callbacks are added in, including
|
|
14
16
|
// ones passed in
|
|
15
17
|
// below are core functions
|
|
@@ -40,6 +42,7 @@ function _default() {
|
|
|
40
42
|
j.addFunction('floor', Math.floor);
|
|
41
43
|
j.addFunction('round', Math.round);
|
|
42
44
|
j.addFunction('abs', Math.abs);
|
|
45
|
+
j.addFunction('log10', Math.log10);
|
|
43
46
|
j.addFunction('parseInt', Number.parseInt);
|
|
44
47
|
j.addFunction('parseFloat', Number.parseFloat); // string
|
|
45
48
|
|
|
@@ -10,11 +10,14 @@ export interface Rectangle<T> {
|
|
|
10
10
|
r: number;
|
|
11
11
|
top: number | null;
|
|
12
12
|
h: number;
|
|
13
|
+
originalHeight: number;
|
|
13
14
|
data?: Record<string, T>;
|
|
14
15
|
}
|
|
15
16
|
export interface BaseLayout<T> {
|
|
16
17
|
addRect(id: string, left: number, right: number, height: number, data?: Record<string, T>): number | null;
|
|
17
18
|
collides(rect: Rectangle<T>, top: number): boolean;
|
|
19
|
+
addRectToBitmap(rect: Rectangle<T>, data: Record<string, T>): void;
|
|
20
|
+
getRectangles(): Map<string, RectTuple>;
|
|
18
21
|
discardRange(left: number, right: number): void;
|
|
19
22
|
serializeRegion(region: {
|
|
20
23
|
start: number;
|
|
@@ -1,38 +1,47 @@
|
|
|
1
|
-
import { RectTuple, SerializedLayout, BaseLayout } from './BaseLayout';
|
|
1
|
+
import { RectTuple, SerializedLayout, Rectangle, BaseLayout } from './BaseLayout';
|
|
2
2
|
export default class GranularRectLayout<T> implements BaseLayout<T> {
|
|
3
|
+
private pitchX;
|
|
4
|
+
private pitchY;
|
|
5
|
+
private hardRowLimit;
|
|
6
|
+
private bitmap;
|
|
3
7
|
private rectangles;
|
|
4
8
|
maxHeightReached: boolean;
|
|
5
9
|
private maxHeight;
|
|
6
|
-
private
|
|
7
|
-
private spacing;
|
|
10
|
+
private displayMode;
|
|
8
11
|
private pTotalHeight;
|
|
9
|
-
|
|
10
|
-
constructor({ maxHeight, spacing, pitchX, }?: {
|
|
11
|
-
maxHeight?: number;
|
|
12
|
-
spacing?: number;
|
|
12
|
+
constructor({ pitchX, pitchY, maxHeight, hardRowLimit, displayMode, }?: {
|
|
13
13
|
pitchX?: number;
|
|
14
|
+
pitchY?: number;
|
|
15
|
+
maxHeight?: number;
|
|
16
|
+
displayMode?: string;
|
|
17
|
+
hardRowLimit?: number;
|
|
14
18
|
});
|
|
15
19
|
/**
|
|
16
20
|
* @returns top position for the rect, or Null if laying
|
|
17
21
|
* out the rect would exceed maxHeight
|
|
18
22
|
*/
|
|
19
23
|
addRect(id: string, left: number, right: number, height: number, data?: Record<string, T>): number | null;
|
|
20
|
-
collides(): boolean;
|
|
24
|
+
collides(rect: Rectangle<T>, top: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* make a subarray if it does not exist
|
|
27
|
+
*/
|
|
28
|
+
private autovivifyRow;
|
|
29
|
+
addRectToBitmap(rect: Rectangle<T>): void;
|
|
21
30
|
/**
|
|
22
31
|
* Given a range of X coordinates, deletes all data dealing with
|
|
23
32
|
* the features.
|
|
24
33
|
*/
|
|
25
|
-
discardRange(): void;
|
|
34
|
+
discardRange(left: number, right: number): void;
|
|
26
35
|
hasSeen(id: string): boolean;
|
|
27
36
|
getByCoord(x: number, y: number): Record<string, T> | string | undefined;
|
|
28
37
|
getByID(id: string): RectTuple | undefined;
|
|
29
38
|
cleanup(): void;
|
|
30
39
|
getTotalHeight(): number;
|
|
31
40
|
get totalHeight(): number;
|
|
41
|
+
getRectangles(): Map<string, RectTuple>;
|
|
32
42
|
serializeRegion(region: {
|
|
33
43
|
start: number;
|
|
34
44
|
end: number;
|
|
35
45
|
}): SerializedLayout;
|
|
36
|
-
getRectangles(): Map<string, RectTuple>;
|
|
37
46
|
toJSON(): SerializedLayout;
|
|
38
47
|
}
|