@jbrowse/core 2.0.0 → 2.1.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/BaseFeatureWidget/BaseFeatureDetail.d.ts +9 -3
- package/BaseFeatureWidget/BaseFeatureDetail.js +313 -581
- package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -478
- package/BaseFeatureWidget/index.js +88 -126
- package/BaseFeatureWidget/types.d.ts +1 -0
- package/BaseFeatureWidget/types.js +1 -4
- package/BaseFeatureWidget/util.js +40 -75
- package/CorePlugin.js +55 -94
- package/Plugin.js +9 -34
- package/PluginLoader.js +153 -422
- package/PluginManager.d.ts +28 -33
- package/PluginManager.js +377 -666
- package/ReExports/Attributes.js +3 -10
- package/ReExports/BaseCard.js +3 -10
- package/ReExports/DataGrid.js +5 -12
- package/ReExports/FeatureDetails.js +3 -10
- package/ReExports/index.js +6 -12
- package/ReExports/list.d.ts +5 -0
- package/ReExports/list.js +271 -7
- package/ReExports/material-ui-colors.js +15 -16
- package/ReExports/modules.d.ts +11 -20
- package/ReExports/modules.js +453 -798
- package/TextSearch/BaseResults.js +51 -123
- package/TextSearch/TextSearchManager.js +66 -144
- package/assemblyManager/assembly.js +280 -555
- package/assemblyManager/assemblyConfigSchema.js +47 -64
- package/assemblyManager/assemblyManager.js +126 -272
- package/assemblyManager/index.js +9 -22
- package/configuration/configurationSchema.js +167 -203
- package/configuration/configurationSlot.js +248 -326
- package/configuration/index.js +19 -35
- package/configuration/util.js +131 -173
- package/data_adapters/BaseAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter.js +132 -521
- package/data_adapters/CytobandAdapter.js +40 -126
- package/data_adapters/dataAdapterCache.js +77 -158
- package/package.json +4 -5
- package/pluggableElementTypes/AdapterType.js +24 -79
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
- package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
- package/pluggableElementTypes/ConnectionType.js +22 -65
- package/pluggableElementTypes/DisplayType.js +35 -82
- package/pluggableElementTypes/InternetAccountType.js +23 -64
- package/pluggableElementTypes/PluggableElementBase.js +8 -20
- package/pluggableElementTypes/RpcMethodType.js +85 -427
- package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
- package/pluggableElementTypes/TrackType.js +26 -70
- package/pluggableElementTypes/ViewType.js +21 -63
- package/pluggableElementTypes/WidgetType.js +21 -64
- package/pluggableElementTypes/index.d.ts +4 -3
- package/pluggableElementTypes/index.js +42 -125
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
- package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
- package/pluggableElementTypes/models/BaseTrackModel.js +139 -199
- package/pluggableElementTypes/models/BaseViewModel.js +24 -40
- package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
- package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
- package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
- package/pluggableElementTypes/models/index.js +21 -70
- package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
- package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -255
- package/pluggableElementTypes/renderers/RendererType.js +31 -105
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
- package/pluggableElementTypes/renderers/index.js +19 -62
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
- package/rpc/BaseRpcDriver.js +169 -405
- package/rpc/MainThreadRpcDriver.js +27 -150
- package/rpc/RpcManager.js +58 -159
- package/rpc/WebWorkerRpcDriver.js +54 -171
- package/rpc/configSchema.js +25 -49
- package/rpc/coreRpcMethods.d.ts +1 -3
- package/rpc/coreRpcMethods.js +221 -959
- package/rpc/remoteAbortSignals.js +46 -70
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.js +106 -162
- package/ui/App.js +157 -242
- package/ui/AssemblySelector.js +59 -120
- package/ui/CascadingMenu.js +101 -196
- package/ui/ColorPicker.d.ts +16 -0
- package/ui/ColorPicker.js +97 -0
- package/ui/Drawer.js +28 -61
- package/ui/DrawerWidget.js +108 -202
- package/ui/DropDownMenu.js +60 -91
- package/ui/EditableTypography.js +87 -149
- package/ui/ErrorMessage.js +41 -56
- package/ui/FactoryResetDialog.js +24 -57
- package/ui/FatalErrorDialog.js +59 -91
- package/ui/FileSelector/FileSelector.js +123 -189
- package/ui/FileSelector/LocalFileChooser.js +44 -75
- package/ui/FileSelector/UrlChooser.js +17 -38
- package/ui/FileSelector/index.js +6 -12
- package/ui/Icons.js +45 -69
- package/ui/Logo.js +57 -110
- package/ui/Menu.js +232 -354
- package/ui/PrerenderedCanvas.js +63 -87
- package/ui/ResizeHandle.js +87 -116
- package/ui/ReturnToImportFormDialog.js +32 -63
- package/ui/SanitizedHTML.js +64 -47
- package/ui/Snackbar.js +74 -101
- package/ui/SnackbarModel.js +37 -51
- package/ui/Tooltip.js +49 -76
- package/ui/ViewContainer.js +113 -196
- package/ui/colors.d.ts +10 -0
- package/ui/colors.js +78 -0
- package/ui/index.js +51 -181
- package/ui/react-colorful.d.ts +17 -0
- package/ui/react-colorful.js +455 -0
- package/ui/theme.d.ts +23 -1
- package/ui/theme.js +199 -247
- package/util/Base1DUtils.d.ts +32 -0
- package/util/Base1DUtils.js +174 -0
- package/util/Base1DViewModel.d.ts +16 -30
- package/util/Base1DViewModel.js +116 -293
- package/util/QuickLRU.js +84 -332
- package/util/TimeTraveller.d.ts +19 -0
- package/util/TimeTraveller.js +86 -0
- package/util/aborting.js +49 -127
- package/util/analytics.js +91 -154
- package/util/blockTypes.js +106 -240
- package/util/calculateDynamicBlocks.js +98 -128
- package/util/calculateStaticBlocks.js +105 -125
- package/util/color/cssColorsLevel4.js +156 -160
- package/util/color/index.js +33 -55
- package/util/compositeMap.js +49 -333
- package/util/formatFastaStrings.js +9 -14
- package/util/idMaker.js +18 -31
- package/util/index.d.ts +18 -32
- package/util/index.js +747 -1226
- package/util/io/RemoteFileWithRangeCache.js +88 -257
- package/util/io/index.js +95 -169
- package/util/jexl.js +60 -115
- package/util/jexlStrings.js +24 -29
- package/util/layouts/BaseLayout.js +1 -4
- package/util/layouts/GranularRectLayout.js +388 -555
- package/util/layouts/MultiLayout.js +41 -109
- package/util/layouts/PrecomputedLayout.js +56 -112
- package/util/layouts/PrecomputedMultiLayout.js +22 -59
- package/util/layouts/SceneGraph.js +127 -197
- package/util/layouts/index.js +29 -66
- package/util/mst-reflection.js +55 -71
- package/util/offscreenCanvasPonyfill.js +66 -134
- package/util/offscreenCanvasUtils.d.ts +2 -7
- package/util/offscreenCanvasUtils.js +49 -146
- package/util/range.js +29 -40
- package/util/rxjs.js +20 -27
- package/util/simpleFeature.js +88 -152
- package/util/stats.js +91 -151
- package/util/tracks.js +130 -173
- package/util/types/index.js +110 -179
- package/util/types/mst.js +91 -146
- package/util/types/util.js +1 -4
- package/util/when.js +54 -101
- package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
- package/BaseFeatureWidget/index.test.js +0 -69
- package/TextSearch/BaseResults.test.js +0 -42
- package/configuration/configurationSchema.test.js +0 -266
- package/configuration/configurationSlot.test.js +0 -69
- package/configuration/util.test.js +0 -39
- package/data_adapters/BaseAdapter.test.js +0 -200
- package/declare.d.js +0 -1
- package/pluggableElementTypes/RpcMethodType.test.js +0 -118
- package/pluggableElementTypes/renderers/declare.d.js +0 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
- package/rpc/BaseRpcDriver.test.js +0 -540
- package/rpc/declaration.d.js +0 -1
- package/ui/FatalErrorDialog.test.js +0 -82
- package/ui/SanitizedHTML.test.js +0 -36
- package/ui/theme.test.js +0 -92
- package/util/Base1DViewModel.test.js +0 -130
- package/util/calculateDynamicBlocks.test.js +0 -74
- package/util/calculateStaticBlocks.test.js +0 -297
- package/util/declare.d.js +0 -1
- package/util/formatFastaStrings.test.js +0 -40
- package/util/index.test.js +0 -213
- package/util/jexlStrings.test.js +0 -48
- package/util/layouts/GranularRectLayout.test.js +0 -99
- package/util/range.test.js +0 -64
- package/util/simpleFeature.test.js +0 -34
- package/util/stats.test.js +0 -172
package/util/jexl.js
CHANGED
|
@@ -1,116 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
j.addFunction('startsWith', function (s, search, len) {
|
|
64
|
-
return s.startsWith(search, len);
|
|
65
|
-
});
|
|
66
|
-
j.addFunction('endsWith', function (s, search, len) {
|
|
67
|
-
return s.endsWith(search, len);
|
|
68
|
-
});
|
|
69
|
-
j.addFunction('padEnd', function (s, len, pad) {
|
|
70
|
-
return s.padEnd(len, pad);
|
|
71
|
-
});
|
|
72
|
-
j.addFunction('padStart', function (s, len, fill) {
|
|
73
|
-
return s.padStart(len, fill);
|
|
74
|
-
});
|
|
75
|
-
j.addFunction('repeat', function (s, count) {
|
|
76
|
-
return s.repeat(count);
|
|
77
|
-
});
|
|
78
|
-
j.addFunction('replace', function (s, match, sub) {
|
|
79
|
-
return s.replace(match, sub);
|
|
80
|
-
});
|
|
81
|
-
j.addFunction('replaceAll', function (s, match, sub) {
|
|
82
|
-
return s.replaceAll(match, sub);
|
|
83
|
-
});
|
|
84
|
-
j.addFunction('slice', function (s, start, end) {
|
|
85
|
-
return s.slice(start, end);
|
|
86
|
-
});
|
|
87
|
-
j.addFunction('startsWith', function (s, search, pos) {
|
|
88
|
-
return s.startsWith(search, pos);
|
|
89
|
-
});
|
|
90
|
-
j.addFunction('substring', function (s, start, end) {
|
|
91
|
-
return s.substring(start, end);
|
|
92
|
-
});
|
|
93
|
-
j.addFunction('toLowerCase', function (s) {
|
|
94
|
-
return s.toLowerCase();
|
|
95
|
-
});
|
|
96
|
-
j.addFunction('toUpperCase', function (s) {
|
|
97
|
-
return s.toUpperCase();
|
|
98
|
-
});
|
|
99
|
-
j.addFunction('trim', function (s) {
|
|
100
|
-
return s.trim();
|
|
101
|
-
});
|
|
102
|
-
j.addFunction('trimEnd', function (s) {
|
|
103
|
-
return s.trimEnd();
|
|
104
|
-
});
|
|
105
|
-
j.addFunction('trimStart', function (s) {
|
|
106
|
-
return s.trimStart();
|
|
107
|
-
});
|
|
108
|
-
j.addFunction('getTag', function (feature, s) {
|
|
109
|
-
var tags = feature.get('tags');
|
|
110
|
-
return tags ? tags[s] : feature.get(s);
|
|
111
|
-
});
|
|
112
|
-
j.addBinaryOp('&', 15, function (a, b) {
|
|
113
|
-
return a & b;
|
|
114
|
-
});
|
|
115
|
-
return j;
|
|
116
|
-
}
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jexl_1 = __importDefault(require("jexl"));
|
|
7
|
+
function default_1( /* config?: any*/) {
|
|
8
|
+
const j = new jexl_1.default.Jexl();
|
|
9
|
+
// someday will make sure all of configs callbacks are added in, including
|
|
10
|
+
// ones passed in
|
|
11
|
+
// below are core functions
|
|
12
|
+
j.addFunction('get', (feature, data) => feature.get(data));
|
|
13
|
+
j.addFunction('parent', (feature) => feature.parent());
|
|
14
|
+
j.addFunction('id', (feature) => feature.id());
|
|
15
|
+
// let user cast a jexl type into a javascript type
|
|
16
|
+
j.addFunction('cast', (arg) => arg);
|
|
17
|
+
// logging
|
|
18
|
+
j.addFunction('log', (thing) => {
|
|
19
|
+
console.log(thing); // eslint-disable-line no-console
|
|
20
|
+
return thing;
|
|
21
|
+
});
|
|
22
|
+
// math
|
|
23
|
+
// addfunction added in jexl 2.3 but types/jexl still on 2.2
|
|
24
|
+
j.addFunction('max', Math.max);
|
|
25
|
+
j.addFunction('min', Math.min);
|
|
26
|
+
j.addFunction('sqrt', Math.sqrt);
|
|
27
|
+
j.addFunction('ceil', Math.ceil);
|
|
28
|
+
j.addFunction('floor', Math.floor);
|
|
29
|
+
j.addFunction('round', Math.round);
|
|
30
|
+
j.addFunction('abs', Math.abs);
|
|
31
|
+
j.addFunction('log10', Math.log10);
|
|
32
|
+
j.addFunction('parseInt', Number.parseInt);
|
|
33
|
+
j.addFunction('parseFloat', Number.parseFloat);
|
|
34
|
+
// string
|
|
35
|
+
j.addFunction('split', (s, char) => s.split(char));
|
|
36
|
+
j.addFunction('charAt', (s, index) => s.charAt(index));
|
|
37
|
+
j.addFunction('charCodeAt', (s, index) => s.charCodeAt(index));
|
|
38
|
+
j.addFunction('codePointAt', (s, pos) => s.codePointAt(pos));
|
|
39
|
+
j.addFunction('startsWith', (s, search, len) => s.startsWith(search, len));
|
|
40
|
+
j.addFunction('endsWith', (s, search, len) => s.endsWith(search, len));
|
|
41
|
+
j.addFunction('padEnd', (s, len, pad) => s.padEnd(len, pad));
|
|
42
|
+
j.addFunction('padStart', (s, len, fill) => s.padStart(len, fill));
|
|
43
|
+
j.addFunction('repeat', (s, count) => s.repeat(count));
|
|
44
|
+
j.addFunction('replace', (s, match, sub) => s.replace(match, sub));
|
|
45
|
+
j.addFunction('replaceAll', (s, match, sub) => s.replaceAll(match, sub));
|
|
46
|
+
j.addFunction('slice', (s, start, end) => s.slice(start, end));
|
|
47
|
+
j.addFunction('startsWith', (s, search, pos) => s.startsWith(search, pos));
|
|
48
|
+
j.addFunction('substring', (s, start, end) => s.substring(start, end));
|
|
49
|
+
j.addFunction('toLowerCase', (s) => s.toLowerCase());
|
|
50
|
+
j.addFunction('toUpperCase', (s) => s.toUpperCase());
|
|
51
|
+
j.addFunction('trim', (s) => s.trim());
|
|
52
|
+
j.addFunction('trimEnd', (s) => s.trimEnd());
|
|
53
|
+
j.addFunction('trimStart', (s) => s.trimStart());
|
|
54
|
+
j.addFunction('getTag', (feature, s) => {
|
|
55
|
+
const tags = feature.get('tags');
|
|
56
|
+
return tags ? tags[s] : feature.get(s);
|
|
57
|
+
});
|
|
58
|
+
j.addBinaryOp('&', 15, (a, b) => a & b);
|
|
59
|
+
return j;
|
|
60
|
+
}
|
|
61
|
+
exports.default = default_1;
|
package/util/jexlStrings.js
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.stringToJexlExpression = stringToJexlExpression;
|
|
9
|
-
|
|
10
|
-
var _jexl = _interopRequireDefault(require("./jexl"));
|
|
11
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.stringToJexlExpression = void 0;
|
|
7
|
+
const jexl_1 = __importDefault(require("./jexl"));
|
|
12
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
-
|
|
9
|
+
const compilationCache = {};
|
|
10
|
+
// revert function strings back to main, create a different file for jexlStrings.ts
|
|
14
11
|
// pass the jexl property of the pluginManager as a param
|
|
15
|
-
|
|
16
12
|
/**
|
|
17
13
|
* compile a jexlExpression to a string
|
|
18
14
|
*
|
|
19
15
|
* @param str - string of code like `jexl:...`
|
|
20
16
|
* @param options -
|
|
21
17
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
function stringToJexlExpression(str,
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
20
|
jexl) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
const cacheKey = `nosig|${str}`;
|
|
22
|
+
if (!compilationCache[cacheKey]) {
|
|
23
|
+
const match = str.startsWith('jexl:');
|
|
24
|
+
if (!match) {
|
|
25
|
+
throw new Error('string does not appear to be in jexl format');
|
|
26
|
+
}
|
|
27
|
+
const code = str.split('jexl:')[1];
|
|
28
|
+
const compiled = jexl
|
|
29
|
+
? jexl.compile(`${code}`)
|
|
30
|
+
: (0, jexl_1.default)().compile(`${code}`);
|
|
31
|
+
compilationCache[cacheKey] = compiled;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
compilationCache[cacheKey] = compiled;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return compilationCache[cacheKey];
|
|
40
|
-
}
|
|
33
|
+
return compilationCache[cacheKey];
|
|
34
|
+
}
|
|
35
|
+
exports.stringToJexlExpression = stringToJexlExpression;
|