@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
|
@@ -1,313 +1,154 @@
|
|
|
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
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
-
|
|
24
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
-
|
|
26
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
27
|
-
|
|
28
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
29
|
-
|
|
30
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
|
-
|
|
32
|
-
var _fastDeepEqual = _interopRequireDefault(require("fast-deep-equal"));
|
|
33
|
-
|
|
34
|
-
var _GranularRectLayout = _interopRequireDefault(require("../../util/layouts/GranularRectLayout"));
|
|
35
|
-
|
|
36
|
-
var _MultiLayout = _interopRequireDefault(require("../../util/layouts/MultiLayout"));
|
|
37
|
-
|
|
38
|
-
var _PrecomputedLayout = _interopRequireDefault(require("../../util/layouts/PrecomputedLayout"));
|
|
39
|
-
|
|
40
|
-
var _FeatureRendererType2 = _interopRequireDefault(require("./FeatureRendererType"));
|
|
41
|
-
|
|
42
|
-
var _util = require("../../util");
|
|
43
|
-
|
|
44
|
-
var _configuration = require("../../configuration");
|
|
45
|
-
|
|
46
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
47
|
-
|
|
48
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
49
|
-
|
|
50
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
51
|
-
|
|
52
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
-
|
|
54
|
-
var LayoutSession = /*#__PURE__*/function () {
|
|
55
|
-
function LayoutSession(args) {
|
|
56
|
-
(0, _classCallCheck2.default)(this, LayoutSession);
|
|
57
|
-
(0, _defineProperty2.default)(this, "config", void 0);
|
|
58
|
-
(0, _defineProperty2.default)(this, "bpPerPx", void 0);
|
|
59
|
-
(0, _defineProperty2.default)(this, "filters", void 0);
|
|
60
|
-
(0, _defineProperty2.default)(this, "cachedLayout", void 0);
|
|
61
|
-
this.config = args.config;
|
|
62
|
-
this.bpPerPx = args.bpPerPx;
|
|
63
|
-
this.filters = args.filters;
|
|
64
|
-
this.update(args);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
(0, _createClass2.default)(LayoutSession, [{
|
|
68
|
-
key: "update",
|
|
69
|
-
value: function update(props) {
|
|
70
|
-
Object.assign(this, props);
|
|
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.LayoutSession = void 0;
|
|
7
|
+
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
+
const GranularRectLayout_1 = __importDefault(require("../../util/layouts/GranularRectLayout"));
|
|
9
|
+
const MultiLayout_1 = __importDefault(require("../../util/layouts/MultiLayout"));
|
|
10
|
+
const PrecomputedLayout_1 = __importDefault(require("../../util/layouts/PrecomputedLayout"));
|
|
11
|
+
const FeatureRendererType_1 = __importDefault(require("./FeatureRendererType"));
|
|
12
|
+
const util_1 = require("../../util");
|
|
13
|
+
const configuration_1 = require("../../configuration");
|
|
14
|
+
class LayoutSession {
|
|
15
|
+
constructor(args) {
|
|
16
|
+
this.config = args.config;
|
|
17
|
+
this.bpPerPx = args.bpPerPx;
|
|
18
|
+
this.filters = args.filters;
|
|
19
|
+
this.update(args);
|
|
71
20
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
21
|
+
update(props) {
|
|
22
|
+
Object.assign(this, props);
|
|
23
|
+
}
|
|
24
|
+
makeLayout() {
|
|
25
|
+
return new MultiLayout_1.default(GranularRectLayout_1.default, {
|
|
26
|
+
maxHeight: (0, configuration_1.readConfObject)(this.config, 'maxHeight'),
|
|
27
|
+
displayMode: (0, configuration_1.readConfObject)(this.config, 'displayMode'),
|
|
28
|
+
pitchX: this.bpPerPx,
|
|
29
|
+
pitchY: (0, configuration_1.readConfObject)(this.config, 'noSpacing') ? 1 : 3,
|
|
30
|
+
});
|
|
81
31
|
}
|
|
82
32
|
/**
|
|
83
33
|
* @param layout -
|
|
84
34
|
* @returns true if the given layout is a valid one to use for this session
|
|
85
35
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
36
|
+
cachedLayoutIsValid(cachedLayout) {
|
|
37
|
+
return (cachedLayout &&
|
|
38
|
+
cachedLayout.layout.subLayoutConstructorArgs.pitchX === this.bpPerPx &&
|
|
39
|
+
(0, fast_deep_equal_1.default)((0, configuration_1.readConfObject)(this.config), cachedLayout.config) &&
|
|
40
|
+
(0, fast_deep_equal_1.default)(this.filters, cachedLayout.filters));
|
|
91
41
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return this.cachedLayout.layout;
|
|
42
|
+
get layout() {
|
|
43
|
+
if (!this.cachedLayout || !this.cachedLayoutIsValid(this.cachedLayout)) {
|
|
44
|
+
this.cachedLayout = {
|
|
45
|
+
layout: this.makeLayout(),
|
|
46
|
+
config: (0, configuration_1.readConfObject)(this.config),
|
|
47
|
+
filters: this.filters,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return this.cachedLayout.layout;
|
|
104
51
|
}
|
|
105
|
-
|
|
106
|
-
return LayoutSession;
|
|
107
|
-
}();
|
|
108
|
-
|
|
52
|
+
}
|
|
109
53
|
exports.LayoutSession = LayoutSession;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
54
|
+
class BoxRendererType extends FeatureRendererType_1.default {
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments);
|
|
57
|
+
this.sessions = {};
|
|
58
|
+
}
|
|
59
|
+
getWorkerSession(props) {
|
|
60
|
+
const key = (0, util_1.getLayoutId)(props);
|
|
61
|
+
if (!this.sessions[key]) {
|
|
62
|
+
this.sessions[key] = this.createSession(props);
|
|
63
|
+
}
|
|
64
|
+
const session = this.sessions[key];
|
|
65
|
+
session.update(props);
|
|
66
|
+
return session;
|
|
123
67
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
} // expands region for glyphs to use
|
|
143
|
-
|
|
144
|
-
}, {
|
|
145
|
-
key: "getExpandedRegion",
|
|
146
|
-
value: function getExpandedRegion(region, renderArgs) {
|
|
147
|
-
if (!region) {
|
|
148
|
-
return region;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
var bpPerPx = renderArgs.bpPerPx,
|
|
152
|
-
config = renderArgs.config;
|
|
153
|
-
var maxFeatureGlyphExpansion = config === undefined ? 0 : (0, _configuration.readConfObject)(config, 'maxFeatureGlyphExpansion');
|
|
154
|
-
|
|
155
|
-
if (!maxFeatureGlyphExpansion) {
|
|
156
|
-
return region;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
var bpExpansion = Math.round(maxFeatureGlyphExpansion * bpPerPx);
|
|
160
|
-
return _objectSpread(_objectSpread({}, region), {}, {
|
|
161
|
-
start: Math.floor(Math.max(region.start - bpExpansion, 0)),
|
|
162
|
-
end: Math.ceil(region.end + bpExpansion)
|
|
163
|
-
});
|
|
68
|
+
// expands region for glyphs to use
|
|
69
|
+
getExpandedRegion(region, renderArgs) {
|
|
70
|
+
if (!region) {
|
|
71
|
+
return region;
|
|
72
|
+
}
|
|
73
|
+
const { bpPerPx, config } = renderArgs;
|
|
74
|
+
const maxFeatureGlyphExpansion = config === undefined
|
|
75
|
+
? 0
|
|
76
|
+
: (0, configuration_1.readConfObject)(config, 'maxFeatureGlyphExpansion');
|
|
77
|
+
if (!maxFeatureGlyphExpansion) {
|
|
78
|
+
return region;
|
|
79
|
+
}
|
|
80
|
+
const bpExpansion = Math.round(maxFeatureGlyphExpansion * bpPerPx);
|
|
81
|
+
return {
|
|
82
|
+
...region,
|
|
83
|
+
start: Math.floor(Math.max(region.start - bpExpansion, 0)),
|
|
84
|
+
end: Math.ceil(region.end + bpExpansion),
|
|
85
|
+
};
|
|
164
86
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
value: function createSession(props) {
|
|
168
|
-
return new LayoutSession(props);
|
|
87
|
+
createSession(props) {
|
|
88
|
+
return new LayoutSession(props);
|
|
169
89
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (!regions && session) {
|
|
185
|
-
delete this.sessions[key];
|
|
186
|
-
freed = 1;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (session && regions) {
|
|
190
|
-
session.layout.discardRange(regions[0].refName, regions[0].start, regions[0].end);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
_context.t0 = freed;
|
|
194
|
-
_context.next = 9;
|
|
195
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(BoxRendererType.prototype), "freeResourcesInClient", this).call(this, rpcManager, args);
|
|
196
|
-
|
|
197
|
-
case 9:
|
|
198
|
-
_context.t1 = _context.sent;
|
|
199
|
-
return _context.abrupt("return", _context.t0 + _context.t1);
|
|
200
|
-
|
|
201
|
-
case 11:
|
|
202
|
-
case "end":
|
|
203
|
-
return _context.stop();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}, _callee, this);
|
|
207
|
-
}));
|
|
208
|
-
|
|
209
|
-
function freeResourcesInClient(_x, _x2) {
|
|
210
|
-
return _freeResourcesInClient.apply(this, arguments);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return freeResourcesInClient;
|
|
214
|
-
}()
|
|
215
|
-
}, {
|
|
216
|
-
key: "deserializeLayoutInClient",
|
|
217
|
-
value: function deserializeLayoutInClient(json) {
|
|
218
|
-
return new _PrecomputedLayout.default(json);
|
|
90
|
+
async freeResourcesInClient(rpcManager, args) {
|
|
91
|
+
const { regions } = args;
|
|
92
|
+
const key = (0, util_1.getLayoutId)(args);
|
|
93
|
+
let freed = 0;
|
|
94
|
+
const session = this.sessions[key];
|
|
95
|
+
if (!regions && session) {
|
|
96
|
+
delete this.sessions[key];
|
|
97
|
+
freed = 1;
|
|
98
|
+
}
|
|
99
|
+
if (session && regions) {
|
|
100
|
+
session.layout.discardRange(regions[0].refName, regions[0].start, regions[0].end);
|
|
101
|
+
}
|
|
102
|
+
return freed + (await super.freeResourcesInClient(rpcManager, args));
|
|
219
103
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
value: function deserializeResultsInClient(result, args) {
|
|
223
|
-
var layout = this.deserializeLayoutInClient(result.layout);
|
|
224
|
-
var deserialized = (0, _get2.default)((0, _getPrototypeOf2.default)(BoxRendererType.prototype), "deserializeResultsInClient", this).call(this, _objectSpread(_objectSpread({}, result), {}, {
|
|
225
|
-
layout: layout
|
|
226
|
-
}), args); // // debugging aid: check if there are features in `features` that are not in the layout
|
|
227
|
-
// const featureIds1 = iterMap(deserialized.features.values(), f =>
|
|
228
|
-
// f.id(),
|
|
229
|
-
// ).sort()
|
|
230
|
-
// const featureIds2 = Object.keys(
|
|
231
|
-
// deserialized.layout.toJSON().rectangles,
|
|
232
|
-
// ).sort()
|
|
233
|
-
// if (
|
|
234
|
-
// featureIds1.length > featureIds2.length &&
|
|
235
|
-
// !deserialized.layout.maxHeightReached
|
|
236
|
-
// )
|
|
237
|
-
// debugger
|
|
238
|
-
|
|
239
|
-
return deserialized;
|
|
104
|
+
deserializeLayoutInClient(json) {
|
|
105
|
+
return new PrecomputedLayout_1.default(json);
|
|
240
106
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
107
|
+
deserializeResultsInClient(result, args) {
|
|
108
|
+
const layout = this.deserializeLayoutInClient(result.layout);
|
|
109
|
+
const deserialized = super.deserializeResultsInClient({ ...result, layout }, args);
|
|
110
|
+
// // debugging aid: check if there are features in `features` that are not in the layout
|
|
111
|
+
// const featureIds1 = iterMap(deserialized.features.values(), f =>
|
|
112
|
+
// f.id(),
|
|
113
|
+
// ).sort()
|
|
114
|
+
// const featureIds2 = Object.keys(
|
|
115
|
+
// deserialized.layout.toJSON().rectangles,
|
|
116
|
+
// ).sort()
|
|
117
|
+
// if (
|
|
118
|
+
// featureIds1.length > featureIds2.length &&
|
|
119
|
+
// !deserialized.layout.maxHeightReached
|
|
120
|
+
// )
|
|
121
|
+
// debugger
|
|
122
|
+
return deserialized;
|
|
248
123
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
return serialized;
|
|
124
|
+
createLayoutInWorker(args) {
|
|
125
|
+
const { regions } = args;
|
|
126
|
+
const session = this.getWorkerSession(args);
|
|
127
|
+
const subLayout = session.layout.getSublayout(regions[0].refName);
|
|
128
|
+
return subLayout;
|
|
129
|
+
}
|
|
130
|
+
serializeResultsInWorker(results, args) {
|
|
131
|
+
const serialized = super.serializeResultsInWorker(results, args);
|
|
132
|
+
const [region] = args.regions;
|
|
133
|
+
serialized.layout = results.layout.serializeRegion(this.getExpandedRegion(region, args));
|
|
134
|
+
if (serialized.layout.rectangles) {
|
|
135
|
+
serialized.features = serialized.features.filter(f => {
|
|
136
|
+
return Boolean(serialized.layout.rectangles[f.uniqueId]);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
serialized.maxHeightReached = serialized.layout.maxHeightReached;
|
|
140
|
+
return serialized;
|
|
267
141
|
}
|
|
268
142
|
/**
|
|
269
143
|
* gets layout and renders
|
|
270
144
|
*
|
|
271
145
|
* @param props - render args
|
|
272
146
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
switch (_context2.prev = _context2.next) {
|
|
282
|
-
case 0:
|
|
283
|
-
layout = props.layout || this.createLayoutInWorker(props);
|
|
284
|
-
_context2.next = 3;
|
|
285
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(BoxRendererType.prototype), "render", this).call(this, _objectSpread(_objectSpread({}, props), {}, {
|
|
286
|
-
layout: layout
|
|
287
|
-
}));
|
|
288
|
-
|
|
289
|
-
case 3:
|
|
290
|
-
result = _context2.sent;
|
|
291
|
-
return _context2.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
292
|
-
layout: layout
|
|
293
|
-
}));
|
|
294
|
-
|
|
295
|
-
case 5:
|
|
296
|
-
case "end":
|
|
297
|
-
return _context2.stop();
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}, _callee2, this);
|
|
301
|
-
}));
|
|
302
|
-
|
|
303
|
-
function render(_x3) {
|
|
304
|
-
return _render.apply(this, arguments);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return render;
|
|
308
|
-
}()
|
|
309
|
-
}]);
|
|
310
|
-
return BoxRendererType;
|
|
311
|
-
}(_FeatureRendererType2.default);
|
|
312
|
-
|
|
313
|
-
exports.default = BoxRendererType;
|
|
147
|
+
async render(props) {
|
|
148
|
+
const layout = props.layout ||
|
|
149
|
+
this.createLayoutInWorker(props);
|
|
150
|
+
const result = await super.render({ ...props, layout });
|
|
151
|
+
return { ...result, layout };
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.default = BoxRendererType;
|
|
@@ -1,39 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _FeatureRendererType = _interopRequireDefault(require("./FeatureRendererType"));
|
|
21
|
-
|
|
22
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
|
-
|
|
24
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
|
-
|
|
26
|
-
var CircularChordRendererType = /*#__PURE__*/function (_FeatureRenderer) {
|
|
27
|
-
(0, _inherits2.default)(CircularChordRendererType, _FeatureRenderer);
|
|
28
|
-
|
|
29
|
-
var _super = _createSuper(CircularChordRendererType);
|
|
30
|
-
|
|
31
|
-
function CircularChordRendererType() {
|
|
32
|
-
(0, _classCallCheck2.default)(this, CircularChordRendererType);
|
|
33
|
-
return _super.apply(this, arguments);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return (0, _createClass2.default)(CircularChordRendererType);
|
|
37
|
-
}(_FeatureRendererType.default);
|
|
38
|
-
|
|
39
|
-
exports.default = CircularChordRendererType;
|
|
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 FeatureRendererType_1 = __importDefault(require("./FeatureRendererType"));
|
|
7
|
+
class CircularChordRendererType extends FeatureRendererType_1.default {
|
|
8
|
+
}
|
|
9
|
+
exports.default = CircularChordRendererType;
|