@jbrowse/plugin-linear-genome-view 1.6.9 → 1.7.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/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +13 -13
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +232 -0
- package/dist/BaseLinearDisplay/components/Block.d.ts +15 -15
- package/dist/BaseLinearDisplay/components/Block.js +86 -0
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +12 -12
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +110 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -4
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +192 -0
- package/dist/BaseLinearDisplay/index.d.ts +5 -5
- package/dist/BaseLinearDisplay/index.js +41 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +227 -230
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +763 -0
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +24 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -96
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +328 -0
- package/dist/LinearBareDisplay/configSchema.d.ts +2 -2
- package/dist/LinearBareDisplay/configSchema.js +19 -0
- package/dist/LinearBareDisplay/index.d.ts +2 -2
- package/dist/LinearBareDisplay/index.js +21 -0
- package/dist/LinearBareDisplay/index.test.js +33 -0
- package/dist/LinearBareDisplay/model.d.ts +192 -192
- package/dist/LinearBareDisplay/model.js +44 -0
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -10
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +94 -0
- package/dist/LinearBasicDisplay/configSchema.d.ts +2 -2
- package/dist/LinearBasicDisplay/configSchema.js +25 -0
- package/dist/LinearBasicDisplay/index.d.ts +2 -2
- package/dist/LinearBasicDisplay/index.js +23 -0
- package/dist/LinearBasicDisplay/model.d.ts +213 -213
- package/dist/LinearBasicDisplay/model.js +162 -0
- package/dist/LinearGenomeView/components/CenterLine.d.ts +14 -14
- package/dist/LinearGenomeView/components/CenterLine.js +80 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -6
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +137 -0
- package/dist/LinearGenomeView/components/Header.d.ts +7 -7
- package/dist/LinearGenomeView/components/Header.js +144 -0
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +5 -5
- package/dist/LinearGenomeView/components/HelpDialog.js +48 -0
- package/dist/LinearGenomeView/components/ImportForm.d.ts +7 -7
- package/dist/LinearGenomeView/components/ImportForm.js +330 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +7 -7
- package/dist/LinearGenomeView/components/LinearGenomeView.js +129 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.test.js +234 -0
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -4
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +349 -0
- package/dist/LinearGenomeView/components/MiniControls.d.ts +6 -6
- package/dist/LinearGenomeView/components/MiniControls.js +83 -0
- package/dist/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -22
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +310 -0
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +132 -124
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +403 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +21 -21
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +331 -0
- package/dist/LinearGenomeView/components/RubberBand.d.ts +9 -20
- package/dist/LinearGenomeView/components/RubberBand.js +309 -0
- package/dist/LinearGenomeView/components/Ruler.d.ts +27 -27
- package/dist/LinearGenomeView/components/Ruler.js +101 -0
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +401 -401
- package/dist/LinearGenomeView/components/ScaleBar.js +184 -0
- package/dist/LinearGenomeView/components/ScaleBar.test.js +180 -0
- package/dist/LinearGenomeView/components/SearchBox.d.ts +8 -8
- package/dist/LinearGenomeView/components/SearchBox.js +201 -0
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +8 -8
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +159 -0
- package/dist/LinearGenomeView/components/SequenceDialog.d.ts +8 -8
- package/dist/LinearGenomeView/components/SequenceDialog.js +304 -0
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +9 -9
- package/dist/LinearGenomeView/components/TrackContainer.js +179 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +44 -44
- package/dist/LinearGenomeView/components/TrackLabel.js +165 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +10 -10
- package/dist/LinearGenomeView/components/TracksContainer.js +214 -0
- package/dist/LinearGenomeView/components/VerticalGuides.d.ts +9 -9
- package/dist/LinearGenomeView/components/VerticalGuides.js +116 -0
- package/dist/LinearGenomeView/components/ZoomControls.d.ts +7 -7
- package/dist/LinearGenomeView/components/ZoomControls.js +92 -0
- package/dist/LinearGenomeView/components/util.d.ts +2 -2
- package/dist/LinearGenomeView/components/util.js +16 -0
- package/dist/LinearGenomeView/index.d.ts +292 -292
- package/dist/LinearGenomeView/index.js +1418 -0
- package/dist/LinearGenomeView/index.test.js +1170 -0
- package/dist/LinearGenomeView/util.d.ts +14 -14
- package/dist/LinearGenomeView/util.js +93 -0
- package/dist/LinearGenomeView/util.test.js +78 -0
- package/dist/index.d.ts +565 -565
- package/dist/index.js +293 -6
- package/package.json +6 -9
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +2 -0
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +10 -8
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +1 -1
- package/src/LinearBasicDisplay/model.ts +17 -18
- package/src/LinearGenomeView/components/Header.tsx +1 -1
- package/src/LinearGenomeView/components/ImportForm.tsx +10 -4
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +1 -0
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +2 -2
- package/src/LinearGenomeView/components/RubberBand.tsx +14 -24
- package/src/LinearGenomeView/components/ScaleBar.test.tsx +1 -0
- package/src/LinearGenomeView/components/ScaleBar.tsx +3 -6
- package/src/LinearGenomeView/components/SequenceDialog.tsx +1 -1
- package/src/LinearGenomeView/components/TrackLabel.tsx +1 -1
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +0 -4
- package/src/LinearGenomeView/index.tsx +2 -3
- package/dist/LinearBareDisplay/index.test.d.ts +0 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.test.d.ts +0 -1
- package/dist/plugin-linear-genome-view.cjs.development.js +0 -8121
- package/dist/plugin-linear-genome-view.cjs.development.js.map +0 -1
- package/dist/plugin-linear-genome-view.cjs.production.min.js +0 -2
- package/dist/plugin-linear-genome-view.cjs.production.min.js.map +0 -1
- package/dist/plugin-linear-genome-view.esm.js +0 -8105
- package/dist/plugin-linear-genome-view.esm.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel';
|
|
3
|
-
declare const Tooltip: ({ model, clientMouseCoord, }: {
|
|
4
|
-
model: BaseLinearDisplayModel;
|
|
5
|
-
clientMouseCoord: Coord;
|
|
6
|
-
}) => JSX.Element | null;
|
|
7
|
-
declare type Coord = [number, number];
|
|
8
|
-
declare const BaseLinearDisplay: (props: {
|
|
9
|
-
model: BaseLinearDisplayModel;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
}) => JSX.Element;
|
|
12
|
-
export default BaseLinearDisplay;
|
|
13
|
-
export { Tooltip };
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel';
|
|
3
|
+
declare const Tooltip: ({ model, clientMouseCoord, }: {
|
|
4
|
+
model: BaseLinearDisplayModel;
|
|
5
|
+
clientMouseCoord: Coord;
|
|
6
|
+
}) => JSX.Element | null;
|
|
7
|
+
declare type Coord = [number, number];
|
|
8
|
+
declare const BaseLinearDisplay: (props: {
|
|
9
|
+
model: BaseLinearDisplayModel;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
export default BaseLinearDisplay;
|
|
13
|
+
export { Tooltip };
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = exports.Tooltip = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _mobxReact = require("mobx-react");
|
|
21
|
+
|
|
22
|
+
var _core = require("@material-ui/core");
|
|
23
|
+
|
|
24
|
+
var _configuration = require("@jbrowse/core/configuration");
|
|
25
|
+
|
|
26
|
+
var _ui = require("@jbrowse/core/ui");
|
|
27
|
+
|
|
28
|
+
var _reactPopper = require("react-popper");
|
|
29
|
+
|
|
30
|
+
var _LinearBlocks = _interopRequireDefault(require("./LinearBlocks"));
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
function round(value) {
|
|
41
|
+
return Math.round(value * 1e5) / 1e5;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var useStyles = (0, _core.makeStyles)(function (theme) {
|
|
45
|
+
return {
|
|
46
|
+
display: {
|
|
47
|
+
position: 'relative',
|
|
48
|
+
whiteSpace: 'nowrap',
|
|
49
|
+
textAlign: 'left',
|
|
50
|
+
width: '100%',
|
|
51
|
+
minHeight: '100%'
|
|
52
|
+
},
|
|
53
|
+
// these styles come from
|
|
54
|
+
// https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Tooltip/Tooltip.js
|
|
55
|
+
tooltip: {
|
|
56
|
+
pointerEvents: 'none',
|
|
57
|
+
backgroundColor: (0, _core.alpha)(theme.palette.grey[700], 0.9),
|
|
58
|
+
borderRadius: theme.shape.borderRadius,
|
|
59
|
+
color: theme.palette.common.white,
|
|
60
|
+
fontFamily: theme.typography.fontFamily,
|
|
61
|
+
padding: '4px 8px',
|
|
62
|
+
fontSize: theme.typography.pxToRem(12),
|
|
63
|
+
lineHeight: "".concat(round(14 / 10), "em"),
|
|
64
|
+
maxWidth: 300,
|
|
65
|
+
wordWrap: 'break-word'
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
var TooltipContents = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
71
|
+
var message = _ref.message;
|
|
72
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
73
|
+
ref: ref
|
|
74
|
+
}, message);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
var Tooltip = (0, _mobxReact.observer)(function (_ref2) {
|
|
78
|
+
var model = _ref2.model,
|
|
79
|
+
clientMouseCoord = _ref2.clientMouseCoord;
|
|
80
|
+
var classes = useStyles();
|
|
81
|
+
var featureUnderMouse = model.featureUnderMouse;
|
|
82
|
+
|
|
83
|
+
var _useState = (0, _react.useState)(0),
|
|
84
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
85
|
+
width = _useState2[0],
|
|
86
|
+
setWidth = _useState2[1];
|
|
87
|
+
|
|
88
|
+
var _useState3 = (0, _react.useState)(null),
|
|
89
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
90
|
+
popperElt = _useState4[0],
|
|
91
|
+
setPopperElt = _useState4[1]; // must be memoized a la https://github.com/popperjs/react-popper/issues/391
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
var virtElement = (0, _react.useMemo)(function () {
|
|
95
|
+
return {
|
|
96
|
+
getBoundingClientRect: function getBoundingClientRect() {
|
|
97
|
+
var x = clientMouseCoord[0] + width / 2 + 20;
|
|
98
|
+
var y = clientMouseCoord[1];
|
|
99
|
+
return {
|
|
100
|
+
top: y,
|
|
101
|
+
left: x,
|
|
102
|
+
bottom: y,
|
|
103
|
+
right: x,
|
|
104
|
+
width: 0,
|
|
105
|
+
height: 0,
|
|
106
|
+
x: x,
|
|
107
|
+
y: y,
|
|
108
|
+
toJSON: function toJSON() {}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}, [clientMouseCoord, width]);
|
|
113
|
+
|
|
114
|
+
var _usePopper = (0, _reactPopper.usePopper)(virtElement, popperElt),
|
|
115
|
+
styles = _usePopper.styles,
|
|
116
|
+
attributes = _usePopper.attributes;
|
|
117
|
+
|
|
118
|
+
var contents = featureUnderMouse ? (0, _configuration.getConf)(model, 'mouseover', {
|
|
119
|
+
feature: featureUnderMouse
|
|
120
|
+
}) : undefined;
|
|
121
|
+
return featureUnderMouse && contents ? /*#__PURE__*/_react["default"].createElement(_core.Portal, null, /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
122
|
+
ref: setPopperElt,
|
|
123
|
+
className: classes.tooltip // zIndex needed to go over widget drawer
|
|
124
|
+
,
|
|
125
|
+
style: _objectSpread(_objectSpread({}, styles.popper), {}, {
|
|
126
|
+
zIndex: 100000
|
|
127
|
+
})
|
|
128
|
+
}, attributes.popper), /*#__PURE__*/_react["default"].createElement(TooltipContents, {
|
|
129
|
+
ref: function ref(elt) {
|
|
130
|
+
return setWidth((elt === null || elt === void 0 ? void 0 : elt.getBoundingClientRect().width) || 0);
|
|
131
|
+
},
|
|
132
|
+
message: contents
|
|
133
|
+
}))) : null;
|
|
134
|
+
});
|
|
135
|
+
exports.Tooltip = Tooltip;
|
|
136
|
+
var BaseLinearDisplay = (0, _mobxReact.observer)(function (props) {
|
|
137
|
+
var classes = useStyles();
|
|
138
|
+
var theme = (0, _core.useTheme)();
|
|
139
|
+
var ref = (0, _react.useRef)(null);
|
|
140
|
+
|
|
141
|
+
var _useState5 = (0, _react.useState)(),
|
|
142
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
143
|
+
clientRect = _useState6[0],
|
|
144
|
+
setClientRect = _useState6[1];
|
|
145
|
+
|
|
146
|
+
var _useState7 = (0, _react.useState)([0, 0]),
|
|
147
|
+
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
148
|
+
offsetMouseCoord = _useState8[0],
|
|
149
|
+
setOffsetMouseCoord = _useState8[1];
|
|
150
|
+
|
|
151
|
+
var _useState9 = (0, _react.useState)([0, 0]),
|
|
152
|
+
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
153
|
+
clientMouseCoord = _useState10[0],
|
|
154
|
+
setClientMouseCoord = _useState10[1];
|
|
155
|
+
|
|
156
|
+
var _useState11 = (0, _react.useState)(),
|
|
157
|
+
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
158
|
+
contextCoord = _useState12[0],
|
|
159
|
+
setContextCoord = _useState12[1];
|
|
160
|
+
|
|
161
|
+
var model = props.model,
|
|
162
|
+
children = props.children;
|
|
163
|
+
var TooltipComponent = model.TooltipComponent,
|
|
164
|
+
DisplayMessageComponent = model.DisplayMessageComponent,
|
|
165
|
+
contextMenuItems = model.contextMenuItems,
|
|
166
|
+
height = model.height,
|
|
167
|
+
setContextMenuFeature = model.setContextMenuFeature;
|
|
168
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
|
+
ref: ref,
|
|
170
|
+
"data-testid": "display-".concat((0, _configuration.getConf)(model, 'displayId')),
|
|
171
|
+
className: classes.display,
|
|
172
|
+
onContextMenu: function onContextMenu(event) {
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
|
|
175
|
+
if (contextCoord) {
|
|
176
|
+
// There's already a context menu open, so close it
|
|
177
|
+
setContextCoord(undefined);
|
|
178
|
+
} else if (ref.current) {
|
|
179
|
+
setContextCoord([event.clientX, event.clientY]);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
onMouseMove: function onMouseMove(event) {
|
|
183
|
+
if (!ref.current) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
var rect = ref.current.getBoundingClientRect();
|
|
188
|
+
var left = rect.left,
|
|
189
|
+
top = rect.top;
|
|
190
|
+
setOffsetMouseCoord([event.clientX - left, event.clientY - top]);
|
|
191
|
+
setClientMouseCoord([event.clientX, event.clientY]);
|
|
192
|
+
setClientRect(rect);
|
|
193
|
+
}
|
|
194
|
+
}, DisplayMessageComponent ? /*#__PURE__*/_react["default"].createElement(DisplayMessageComponent, {
|
|
195
|
+
model: model
|
|
196
|
+
}) : /*#__PURE__*/_react["default"].createElement(_LinearBlocks["default"], props), children, /*#__PURE__*/_react["default"].createElement(TooltipComponent, {
|
|
197
|
+
model: model,
|
|
198
|
+
height: height,
|
|
199
|
+
offsetMouseCoord: offsetMouseCoord,
|
|
200
|
+
clientMouseCoord: clientMouseCoord,
|
|
201
|
+
clientRect: clientRect,
|
|
202
|
+
mouseCoord: offsetMouseCoord
|
|
203
|
+
}), /*#__PURE__*/_react["default"].createElement(_ui.Menu, {
|
|
204
|
+
open: Boolean(contextCoord) && Boolean(contextMenuItems().length),
|
|
205
|
+
onMenuItemClick: function onMenuItemClick(_, callback) {
|
|
206
|
+
callback();
|
|
207
|
+
setContextCoord(undefined);
|
|
208
|
+
},
|
|
209
|
+
onClose: function onClose() {
|
|
210
|
+
setContextCoord(undefined);
|
|
211
|
+
setContextMenuFeature(undefined);
|
|
212
|
+
},
|
|
213
|
+
TransitionProps: {
|
|
214
|
+
onExit: function onExit() {
|
|
215
|
+
setContextCoord(undefined);
|
|
216
|
+
setContextMenuFeature(undefined);
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
anchorReference: "anchorPosition",
|
|
220
|
+
anchorPosition: contextCoord ? {
|
|
221
|
+
top: contextCoord[1],
|
|
222
|
+
left: contextCoord[0]
|
|
223
|
+
} : undefined,
|
|
224
|
+
style: {
|
|
225
|
+
zIndex: theme.zIndex.tooltip
|
|
226
|
+
},
|
|
227
|
+
menuItems: contextMenuItems(),
|
|
228
|
+
"data-testid": "base_linear_display_context_menu"
|
|
229
|
+
}));
|
|
230
|
+
});
|
|
231
|
+
var _default = BaseLinearDisplay;
|
|
232
|
+
exports["default"] = _default;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BaseBlock } from '@jbrowse/core/util/blockTypes';
|
|
3
|
-
declare const ContentBlock: ({ block, children }: {
|
|
4
|
-
block: BaseBlock;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
-
declare function ElidedBlock({ width }: {
|
|
8
|
-
width: number;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
declare function InterRegionPaddingBlock({ boundary, width, style, }: {
|
|
11
|
-
boundary: boolean;
|
|
12
|
-
width: number;
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
}): JSX.Element;
|
|
15
|
-
export { ContentBlock, ElidedBlock, InterRegionPaddingBlock };
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseBlock } from '@jbrowse/core/util/blockTypes';
|
|
3
|
+
declare const ContentBlock: ({ block, children }: {
|
|
4
|
+
block: BaseBlock;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
declare function ElidedBlock({ width }: {
|
|
8
|
+
width: number;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
declare function InterRegionPaddingBlock({ boundary, width, style, }: {
|
|
11
|
+
boundary: boolean;
|
|
12
|
+
width: number;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
export { ContentBlock, ElidedBlock, InterRegionPaddingBlock };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ContentBlock = void 0;
|
|
9
|
+
exports.ElidedBlock = ElidedBlock;
|
|
10
|
+
exports.InterRegionPaddingBlock = InterRegionPaddingBlock;
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("@material-ui/core/styles");
|
|
17
|
+
|
|
18
|
+
var _mobxReact = require("mobx-react");
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
25
|
+
return {
|
|
26
|
+
contentBlock: {
|
|
27
|
+
position: 'relative',
|
|
28
|
+
minHeight: '100%',
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
whiteSpace: 'nowrap',
|
|
31
|
+
overflow: 'hidden'
|
|
32
|
+
},
|
|
33
|
+
elidedBlock: {
|
|
34
|
+
minHeight: '100%',
|
|
35
|
+
boxSizing: 'border-box',
|
|
36
|
+
backgroundColor: '#999',
|
|
37
|
+
backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)'
|
|
38
|
+
},
|
|
39
|
+
interRegionPaddingBlock: {
|
|
40
|
+
minHeight: '100%',
|
|
41
|
+
backgroundColor: theme.palette.text.primary
|
|
42
|
+
},
|
|
43
|
+
boundaryPaddingBlock: {
|
|
44
|
+
minHeight: '100%',
|
|
45
|
+
backgroundColor: theme.palette.action.disabledBackground
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
var ContentBlock = (0, _mobxReact.observer)(function (_ref) {
|
|
50
|
+
var block = _ref.block,
|
|
51
|
+
children = _ref.children;
|
|
52
|
+
var classes = useStyles();
|
|
53
|
+
var widthPx = block.widthPx;
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
55
|
+
style: {
|
|
56
|
+
width: widthPx
|
|
57
|
+
},
|
|
58
|
+
className: classes.contentBlock
|
|
59
|
+
}, children);
|
|
60
|
+
});
|
|
61
|
+
exports.ContentBlock = ContentBlock;
|
|
62
|
+
|
|
63
|
+
function ElidedBlock(_ref2) {
|
|
64
|
+
var width = _ref2.width;
|
|
65
|
+
var classes = useStyles();
|
|
66
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
67
|
+
className: classes.elidedBlock,
|
|
68
|
+
style: {
|
|
69
|
+
width: width
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function InterRegionPaddingBlock(_ref3) {
|
|
75
|
+
var boundary = _ref3.boundary,
|
|
76
|
+
width = _ref3.width,
|
|
77
|
+
_ref3$style = _ref3.style,
|
|
78
|
+
style = _ref3$style === void 0 ? {} : _ref3$style;
|
|
79
|
+
var classes = useStyles();
|
|
80
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
81
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
82
|
+
width: width
|
|
83
|
+
}),
|
|
84
|
+
className: boundary ? classes.boundaryPaddingBlock : classes.interRegionPaddingBlock
|
|
85
|
+
});
|
|
86
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel';
|
|
3
|
-
declare const useStyles: (props?: any) =>
|
|
4
|
-
declare const RenderedBlocks: ({ model }: {
|
|
5
|
-
model: BaseLinearDisplayModel;
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
-
declare function LinearBlocks({ model }: {
|
|
8
|
-
model: BaseLinearDisplayModel;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
export { RenderedBlocks, useStyles };
|
|
11
|
-
declare const _default: typeof LinearBlocks;
|
|
12
|
-
export default _default;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel';
|
|
3
|
+
declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"linearBlocks" | "heightOverflowed">;
|
|
4
|
+
declare const RenderedBlocks: ({ model }: {
|
|
5
|
+
model: BaseLinearDisplayModel;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
declare function LinearBlocks({ model }: {
|
|
8
|
+
model: BaseLinearDisplayModel;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
export { RenderedBlocks, useStyles };
|
|
11
|
+
declare const _default: typeof LinearBlocks;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useStyles = exports["default"] = exports.RenderedBlocks = void 0;
|
|
9
|
+
|
|
10
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styles = require("@material-ui/core/styles");
|
|
15
|
+
|
|
16
|
+
var _util = require("@jbrowse/core/util");
|
|
17
|
+
|
|
18
|
+
var _mobxReact = require("mobx-react");
|
|
19
|
+
|
|
20
|
+
var _blockTypes = require("@jbrowse/core/util/blockTypes");
|
|
21
|
+
|
|
22
|
+
var _Block = require("./Block");
|
|
23
|
+
|
|
24
|
+
var useStyles = (0, _styles.makeStyles)({
|
|
25
|
+
linearBlocks: {
|
|
26
|
+
whiteSpace: 'nowrap',
|
|
27
|
+
textAlign: 'left',
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
minHeight: '100%',
|
|
30
|
+
display: 'flex'
|
|
31
|
+
},
|
|
32
|
+
heightOverflowed: {
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
color: 'rgb(77,77,77)',
|
|
35
|
+
borderBottom: '2px solid rgb(77,77,77)',
|
|
36
|
+
textShadow: 'white 0px 0px 1px',
|
|
37
|
+
whiteSpace: 'nowrap',
|
|
38
|
+
width: '100%',
|
|
39
|
+
fontWeight: 'bold',
|
|
40
|
+
textAlign: 'center',
|
|
41
|
+
zIndex: 2000,
|
|
42
|
+
boxSizing: 'border-box'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
exports.useStyles = useStyles;
|
|
46
|
+
var RenderedBlocks = (0, _mobxReact.observer)(function (_ref) {
|
|
47
|
+
var model = _ref.model;
|
|
48
|
+
var classes = useStyles();
|
|
49
|
+
var blockDefinitions = model.blockDefinitions,
|
|
50
|
+
blockState = model.blockState;
|
|
51
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, blockDefinitions.map(function (block) {
|
|
52
|
+
if (block instanceof _blockTypes.ContentBlock) {
|
|
53
|
+
var state = blockState.get(block.key);
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement(_Block.ContentBlock, {
|
|
55
|
+
block: block,
|
|
56
|
+
key: "".concat(model.id, "-").concat(block.key)
|
|
57
|
+
}, state && state.ReactComponent ? /*#__PURE__*/_react["default"].createElement(state.ReactComponent, {
|
|
58
|
+
model: state
|
|
59
|
+
}) : null, state && state.maxHeightReached ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
|
+
className: classes.heightOverflowed,
|
|
61
|
+
style: {
|
|
62
|
+
top: state.layout.getTotalHeight() - 16,
|
|
63
|
+
pointerEvents: 'none',
|
|
64
|
+
height: 16
|
|
65
|
+
}
|
|
66
|
+
}, "Max height reached") : null);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (block instanceof _blockTypes.ElidedBlock) {
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement(_Block.ElidedBlock, {
|
|
71
|
+
key: "".concat(model.id, "-").concat(block.key),
|
|
72
|
+
width: block.widthPx
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (block instanceof _blockTypes.InterRegionPaddingBlock) {
|
|
77
|
+
return /*#__PURE__*/_react["default"].createElement(_Block.InterRegionPaddingBlock, {
|
|
78
|
+
key: block.key,
|
|
79
|
+
width: block.widthPx,
|
|
80
|
+
style: {
|
|
81
|
+
background: 'none'
|
|
82
|
+
},
|
|
83
|
+
boundary: block.variant === 'boundary'
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
throw new Error("invalid block type ".concat((0, _typeof2["default"])(block)));
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
90
|
+
exports.RenderedBlocks = RenderedBlocks;
|
|
91
|
+
|
|
92
|
+
function LinearBlocks(_ref2) {
|
|
93
|
+
var model = _ref2.model;
|
|
94
|
+
var classes = useStyles();
|
|
95
|
+
var blockDefinitions = model.blockDefinitions;
|
|
96
|
+
var viewModel = (0, _util.getContainingView)(model);
|
|
97
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
98
|
+
"data-testid": "Blockset",
|
|
99
|
+
className: classes.linearBlocks,
|
|
100
|
+
style: {
|
|
101
|
+
left: blockDefinitions.offsetPx - viewModel.offsetPx
|
|
102
|
+
}
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement(RenderedBlocks, {
|
|
104
|
+
model: model
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var _default = (0, _mobxReact.observer)(LinearBlocks);
|
|
109
|
+
|
|
110
|
+
exports["default"] = _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ServerSideRenderedBlockContent: ({ model, }: {
|
|
2
|
-
model: any;
|
|
3
|
-
}) => any;
|
|
4
|
-
export default ServerSideRenderedBlockContent;
|
|
1
|
+
declare const ServerSideRenderedBlockContent: ({ model, }: {
|
|
2
|
+
model: any;
|
|
3
|
+
}) => any;
|
|
4
|
+
export default ServerSideRenderedBlockContent;
|