@jbrowse/plugin-linear-genome-view 2.6.3 → 2.7.0
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/LinearBlocks.d.ts +4 -14
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +4 -5
- package/dist/BaseLinearDisplay/components/Tooltip.js +1 -1
- package/dist/BaseLinearDisplay/models/util.d.ts +2 -6
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +4 -5
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +3 -3
- package/dist/LinearBasicDisplay/model.d.ts +3 -1
- package/dist/LinearGenomeView/components/CenterLine.d.ts +3 -4
- package/dist/LinearGenomeView/components/CenterLine.js +3 -3
- package/dist/LinearGenomeView/components/Cytobands.d.ts +6 -2
- package/dist/LinearGenomeView/components/Cytobands.js +37 -38
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +3 -4
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +3 -3
- package/dist/LinearGenomeView/components/Gridlines.d.ts +3 -4
- package/dist/LinearGenomeView/components/Gridlines.js +21 -18
- package/dist/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/dist/LinearGenomeView/components/ImportForm.js +2 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +19 -1
- package/dist/LinearGenomeView/components/MiniControls.js +13 -5
- package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +2 -2
- package/dist/LinearGenomeView/components/OverviewRubberband.js +2 -1
- package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
- package/dist/LinearGenomeView/components/OverviewScalebar.js +41 -13
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +2 -2
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +2 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +1 -3
- package/dist/LinearGenomeView/components/Rubberband.d.ts +4 -5
- package/dist/LinearGenomeView/components/Rubberband.js +3 -3
- package/dist/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/dist/LinearGenomeView/components/Scalebar.js +29 -24
- package/dist/LinearGenomeView/components/SearchBox.d.ts +4 -5
- package/dist/LinearGenomeView/components/SearchBox.js +3 -3
- package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -5
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js +20 -18
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +2 -2
- package/dist/LinearGenomeView/components/TrackContainer.js +2 -1
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +2 -2
- package/dist/LinearGenomeView/components/TrackLabel.js +3 -3
- package/dist/LinearGenomeView/components/TrackRenderingContainer.d.ts +2 -2
- package/dist/LinearGenomeView/components/TrackRenderingContainer.js +2 -1
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +2 -2
- package/dist/LinearGenomeView/components/TracksContainer.js +2 -1
- package/dist/LinearGenomeView/components/VerticalGuide.d.ts +3 -4
- package/dist/LinearGenomeView/components/VerticalGuide.js +3 -3
- package/dist/LinearGenomeView/components/ZoomControls.d.ts +3 -4
- package/dist/LinearGenomeView/components/ZoomControls.js +3 -3
- package/dist/LinearGenomeView/components/util.d.ts +1 -1
- package/dist/LinearGenomeView/model.d.ts +6 -6
- package/dist/LinearGenomeView/model.js +33 -0
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.js +2 -2
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +1 -4
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +2 -3
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js +1 -2
- package/dist/index.d.ts +37 -37
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +4 -14
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +4 -4
- package/esm/BaseLinearDisplay/components/Tooltip.js +1 -1
- package/esm/BaseLinearDisplay/models/util.d.ts +2 -6
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +4 -5
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +3 -3
- package/esm/LinearBasicDisplay/model.d.ts +3 -1
- package/esm/LinearGenomeView/components/CenterLine.d.ts +3 -4
- package/esm/LinearGenomeView/components/CenterLine.js +3 -3
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -2
- package/esm/LinearGenomeView/components/Cytobands.js +37 -38
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +3 -4
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +3 -3
- package/esm/LinearGenomeView/components/Gridlines.d.ts +3 -4
- package/esm/LinearGenomeView/components/Gridlines.js +21 -18
- package/esm/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/esm/LinearGenomeView/components/ImportForm.js +2 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +20 -2
- package/esm/LinearGenomeView/components/MiniControls.js +13 -5
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +2 -2
- package/esm/LinearGenomeView/components/OverviewRubberband.js +2 -1
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +18 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +2 -2
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +2 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +1 -3
- package/esm/LinearGenomeView/components/Rubberband.d.ts +4 -5
- package/esm/LinearGenomeView/components/Rubberband.js +3 -3
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/Scalebar.js +29 -24
- package/esm/LinearGenomeView/components/SearchBox.d.ts +4 -5
- package/esm/LinearGenomeView/components/SearchBox.js +3 -3
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -5
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +21 -19
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +2 -2
- package/esm/LinearGenomeView/components/TrackContainer.js +2 -1
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -2
- package/esm/LinearGenomeView/components/TrackLabel.js +3 -3
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +2 -2
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +2 -1
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +2 -2
- package/esm/LinearGenomeView/components/TracksContainer.js +2 -1
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +3 -4
- package/esm/LinearGenomeView/components/VerticalGuide.js +3 -3
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +3 -4
- package/esm/LinearGenomeView/components/ZoomControls.js +3 -3
- package/esm/LinearGenomeView/components/util.d.ts +1 -1
- package/esm/LinearGenomeView/model.d.ts +6 -6
- package/esm/LinearGenomeView/model.js +33 -0
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +2 -5
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +3 -4
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +2 -3
- package/esm/index.d.ts +37 -37
- package/package.json +4 -5
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
3
3
|
import { TextFieldProps as TFP } from '@mui/material';
|
|
4
4
|
import { LinearGenomeViewModel } from '../../model';
|
|
5
|
-
declare const
|
|
5
|
+
declare const RefNameAutocomplete: ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, showHelp, minWidth, maxWidth, TextFieldProps, }: {
|
|
6
6
|
model: LinearGenomeViewModel;
|
|
7
7
|
onSelect?: ((region: BaseResult) => void) | undefined;
|
|
8
8
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -15,4 +15,4 @@ declare const _default: ({ model, onSelect, assemblyName, style, fetchResults, o
|
|
|
15
15
|
showHelp?: boolean | undefined;
|
|
16
16
|
TextFieldProps?: TFP | undefined;
|
|
17
17
|
}) => React.JSX.Element;
|
|
18
|
-
export default
|
|
18
|
+
export default RefNameAutocomplete;
|
|
@@ -33,7 +33,7 @@ const BaseResults_1 = __importStar(require("@jbrowse/core/TextSearch/BaseResults
|
|
|
33
33
|
const material_1 = require("@mui/material");
|
|
34
34
|
const util_2 = require("./util");
|
|
35
35
|
const AutocompleteTextField_1 = __importDefault(require("./AutocompleteTextField"));
|
|
36
|
-
|
|
36
|
+
const RefNameAutocomplete = (0, mobx_react_1.observer)(function ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, showHelp = true, minWidth = 200, maxWidth = 550, TextFieldProps = {}, }) {
|
|
37
37
|
var _a;
|
|
38
38
|
const session = (0, util_1.getSession)(model);
|
|
39
39
|
const { assemblyManager } = session;
|
|
@@ -108,3 +108,4 @@ exports.default = (0, mobx_react_1.observer)(function RefNameAutocomplete({ mode
|
|
|
108
108
|
}))) || []
|
|
109
109
|
: searchOptions, getOptionDisabled: option => option.group === 'limitOption', filterOptions: (opts, { inputValue }) => (0, util_2.getFiltered)(opts, inputValue), renderInput: params => (react_1.default.createElement(AutocompleteTextField_1.default, { showHelp: showHelp, params: params, inputBoxVal: inputBoxVal, TextFieldProps: TextFieldProps, setCurrentSearch: setCurrentSearch, setInputValue: setInputValue })), getOptionLabel: opt => typeof opt === 'string' ? opt : opt.result.getDisplayString() })));
|
|
110
110
|
});
|
|
111
|
+
exports.default = RefNameAutocomplete;
|
|
@@ -4,9 +4,7 @@ export interface Option {
|
|
|
4
4
|
result: BaseResult;
|
|
5
5
|
}
|
|
6
6
|
export declare function getFiltered(opts: Option[], inputValue: string): Option[];
|
|
7
|
-
export declare function aggregateResults(results: BaseResult[]):
|
|
8
|
-
[key: string]: BaseResult[];
|
|
9
|
-
};
|
|
7
|
+
export declare function aggregateResults(results: BaseResult[]): Record<string, BaseResult[]>;
|
|
10
8
|
export declare function getDeduplicatedResult(results: BaseResult[]): {
|
|
11
9
|
result: BaseResult;
|
|
12
10
|
}[];
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare
|
|
4
|
+
declare const Rubberband: ({ model, ControlComponent, }: {
|
|
5
5
|
model: LGV;
|
|
6
|
-
ControlComponent?: React.ReactElement;
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
6
|
+
ControlComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default Rubberband;
|
|
@@ -41,7 +41,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
41
41
|
minHeight: 8,
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
|
-
|
|
44
|
+
const Rubberband = (0, mobx_react_1.observer)(function ({ model, ControlComponent = react_1.default.createElement("div", null), }) {
|
|
45
45
|
const ref = (0, react_1.useRef)(null);
|
|
46
46
|
const { classes } = useStyles();
|
|
47
47
|
const { guideX, rubberbandOn, leftBpOffset, rightBpOffset, numOfBpSelected, width, left, anchorPosition, handleMenuItemClick, open, handleClose, mouseMove, mouseDown, mouseOut, } = (0, hooks_1.useRangeSelect)(ref, model);
|
|
@@ -52,5 +52,5 @@ function Rubberband({ model, ControlComponent = react_1.default.createElement("d
|
|
|
52
52
|
top: anchorPosition.clientY,
|
|
53
53
|
}, onMenuItemClick: handleMenuItemClick, open: open, onClose: handleClose, menuItems: model.rubberBandMenuItems() })) : null,
|
|
54
54
|
react_1.default.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, ref: ref, onMouseDown: mouseDown, onMouseMove: mouseMove, onMouseOut: mouseOut }, ControlComponent)));
|
|
55
|
-
}
|
|
56
|
-
exports.default =
|
|
55
|
+
});
|
|
56
|
+
exports.default = Rubberband;
|
|
@@ -6,5 +6,5 @@ interface ScalebarProps {
|
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const Scalebar: React.ForwardRefExoticComponent<ScalebarProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export default Scalebar;
|
|
@@ -26,7 +26,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
26
26
|
pointerEvents: 'none',
|
|
27
27
|
},
|
|
28
28
|
majorTickLabel: {
|
|
29
|
-
fontSize:
|
|
29
|
+
fontSize: 11,
|
|
30
30
|
zIndex: 1,
|
|
31
31
|
background: theme.palette.background.paper,
|
|
32
32
|
lineHeight: 'normal',
|
|
@@ -40,10 +40,10 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
40
40
|
pointerEvents: 'none',
|
|
41
41
|
},
|
|
42
42
|
refLabel: {
|
|
43
|
-
fontSize:
|
|
43
|
+
fontSize: 11,
|
|
44
44
|
position: 'absolute',
|
|
45
|
-
left:
|
|
46
|
-
top:
|
|
45
|
+
left: 2,
|
|
46
|
+
top: -1,
|
|
47
47
|
fontWeight: 'bold',
|
|
48
48
|
lineHeight: 'normal',
|
|
49
49
|
zIndex: 1,
|
|
@@ -70,32 +70,37 @@ const RenderedRefNameLabels = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
70
70
|
}, className: classes.refLabel, "data-testid": `refLabel-${block.refName}` }, block.refName)) : null;
|
|
71
71
|
})));
|
|
72
72
|
});
|
|
73
|
-
const
|
|
73
|
+
const RenderedBlockTicks = function ({ block, bpPerPx, }) {
|
|
74
74
|
const { classes } = useStyles();
|
|
75
|
-
const {
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const { reversed, start, end } = block;
|
|
76
|
+
const ticks = (0, util_1.makeTicks)(start, end, bpPerPx, true, false);
|
|
77
|
+
return (react_1.default.createElement(Block_1.ContentBlock, { block: block }, ticks.map(({ type, base }) => {
|
|
78
|
+
if (type === 'major') {
|
|
79
|
+
const x = (reversed ? end - base : base - start) / bpPerPx;
|
|
80
|
+
const baseNumber = base + 1;
|
|
81
|
+
return (react_1.default.createElement("div", { key: base, className: classes.tick, style: { left: x } }, baseNumber ? (react_1.default.createElement(material_1.Typography, { className: classes.majorTickLabel }, (0, util_2.getTickDisplayStr)(baseNumber, bpPerPx))) : null));
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
})));
|
|
85
|
+
};
|
|
86
|
+
const RenderedScalebarLabels = (0, mobx_react_1.observer)(({ model }) => {
|
|
87
|
+
const { staticBlocks, bpPerPx } = model;
|
|
88
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, staticBlocks.map((block, idx) => {
|
|
89
|
+
const { key, widthPx } = block;
|
|
90
|
+
const k = `${key}-${idx}`;
|
|
78
91
|
if (block instanceof blockTypes_1.ContentBlock) {
|
|
79
|
-
|
|
80
|
-
return (react_1.default.createElement(Block_1.ContentBlock, { key: `${key}-${index}`, block: block }, ticks.map(tick => {
|
|
81
|
-
if (tick.type === 'major') {
|
|
82
|
-
const x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
|
|
83
|
-
const baseNumber = tick.base + 1;
|
|
84
|
-
return (react_1.default.createElement("div", { key: tick.base, className: classes.tick, style: { left: x } }, baseNumber ? (react_1.default.createElement(material_1.Typography, { className: classes.majorTickLabel }, (0, util_2.getTickDisplayStr)(baseNumber, bpPerPx))) : null));
|
|
85
|
-
}
|
|
86
|
-
return null;
|
|
87
|
-
})));
|
|
92
|
+
return react_1.default.createElement(RenderedBlockTicks, { key: k, block: block, bpPerPx: bpPerPx });
|
|
88
93
|
}
|
|
89
|
-
if (block instanceof blockTypes_1.ElidedBlock) {
|
|
90
|
-
return react_1.default.createElement(Block_1.ElidedBlock, { key:
|
|
94
|
+
else if (block instanceof blockTypes_1.ElidedBlock) {
|
|
95
|
+
return react_1.default.createElement(Block_1.ElidedBlock, { key: k, width: widthPx });
|
|
91
96
|
}
|
|
92
|
-
if (block instanceof blockTypes_1.InterRegionPaddingBlock) {
|
|
93
|
-
return (react_1.default.createElement(Block_1.InterRegionPaddingBlock, { key:
|
|
97
|
+
else if (block instanceof blockTypes_1.InterRegionPaddingBlock) {
|
|
98
|
+
return (react_1.default.createElement(Block_1.InterRegionPaddingBlock, { key: k, width: widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }));
|
|
94
99
|
}
|
|
95
100
|
return null;
|
|
96
101
|
})));
|
|
97
102
|
});
|
|
98
|
-
const Scalebar = react_1.default.forwardRef(({ model, style, className, ...other }, ref)
|
|
103
|
+
const Scalebar = (0, mobx_react_1.observer)(react_1.default.forwardRef(function Scalebar2({ model, style, className, ...other }, ref) {
|
|
99
104
|
const { classes, cx } = useStyles();
|
|
100
105
|
const offsetLeft = model.staticBlocks.offsetPx - model.offsetPx;
|
|
101
106
|
return (react_1.default.createElement(material_1.Paper, { "data-resizer": "true" // used to avoid click-and-drag scrolls on trackscontainer
|
|
@@ -112,5 +117,5 @@ const Scalebar = react_1.default.forwardRef(({ model, style, className, ...other
|
|
|
112
117
|
} },
|
|
113
118
|
react_1.default.createElement(RenderedScalebarLabels, { model: model }))),
|
|
114
119
|
react_1.default.createElement(RenderedRefNameLabels, { model: model })));
|
|
115
|
-
});
|
|
116
|
-
exports.default =
|
|
120
|
+
}));
|
|
121
|
+
exports.default = Scalebar;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
|
-
declare
|
|
4
|
-
showHelp?: boolean;
|
|
3
|
+
declare const SearchBox: ({ model, showHelp, }: {
|
|
4
|
+
showHelp?: boolean | undefined;
|
|
5
5
|
model: LinearGenomeViewModel;
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export default _default;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export default SearchBox;
|
|
@@ -17,7 +17,7 @@ const useStyles = (0, mui_1.makeStyles)()(() => ({
|
|
|
17
17
|
minWidth: 100,
|
|
18
18
|
},
|
|
19
19
|
}));
|
|
20
|
-
|
|
20
|
+
const SearchBox = (0, mobx_react_1.observer)(function ({ model, showHelp, }) {
|
|
21
21
|
const { classes } = useStyles();
|
|
22
22
|
const theme = (0, material_1.useTheme)();
|
|
23
23
|
const session = (0, util_1.getSession)(model);
|
|
@@ -102,5 +102,5 @@ function SearchBox({ model, showHelp, }) {
|
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
} }));
|
|
105
|
-
}
|
|
106
|
-
exports.default =
|
|
105
|
+
});
|
|
106
|
+
exports.default = SearchBox;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare const SequenceSearchDialog: ({ model, handleClose, }: {
|
|
3
3
|
model: {
|
|
4
4
|
assemblyNames: string[];
|
|
5
|
-
|
|
5
|
+
showTrack: (trackId: string) => void;
|
|
6
6
|
};
|
|
7
7
|
handleClose: () => void;
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export default _default;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default SequenceSearchDialog;
|
|
@@ -35,7 +35,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
35
35
|
width: '40em',
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
|
-
function
|
|
38
|
+
const SequenceSearchDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) {
|
|
39
39
|
const { classes } = useStyles();
|
|
40
40
|
const [value, setValue] = (0, react_1.useState)('');
|
|
41
41
|
const [searchForward, setSearchForward] = (0, react_1.useState)(true);
|
|
@@ -65,24 +65,26 @@ function SequenceDialog({ model, handleClose, }) {
|
|
|
65
65
|
const session = (0, util_1.getSession)(model);
|
|
66
66
|
const { assemblyManager } = session;
|
|
67
67
|
const assemblyName = model.assemblyNames[0];
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
if ((0, util_1.isSessionWithAddTracks)(session)) {
|
|
69
|
+
session.addTrackConf({
|
|
70
|
+
trackId,
|
|
71
|
+
name: `Sequence search ${value}`,
|
|
72
|
+
assemblyNames: [assemblyName],
|
|
73
|
+
type: 'FeatureTrack',
|
|
74
|
+
adapter: {
|
|
75
|
+
type: 'SequenceSearchAdapter',
|
|
76
|
+
search: value,
|
|
77
|
+
searchForward,
|
|
78
|
+
searchReverse,
|
|
79
|
+
caseInsensitive,
|
|
80
|
+
sequenceAdapter: (0, mobx_state_tree_1.getSnapshot)((_a = assemblyManager.get(assemblyName)) === null || _a === void 0 ? void 0 : _a.configuration.sequence.adapter),
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
model.showTrack(trackId);
|
|
84
|
+
}
|
|
83
85
|
}
|
|
84
86
|
handleClose();
|
|
85
87
|
}, variant: "contained", color: "primary" }, "Submit"),
|
|
86
88
|
react_1.default.createElement(material_1.Button, { onClick: () => handleClose(), variant: "contained", color: "secondary" }, "Close"))));
|
|
87
|
-
}
|
|
88
|
-
exports.default =
|
|
89
|
+
});
|
|
90
|
+
exports.default = SequenceSearchDialog;
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
3
|
import { LinearGenomeViewModel } from '..';
|
|
4
4
|
type LGV = LinearGenomeViewModel;
|
|
5
|
-
declare const
|
|
5
|
+
declare const TrackContainer: ({ model, track, }: {
|
|
6
6
|
model: LGV;
|
|
7
7
|
track: BaseTrackModel;
|
|
8
8
|
}) => React.JSX.Element;
|
|
9
|
-
export default
|
|
9
|
+
export default TrackContainer;
|
|
@@ -55,7 +55,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
55
55
|
zIndex: 3,
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
|
-
|
|
58
|
+
const TrackContainer = (0, mobx_react_1.observer)(function ({ model, track, }) {
|
|
59
59
|
const { classes } = useStyles();
|
|
60
60
|
const display = track.displays[0];
|
|
61
61
|
const { draggingTrackId } = model;
|
|
@@ -82,3 +82,4 @@ exports.default = (0, mobx_react_1.observer)(function TrackContainer({ model, tr
|
|
|
82
82
|
}, onDragEnter: debouncedOnDragEnter }),
|
|
83
83
|
react_1.default.createElement(ui_1.ResizeHandle, { onDrag: display.resizeHeight, className: classes.resizeHandle })));
|
|
84
84
|
});
|
|
85
|
+
exports.default = TrackContainer;
|
|
@@ -4,5 +4,5 @@ interface Props {
|
|
|
4
4
|
track: BaseTrackModel;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
7
|
+
declare const TrackLabel: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default TrackLabel;
|
|
@@ -46,7 +46,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
46
46
|
padding: theme.spacing(1),
|
|
47
47
|
},
|
|
48
48
|
}));
|
|
49
|
-
const TrackLabel = react_1.default.forwardRef(function ({ track, className }, ref) {
|
|
49
|
+
const TrackLabel = (0, mobx_react_1.observer)(react_1.default.forwardRef(function TrackLabel2({ track, className }, ref) {
|
|
50
50
|
var _a;
|
|
51
51
|
const { classes, cx } = useStyles();
|
|
52
52
|
const view = (0, util_1.getContainingView)(track);
|
|
@@ -82,5 +82,5 @@ const TrackLabel = react_1.default.forwardRef(function ({ track, className }, re
|
|
|
82
82
|
.join(' ') })),
|
|
83
83
|
react_1.default.createElement(CascadingMenuButton_1.default, { menuItems: items, "data-testid": "track_menu_icon" },
|
|
84
84
|
react_1.default.createElement(MoreVert_1.default, { fontSize: "small" }))));
|
|
85
|
-
});
|
|
86
|
-
exports.default =
|
|
85
|
+
}));
|
|
86
|
+
exports.default = TrackLabel;
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
3
|
import { LinearGenomeViewModel } from '..';
|
|
4
4
|
type LGV = LinearGenomeViewModel;
|
|
5
|
-
declare const
|
|
5
|
+
declare const TrackRenderingContainer: ({ model, track, onDragEnter, }: {
|
|
6
6
|
model: LGV;
|
|
7
7
|
track: BaseTrackModel;
|
|
8
8
|
onDragEnter: () => void;
|
|
9
9
|
}) => React.JSX.Element;
|
|
10
|
-
export default
|
|
10
|
+
export default TrackRenderingContainer;
|
|
@@ -47,7 +47,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
47
47
|
zIndex: 2,
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
const TrackRenderingContainer = (0, mobx_react_1.observer)(function ({ model, track, onDragEnter, }) {
|
|
51
51
|
const { classes } = useStyles();
|
|
52
52
|
const display = track.displays[0];
|
|
53
53
|
const { height, RenderingComponent, DisplayBlurb } = display;
|
|
@@ -73,3 +73,4 @@ exports.default = (0, mobx_react_1.observer)(function TrackRenderingContainer({
|
|
|
73
73
|
} },
|
|
74
74
|
react_1.default.createElement(DisplayBlurb, { model: display }))) : null)) : null));
|
|
75
75
|
});
|
|
76
|
+
exports.default = TrackRenderingContainer;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare const
|
|
4
|
+
declare const TracksContainer: ({ children, model, }: {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
model: LGV;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
|
-
export default
|
|
8
|
+
export default TracksContainer;
|
|
@@ -47,7 +47,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
47
47
|
overflow: 'hidden',
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
const TracksContainer = (0, mobx_react_1.observer)(function TracksContainer({ children, model, }) {
|
|
51
51
|
const { classes } = useStyles();
|
|
52
52
|
const { pluginManager } = (0, util_1.getEnv)(model);
|
|
53
53
|
const { mouseDown: mouseDown1, mouseUp } = (0, hooks_1.useSideScroll)(model);
|
|
@@ -70,3 +70,4 @@ exports.default = (0, mobx_react_1.observer)(function TracksContainer({ children
|
|
|
70
70
|
additional,
|
|
71
71
|
children));
|
|
72
72
|
});
|
|
73
|
+
exports.default = TracksContainer;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare
|
|
4
|
+
declare const VerticalGuide: ({ model, coordX, }: {
|
|
5
5
|
model: LGV;
|
|
6
6
|
coordX: number;
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default VerticalGuide;
|
|
@@ -17,12 +17,12 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
17
17
|
zIndex: 10,
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
-
function VerticalGuide({ model, coordX }) {
|
|
20
|
+
const VerticalGuide = (0, mobx_react_1.observer)(function VerticalGuide({ model, coordX, }) {
|
|
21
21
|
const { classes } = useStyles();
|
|
22
22
|
return (react_1.default.createElement(material_1.Tooltip, { open: true, placement: "top", title: (0, util_1.stringify)(model.pxToBp(coordX)), arrow: true },
|
|
23
23
|
react_1.default.createElement("div", { className: classes.guide, style: {
|
|
24
24
|
left: coordX,
|
|
25
25
|
background: 'red',
|
|
26
26
|
} })));
|
|
27
|
-
}
|
|
28
|
-
exports.default =
|
|
27
|
+
});
|
|
28
|
+
exports.default = VerticalGuide;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
|
-
declare
|
|
3
|
+
declare const ZoomControls: ({ model, }: {
|
|
4
4
|
model: LinearGenomeViewModel;
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
export default _default;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
export default ZoomControls;
|
|
@@ -43,7 +43,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
43
43
|
color: theme.palette.text.secondary,
|
|
44
44
|
},
|
|
45
45
|
}));
|
|
46
|
-
|
|
46
|
+
const ZoomControls = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
47
47
|
const { classes } = useStyles();
|
|
48
48
|
const { maxBpPerPx, minBpPerPx, bpPerPx, scaleFactor } = model;
|
|
49
49
|
const [value, setValue] = (0, react_1.useState)(-Math.log2(bpPerPx) * 100);
|
|
@@ -56,5 +56,5 @@ function ZoomControls({ model }) {
|
|
|
56
56
|
react_1.default.createElement(material_1.Slider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChange: (_, val) => setValue(val), onChangeCommitted: () => model.zoomTo(2 ** (-value / 100)), disabled: scaleFactor !== 1 }),
|
|
57
57
|
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(model.bpPerPx / 2), disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1, size: "large" },
|
|
58
58
|
react_1.default.createElement(ZoomIn_1.default, null))));
|
|
59
|
-
}
|
|
60
|
-
exports.default =
|
|
59
|
+
});
|
|
60
|
+
exports.default = ZoomControls;
|
|
@@ -87,12 +87,10 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
87
87
|
volatileWidth: number | undefined;
|
|
88
88
|
minimumBlockWidth: number;
|
|
89
89
|
draggingTrackId: string | undefined;
|
|
90
|
-
volatileError:
|
|
90
|
+
volatileError: unknown;
|
|
91
91
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
92
92
|
scaleFactor: number;
|
|
93
|
-
trackRefs:
|
|
94
|
-
[key: string]: HTMLDivElement;
|
|
95
|
-
};
|
|
93
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
96
94
|
coarseDynamicBlocks: BaseBlock[];
|
|
97
95
|
coarseTotalBp: number;
|
|
98
96
|
leftOffset: BpOffset | undefined;
|
|
@@ -170,7 +168,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
170
168
|
/**
|
|
171
169
|
* #getter
|
|
172
170
|
*/
|
|
173
|
-
readonly error:
|
|
171
|
+
readonly error: {};
|
|
174
172
|
/**
|
|
175
173
|
* #getter
|
|
176
174
|
*/
|
|
@@ -224,7 +222,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
224
222
|
/**
|
|
225
223
|
* #action
|
|
226
224
|
*/
|
|
227
|
-
setError(error:
|
|
225
|
+
setError(error: unknown): void;
|
|
228
226
|
/**
|
|
229
227
|
* #action
|
|
230
228
|
*/
|
|
@@ -545,6 +543,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
545
543
|
end: number;
|
|
546
544
|
reversed: boolean;
|
|
547
545
|
} | undefined;
|
|
546
|
+
} & {
|
|
547
|
+
afterCreate(): void;
|
|
548
548
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
549
549
|
export type LinearGenomeViewStateModel = ReturnType<typeof stateModelFactory>;
|
|
550
550
|
export type LinearGenomeViewModel = Instance<LinearGenomeViewStateModel>;
|
|
@@ -1256,6 +1256,39 @@ function stateModelFactory(pluginManager) {
|
|
|
1256
1256
|
? this.pxToBp(self.width / 2)
|
|
1257
1257
|
: undefined;
|
|
1258
1258
|
},
|
|
1259
|
+
}))
|
|
1260
|
+
.actions(self => ({
|
|
1261
|
+
afterCreate() {
|
|
1262
|
+
function handler(e) {
|
|
1263
|
+
const session = (0, util_1.getSession)(self);
|
|
1264
|
+
if (session.focusedViewId === self.id && (e.ctrlKey || e.metaKey)) {
|
|
1265
|
+
if (e.code === 'ArrowLeft') {
|
|
1266
|
+
e.preventDefault();
|
|
1267
|
+
// pan left
|
|
1268
|
+
self.slide(-0.9);
|
|
1269
|
+
}
|
|
1270
|
+
if (e.code === 'ArrowRight') {
|
|
1271
|
+
e.preventDefault();
|
|
1272
|
+
// pan right
|
|
1273
|
+
self.slide(0.9);
|
|
1274
|
+
}
|
|
1275
|
+
if (e.code === 'ArrowUp' && self.scaleFactor === 1) {
|
|
1276
|
+
e.preventDefault();
|
|
1277
|
+
// zoom in
|
|
1278
|
+
self.zoom(self.bpPerPx / 2);
|
|
1279
|
+
}
|
|
1280
|
+
if (e.code === 'ArrowDown' && self.scaleFactor === 1) {
|
|
1281
|
+
e.preventDefault();
|
|
1282
|
+
// zoom out
|
|
1283
|
+
self.zoom(self.bpPerPx * 2);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
document.addEventListener('keydown', handler);
|
|
1288
|
+
(0, mobx_state_tree_1.addDisposer)(self, () => {
|
|
1289
|
+
document.removeEventListener('keydown', handler);
|
|
1290
|
+
});
|
|
1291
|
+
},
|
|
1259
1292
|
}));
|
|
1260
1293
|
}
|
|
1261
1294
|
exports.stateModelFactory = stateModelFactory;
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
|
-
const
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
function SVGBackground({ width, height, shift, }) {
|
|
10
10
|
const theme = (0, material_1.useTheme)();
|
|
11
|
-
return (react_1.default.createElement("rect", { width: width + shift * 2, height: height, fill: (0,
|
|
11
|
+
return (react_1.default.createElement("rect", { width: width + shift * 2, height: height, fill: (0, util_1.stripAlpha)(theme.palette.background.default) }));
|
|
12
12
|
}
|
|
13
13
|
exports.default = SVGBackground;
|
|
@@ -7,7 +7,6 @@ const react_1 = __importDefault(require("react"));
|
|
|
7
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
8
|
const Base1DViewModel_1 = __importDefault(require("@jbrowse/core/util/Base1DViewModel"));
|
|
9
9
|
const material_1 = require("@mui/material");
|
|
10
|
-
const color_1 = __importDefault(require("color"));
|
|
11
10
|
// locals
|
|
12
11
|
const __1 = require("..");
|
|
13
12
|
const Cytobands_1 = __importDefault(require("../components/Cytobands"));
|
|
@@ -20,7 +19,7 @@ function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight, }) {
|
|
|
20
19
|
const assemblyName = assemblyNames.length > 1 ? '' : assemblyNames[0];
|
|
21
20
|
const assembly = assemblyManager.get(assemblyName);
|
|
22
21
|
const theme = (0, material_1.useTheme)();
|
|
23
|
-
const c = (0,
|
|
22
|
+
const c = (0, util_1.stripAlpha)(theme.palette.text.primary);
|
|
24
23
|
const overview = Base1DViewModel_1.default.create({
|
|
25
24
|
displayedRegions: JSON.parse(JSON.stringify(displayedRegions)),
|
|
26
25
|
interRegionPaddingWidth: 0,
|
|
@@ -33,9 +32,7 @@ function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight, }) {
|
|
|
33
32
|
overview.setVolatileWidth(width);
|
|
34
33
|
overview.showAllRegions();
|
|
35
34
|
const block = overview.dynamicBlocks.contentBlocks[0];
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
35
|
const first = visibleRegions.at(0);
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
39
36
|
const last = visibleRegions.at(-1);
|
|
40
37
|
const firstOverviewPx = overview.bpToPx({
|
|
41
38
|
...first,
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SVGTracks = exports.SVGRuler = exports.renderToSvg = exports.totalHeight = void 0;
|
|
7
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const server_1 = require("react-dom/server");
|
|
9
10
|
const mobx_1 = require("mobx");
|
|
@@ -9,11 +9,10 @@ const material_1 = require("@mui/material");
|
|
|
9
9
|
// locals
|
|
10
10
|
const util_2 = require("../util");
|
|
11
11
|
const SVGRegionSeparators_1 = __importDefault(require("./SVGRegionSeparators"));
|
|
12
|
-
const color_1 = __importDefault(require("color"));
|
|
13
12
|
function Ruler({ start, end, bpPerPx, reversed = false, major = true, minor = true, hideText = false, }) {
|
|
14
13
|
const ticks = (0, util_2.makeTicks)(start, end, bpPerPx, major, minor);
|
|
15
14
|
const theme = (0, material_1.useTheme)();
|
|
16
|
-
const c = (0,
|
|
15
|
+
const c = (0, util_1.stripAlpha)(theme.palette.text.secondary);
|
|
17
16
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
18
17
|
ticks.map(tick => {
|
|
19
18
|
const x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
|
|
@@ -32,7 +31,7 @@ function SVGRuler({ model, fontSize, }) {
|
|
|
32
31
|
const { dynamicBlocks: { contentBlocks }, offsetPx: viewOffsetPx, bpPerPx, } = model;
|
|
33
32
|
const renderRuler = contentBlocks.length < 5;
|
|
34
33
|
const theme = (0, material_1.useTheme)();
|
|
35
|
-
const c = (0,
|
|
34
|
+
const c = (0, util_1.stripAlpha)(theme.palette.text.primary);
|
|
36
35
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
37
36
|
react_1.default.createElement(SVGRegionSeparators_1.default, { model: model, height: 30 }),
|
|
38
37
|
contentBlocks.map(block => {
|
|
@@ -6,14 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
|
-
const color_1 = __importDefault(require("color"));
|
|
10
9
|
function SVGScalebar({ model, fontSize, }) {
|
|
11
10
|
const { offsetPx, dynamicBlocks: { totalWidthPxWithoutBorders: totalWidthPx, totalBp }, } = model;
|
|
12
11
|
const theme = (0, material_1.useTheme)();
|
|
13
12
|
const displayBp = (0, util_1.getBpDisplayStr)(totalBp);
|
|
14
13
|
const x0 = Math.max(-offsetPx, 0);
|
|
15
14
|
const x1 = x0 + totalWidthPx;
|
|
16
|
-
const c = (0,
|
|
15
|
+
const c = (0, util_1.stripAlpha)(theme.palette.text.secondary);
|
|
17
16
|
const x = x0 + (x1 - x0) / 2;
|
|
18
17
|
const y = fontSize;
|
|
19
18
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|