@jbrowse/plugin-linear-genome-view 1.6.6 → 1.6.9
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/LinearBareDisplay/model.d.ts +7 -7
- package/dist/LinearBasicDisplay/model.d.ts +7 -7
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +6 -6
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +1 -2
- package/dist/index.d.ts +21 -21
- package/dist/plugin-linear-genome-view.cjs.development.js +64 -39
- package/dist/plugin-linear-genome-view.cjs.development.js.map +1 -1
- package/dist/plugin-linear-genome-view.cjs.production.min.js +1 -1
- package/dist/plugin-linear-genome-view.cjs.production.min.js.map +1 -1
- package/dist/plugin-linear-genome-view.esm.js +64 -39
- package/dist/plugin-linear-genome-view.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +9 -12
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +21 -12
- package/src/LinearGenomeView/components/TrackContainer.tsx +46 -27
- package/src/LinearGenomeView/components/TracksContainer.tsx +0 -1
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +222 -248
|
@@ -14,8 +14,8 @@ import { isFeature } from '@jbrowse/core/util/simpleFeature';
|
|
|
14
14
|
import { getParentRenderProps, getTrackAssemblyNames, getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
15
15
|
import { getParent, types, cast, isAlive, addDisposer, getEnv, resolveIdentifier, getRoot, getSnapshot } from 'mobx-state-tree';
|
|
16
16
|
import MenuOpenIcon from '@material-ui/icons/MenuOpen';
|
|
17
|
-
import { Menu, ResizeHandle, ReturnToImportFormDialog } from '@jbrowse/core/ui';
|
|
18
17
|
import { observer, PropTypes } from 'mobx-react';
|
|
18
|
+
import { Menu, ResizeHandle, ReturnToImportFormDialog } from '@jbrowse/core/ui';
|
|
19
19
|
import { usePopper } from 'react-popper';
|
|
20
20
|
import { makeStyles } from '@material-ui/core/styles';
|
|
21
21
|
import { ContentBlock as ContentBlock$1, ElidedBlock as ElidedBlock$1, InterRegionPaddingBlock as InterRegionPaddingBlock$1 } from '@jbrowse/core/util/blockTypes';
|
|
@@ -50,13 +50,13 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
|
|
50
50
|
import IconButton$1 from '@material-ui/core/IconButton';
|
|
51
51
|
import Slider from '@material-ui/core/Slider';
|
|
52
52
|
import ZoomOut from '@material-ui/icons/ZoomOut';
|
|
53
|
+
import Paper$1 from '@material-ui/core/Paper';
|
|
53
54
|
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
54
55
|
import DragIcon from '@material-ui/icons/DragIndicator';
|
|
55
56
|
import normalizeWheel from 'normalize-wheel';
|
|
56
57
|
import { alpha as alpha$1 } from '@material-ui/core/styles/colorManipulator';
|
|
57
58
|
import Popover$1 from '@material-ui/core/Popover';
|
|
58
59
|
import Tooltip$2 from '@material-ui/core/Tooltip';
|
|
59
|
-
import Paper$1 from '@material-ui/core/Paper';
|
|
60
60
|
import ErrorMessage from '@jbrowse/core/ui/ErrorMessage';
|
|
61
61
|
import AssemblySelector from '@jbrowse/core/ui/AssemblySelector';
|
|
62
62
|
import ArrowDown from '@material-ui/icons/KeyboardArrowDown';
|
|
@@ -1459,14 +1459,17 @@ var BaseLinearDisplay = /*#__PURE__*/observer(function (props) {
|
|
|
1459
1459
|
}
|
|
1460
1460
|
},
|
|
1461
1461
|
onMouseMove: function onMouseMove(event) {
|
|
1462
|
-
if (ref.current) {
|
|
1463
|
-
|
|
1464
|
-
setOffsetMouseCoord([event.clientX - rect.left, event.clientY - rect.top]);
|
|
1465
|
-
setClientMouseCoord([event.clientX, event.clientY]);
|
|
1466
|
-
setClientRect(rect);
|
|
1462
|
+
if (!ref.current) {
|
|
1463
|
+
return;
|
|
1467
1464
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1465
|
+
|
|
1466
|
+
var rect = ref.current.getBoundingClientRect();
|
|
1467
|
+
var left = rect.left,
|
|
1468
|
+
top = rect.top;
|
|
1469
|
+
setOffsetMouseCoord([event.clientX - left, event.clientY - top]);
|
|
1470
|
+
setClientMouseCoord([event.clientX, event.clientY]);
|
|
1471
|
+
setClientRect(rect);
|
|
1472
|
+
}
|
|
1470
1473
|
}, DisplayMessageComponent ? /*#__PURE__*/React.createElement(DisplayMessageComponent, {
|
|
1471
1474
|
model: model
|
|
1472
1475
|
}) : /*#__PURE__*/React.createElement(LinearBlocks$1, Object.assign({}, props)), children, /*#__PURE__*/React.createElement(TooltipComponent, {
|
|
@@ -4660,11 +4663,15 @@ var TrackLabel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
4660
4663
|
});
|
|
4661
4664
|
var TrackLabel$1 = /*#__PURE__*/observer(TrackLabel);
|
|
4662
4665
|
|
|
4663
|
-
var useStyles$c = /*#__PURE__*/makeStyles
|
|
4666
|
+
var useStyles$c = /*#__PURE__*/makeStyles(function (theme) {
|
|
4664
4667
|
return {
|
|
4665
|
-
root: {
|
|
4668
|
+
root: {
|
|
4669
|
+
marginTop: 2
|
|
4670
|
+
},
|
|
4666
4671
|
resizeHandle: {
|
|
4667
4672
|
height: RESIZE_HANDLE_HEIGHT,
|
|
4673
|
+
boxSizing: 'border-box',
|
|
4674
|
+
position: 'relative',
|
|
4668
4675
|
zIndex: 2
|
|
4669
4676
|
},
|
|
4670
4677
|
overlay: {
|
|
@@ -4677,8 +4684,16 @@ var useStyles$c = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
4677
4684
|
borderRadius: theme.shape.borderRadius
|
|
4678
4685
|
},
|
|
4679
4686
|
trackLabel: {
|
|
4680
|
-
zIndex: 3
|
|
4681
|
-
|
|
4687
|
+
zIndex: 3
|
|
4688
|
+
},
|
|
4689
|
+
// aligns with block bounderies. check for example the breakpoint split view
|
|
4690
|
+
// demo to see if features align if wanting to change things
|
|
4691
|
+
renderingComponentContainer: {
|
|
4692
|
+
position: 'absolute',
|
|
4693
|
+
// -1 offset because of the 1px border of the Paper
|
|
4694
|
+
left: -1,
|
|
4695
|
+
height: '100%',
|
|
4696
|
+
width: '100%'
|
|
4682
4697
|
},
|
|
4683
4698
|
trackLabelInline: {
|
|
4684
4699
|
position: 'relative',
|
|
@@ -4697,15 +4712,23 @@ var useStyles$c = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
4697
4712
|
}
|
|
4698
4713
|
};
|
|
4699
4714
|
});
|
|
4700
|
-
|
|
4701
|
-
function TrackContainer(_ref) {
|
|
4715
|
+
var TrackContainerLabel = /*#__PURE__*/observer(function (_ref) {
|
|
4702
4716
|
var model = _ref.model,
|
|
4703
|
-
|
|
4717
|
+
view = _ref.view;
|
|
4718
|
+
var classes = useStyles$c();
|
|
4719
|
+
var labelStyle = view.trackLabels === 'overlapping' ? classes.trackLabelOverlap : classes.trackLabelInline;
|
|
4720
|
+
return view.trackLabels !== 'hidden' ? /*#__PURE__*/React.createElement(TrackLabel$1, {
|
|
4721
|
+
track: model,
|
|
4722
|
+
className: clsx(classes.trackLabel, labelStyle)
|
|
4723
|
+
}) : null;
|
|
4724
|
+
});
|
|
4725
|
+
|
|
4726
|
+
function TrackContainer(_ref2) {
|
|
4727
|
+
var model = _ref2.model,
|
|
4728
|
+
track = _ref2.track;
|
|
4704
4729
|
var classes = useStyles$c();
|
|
4705
4730
|
var display = track.displays[0];
|
|
4706
|
-
var
|
|
4707
|
-
trackLabels = model.trackLabels,
|
|
4708
|
-
horizontalScroll = model.horizontalScroll,
|
|
4731
|
+
var horizontalScroll = model.horizontalScroll,
|
|
4709
4732
|
draggingTrackId = model.draggingTrackId,
|
|
4710
4733
|
moveTrack = model.moveTrack;
|
|
4711
4734
|
var height = display.height;
|
|
@@ -4731,10 +4754,13 @@ function TrackContainer(_ref) {
|
|
|
4731
4754
|
var RenderingComponent = display.RenderingComponent,
|
|
4732
4755
|
DisplayBlurb = display.DisplayBlurb;
|
|
4733
4756
|
var dimmed = draggingTrackId !== undefined && draggingTrackId !== display.id;
|
|
4734
|
-
return /*#__PURE__*/React.createElement(
|
|
4735
|
-
className: classes.root
|
|
4736
|
-
|
|
4737
|
-
|
|
4757
|
+
return /*#__PURE__*/React.createElement(Paper$1, {
|
|
4758
|
+
className: classes.root,
|
|
4759
|
+
variant: "outlined"
|
|
4760
|
+
}, /*#__PURE__*/React.createElement(TrackContainerLabel, {
|
|
4761
|
+
model: track,
|
|
4762
|
+
view: model
|
|
4763
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
4738
4764
|
className: classes.trackRenderingContainer,
|
|
4739
4765
|
style: {
|
|
4740
4766
|
height: height
|
|
@@ -4744,19 +4770,16 @@ function TrackContainer(_ref) {
|
|
|
4744
4770
|
display.setScrollTop(target.scrollTop);
|
|
4745
4771
|
},
|
|
4746
4772
|
onDragEnter: debouncedOnDragEnter,
|
|
4747
|
-
"data-testid": "trackRenderingContainer-".concat(id, "-").concat(trackId),
|
|
4773
|
+
"data-testid": "trackRenderingContainer-".concat(model.id, "-").concat(trackId),
|
|
4748
4774
|
role: "presentation"
|
|
4749
|
-
},
|
|
4750
|
-
track: track,
|
|
4751
|
-
className: clsx(classes.trackLabel, trackLabels === 'overlapping' ? classes.trackLabelOverlap : classes.trackLabelInline)
|
|
4752
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
4775
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4753
4776
|
ref: ref,
|
|
4777
|
+
className: classes.renderingComponentContainer,
|
|
4754
4778
|
style: {
|
|
4755
4779
|
transform: "scaleX(".concat(model.scaleFactor, ")")
|
|
4756
4780
|
}
|
|
4757
4781
|
}, /*#__PURE__*/React.createElement(RenderingComponent, {
|
|
4758
4782
|
model: display,
|
|
4759
|
-
blockState: {},
|
|
4760
4783
|
onHorizontalScroll: horizontalScroll
|
|
4761
4784
|
})), DisplayBlurb ? /*#__PURE__*/React.createElement("div", {
|
|
4762
4785
|
style: {
|
|
@@ -5535,8 +5558,6 @@ function TracksContainer(_ref) {
|
|
|
5535
5558
|
boxSizing: 'border-box'
|
|
5536
5559
|
}
|
|
5537
5560
|
})
|
|
5538
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
5539
|
-
className: classes.spacer
|
|
5540
5561
|
}), children);
|
|
5541
5562
|
}
|
|
5542
5563
|
|
|
@@ -8046,26 +8067,30 @@ function SetMaxHeightDlg$1(props) {
|
|
|
8046
8067
|
"aria-label": "close",
|
|
8047
8068
|
className: classes.closeButton,
|
|
8048
8069
|
onClick: handleClose
|
|
8049
|
-
}, /*#__PURE__*/React.createElement(CloseIcon, null))), /*#__PURE__*/React.createElement(DialogContent,
|
|
8070
|
+
}, /*#__PURE__*/React.createElement(CloseIcon, null))), /*#__PURE__*/React.createElement(DialogContent, {
|
|
8050
8071
|
className: classes.root
|
|
8051
|
-
}, /*#__PURE__*/React.createElement(Typography$1, null, "Set max height for the track"), /*#__PURE__*/React.createElement(TextField, {
|
|
8072
|
+
}, /*#__PURE__*/React.createElement(Typography$1, null, "Set max height for the track. For example, you can increase this if the layout says \"Max height reached\""), /*#__PURE__*/React.createElement(TextField, {
|
|
8052
8073
|
value: max,
|
|
8053
8074
|
onChange: function onChange(event) {
|
|
8054
|
-
setMax(event.target.value);
|
|
8075
|
+
return setMax(event.target.value);
|
|
8055
8076
|
},
|
|
8056
8077
|
placeholder: "Enter max score"
|
|
8057
|
-
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
8078
|
+
}), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
8058
8079
|
variant: "contained",
|
|
8059
8080
|
color: "primary",
|
|
8060
8081
|
type: "submit",
|
|
8061
|
-
|
|
8062
|
-
marginLeft: 20
|
|
8063
|
-
},
|
|
8082
|
+
autoFocus: true,
|
|
8064
8083
|
onClick: function onClick() {
|
|
8065
8084
|
model.setMaxHeight(max !== '' && !Number.isNaN(+max) ? +max : undefined);
|
|
8066
8085
|
handleClose();
|
|
8067
8086
|
}
|
|
8068
|
-
}, "Submit")
|
|
8087
|
+
}, "Submit"), /*#__PURE__*/React.createElement(Button$1, {
|
|
8088
|
+
variant: "contained",
|
|
8089
|
+
color: "secondary",
|
|
8090
|
+
onClick: function onClick() {
|
|
8091
|
+
return handleClose();
|
|
8092
|
+
}
|
|
8093
|
+
}, "Cancel"))));
|
|
8069
8094
|
}
|
|
8070
8095
|
|
|
8071
8096
|
var SetMaxHeight = /*#__PURE__*/observer(SetMaxHeightDlg$1);
|