@jbrowse/plugin-linear-genome-view 2.6.3 → 2.7.1
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 +5 -6
- 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 +5 -21
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.d.ts +9 -0
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.js +32 -0
- 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/index.d.ts +1 -2
- package/dist/LinearGenomeView/index.js +3 -2
- 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/LinearGenomeView/svgcomponents/SVGTrackLabel.js +3 -1
- package/dist/index.d.ts +37 -37
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +4 -14
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +5 -5
- 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 +5 -21
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +9 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +27 -0
- 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/index.d.ts +1 -2
- package/esm/LinearGenomeView/index.js +2 -2
- 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/LinearGenomeView/svgcomponents/SVGTrackLabel.js +3 -1
- package/esm/index.d.ts +37 -37
- package/package.json +4 -5
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel';
|
|
3
|
-
declare const useStyles: (params: void, styleOverrides?: {
|
|
4
|
-
props: any;
|
|
5
|
-
ownerState?: Record<string, unknown> | undefined;
|
|
6
|
-
} | undefined) => {
|
|
7
|
-
classes: Record<"linearBlocks" | "heightOverflowed", string>;
|
|
8
|
-
theme: import("@mui/material").Theme;
|
|
9
|
-
css: import("tss-react").Css;
|
|
10
|
-
cx: import("tss-react").Cx;
|
|
11
|
-
};
|
|
12
3
|
declare const RenderedBlocks: ({ model, }: {
|
|
13
4
|
model: BaseLinearDisplayModel;
|
|
14
5
|
}) => React.JSX.Element;
|
|
15
|
-
|
|
6
|
+
export { RenderedBlocks };
|
|
7
|
+
declare const LinearBlocks: ({ model, }: {
|
|
16
8
|
model: BaseLinearDisplayModel;
|
|
17
|
-
})
|
|
18
|
-
export
|
|
19
|
-
declare const _default: typeof LinearBlocks;
|
|
20
|
-
export default _default;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export default LinearBlocks;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.RenderedBlocks = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const mui_1 = require("tss-react/mui");
|
|
9
9
|
const util_1 = require("@jbrowse/core/util");
|
|
@@ -31,7 +31,6 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
31
31
|
boxSizing: 'border-box',
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
|
-
exports.useStyles = useStyles;
|
|
35
34
|
const RenderedBlocks = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
36
35
|
const { classes } = useStyles();
|
|
37
36
|
const { blockDefinitions, blockState } = model;
|
|
@@ -52,11 +51,11 @@ const RenderedBlocks = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
52
51
|
if (block instanceof blockTypes_1.InterRegionPaddingBlock) {
|
|
53
52
|
return (react_1.default.createElement(Block_1.InterRegionPaddingBlock, { key: block.key, width: block.widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }));
|
|
54
53
|
}
|
|
55
|
-
throw new Error(`invalid block type ${
|
|
54
|
+
throw new Error(`invalid block type ${JSON.stringify(block)}`);
|
|
56
55
|
})));
|
|
57
56
|
});
|
|
58
57
|
exports.RenderedBlocks = RenderedBlocks;
|
|
59
|
-
|
|
58
|
+
const LinearBlocks = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
60
59
|
const { classes } = useStyles();
|
|
61
60
|
const { blockDefinitions } = model;
|
|
62
61
|
const viewModel = (0, util_1.getContainingView)(model);
|
|
@@ -64,5 +63,5 @@ function LinearBlocks({ model }) {
|
|
|
64
63
|
left: blockDefinitions.offsetPx - viewModel.offsetPx,
|
|
65
64
|
} },
|
|
66
65
|
react_1.default.createElement(RenderedBlocks, { model: model })));
|
|
67
|
-
}
|
|
68
|
-
exports.default =
|
|
66
|
+
});
|
|
67
|
+
exports.default = LinearBlocks;
|
|
@@ -49,7 +49,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
49
49
|
wordWrap: 'break-word',
|
|
50
50
|
},
|
|
51
51
|
}));
|
|
52
|
-
const TooltipContents = react_1.default.forwardRef(({ message }, ref)
|
|
52
|
+
const TooltipContents = react_1.default.forwardRef(function TooltipContents2({ message }, ref) {
|
|
53
53
|
return (react_1.default.createElement("div", { ref: ref }, react_1.default.isValidElement(message) ? (message) : message ? (react_1.default.createElement(ui_1.SanitizedHTML, { html: String(message) })) : null));
|
|
54
54
|
});
|
|
55
55
|
const Tooltip = (0, mobx_react_1.observer)(({ model, clientMouseCoord, }) => {
|
|
@@ -3,12 +3,8 @@ import { FeatureDensityStats } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
|
3
3
|
import { IAnyStateTreeNode } from 'mobx-state-tree';
|
|
4
4
|
export interface RenderProps {
|
|
5
5
|
rendererType: any;
|
|
6
|
-
renderArgs:
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
renderProps: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
6
|
+
renderArgs: Record<string, any>;
|
|
7
|
+
renderProps: Record<string, any>;
|
|
12
8
|
displayError: unknown;
|
|
13
9
|
rpcManager: {
|
|
14
10
|
call: Function;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare const SetMaxHeightDialog: ({ model, handleClose, }: {
|
|
3
3
|
model: {
|
|
4
|
-
maxHeight?: number;
|
|
4
|
+
maxHeight?: number | undefined;
|
|
5
5
|
setMaxHeight: (arg?: number) => void;
|
|
6
6
|
};
|
|
7
7
|
handleClose: () => void;
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export default _default;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default SetMaxHeightDialog;
|
|
@@ -33,7 +33,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
33
33
|
width: 500,
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
|
-
function
|
|
36
|
+
const SetMaxHeightDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) {
|
|
37
37
|
const { classes } = useStyles();
|
|
38
38
|
const { maxHeight = '' } = model;
|
|
39
39
|
const [max, setMax] = (0, react_1.useState)(`${maxHeight}`);
|
|
@@ -47,5 +47,5 @@ function SetMaxHeightDlg({ model, handleClose, }) {
|
|
|
47
47
|
handleClose();
|
|
48
48
|
} }, "Submit"),
|
|
49
49
|
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel")))));
|
|
50
|
-
}
|
|
51
|
-
exports.default =
|
|
50
|
+
});
|
|
51
|
+
exports.default = SetMaxHeightDialog;
|
|
@@ -196,7 +196,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
196
196
|
readonly currentBytesRequested: number;
|
|
197
197
|
readonly currentFeatureScreenDensity: number;
|
|
198
198
|
readonly maxFeatureScreenDensity: any;
|
|
199
|
-
readonly featureDensityStatsReady: boolean;
|
|
199
|
+
readonly featureDensityStatsReady: boolean; /**
|
|
200
|
+
* #getter
|
|
201
|
+
*/
|
|
200
202
|
readonly maxAllowableBytes: number;
|
|
201
203
|
} & {
|
|
202
204
|
afterAttach(): void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare
|
|
4
|
+
declare const CenterLine: ({ model }: {
|
|
5
5
|
model: LGV;
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export default _default;
|
|
6
|
+
}) => React.JSX.Element | null;
|
|
7
|
+
export default CenterLine;
|
|
@@ -44,7 +44,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
44
44
|
fontWeight: 'bold',
|
|
45
45
|
},
|
|
46
46
|
}));
|
|
47
|
-
|
|
47
|
+
const CenterLine = (0, mobx_react_1.observer)(function ({ model }) {
|
|
48
48
|
const { bpPerPx, centerLineInfo, trackHeights, tracks, width } = model;
|
|
49
49
|
const ref = (0, react_1.useRef)(null);
|
|
50
50
|
const { classes } = useStyles();
|
|
@@ -60,5 +60,5 @@ function CenterLine({ model }) {
|
|
|
60
60
|
":",
|
|
61
61
|
' ',
|
|
62
62
|
Math.max(Math.round(centerLineInfo.offset) + 1, 0))))) : null;
|
|
63
|
-
}
|
|
64
|
-
exports.default =
|
|
63
|
+
});
|
|
64
|
+
exports.default = CenterLine;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
3
3
|
import { ContentBlock } from '@jbrowse/core/util/blockTypes';
|
|
4
4
|
import { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
5
|
-
declare const
|
|
5
|
+
declare const Cytobands: ({ overview, block, assembly, }: {
|
|
6
6
|
overview: Base1DViewModel;
|
|
7
7
|
assembly?: ({
|
|
8
8
|
configuration: any;
|
|
@@ -18,6 +18,8 @@ declare const _default: ({ overview, block, assembly, }: {
|
|
|
18
18
|
[x: string]: string | undefined;
|
|
19
19
|
} | undefined;
|
|
20
20
|
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
getConf(arg: string): any;
|
|
21
23
|
} & {
|
|
22
24
|
readonly initialized: boolean;
|
|
23
25
|
readonly name: string;
|
|
@@ -72,6 +74,8 @@ declare const _default: ({ overview, block, assembly, }: {
|
|
|
72
74
|
[x: string]: string | undefined;
|
|
73
75
|
} | undefined;
|
|
74
76
|
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
77
|
+
} & {
|
|
78
|
+
getConf(arg: string): any;
|
|
75
79
|
} & {
|
|
76
80
|
readonly initialized: boolean;
|
|
77
81
|
readonly name: string;
|
|
@@ -115,4 +119,4 @@ declare const _default: ({ overview, block, assembly, }: {
|
|
|
115
119
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
|
|
116
120
|
block: ContentBlock;
|
|
117
121
|
}) => React.JSX.Element;
|
|
118
|
-
export default
|
|
122
|
+
export default Cytobands;
|
|
@@ -30,6 +30,20 @@ function leftRoundedRect(x, y, width, height, radius) {
|
|
|
30
30
|
+ "a" + radius + "," + radius + " 0 0 1 " + radius + "," + (-radius)
|
|
31
31
|
+ "z";
|
|
32
32
|
}
|
|
33
|
+
function leftTriangle(x, y, width, height) {
|
|
34
|
+
return [
|
|
35
|
+
[x, 0],
|
|
36
|
+
[x + width, height / 2],
|
|
37
|
+
[x, height],
|
|
38
|
+
].toString();
|
|
39
|
+
}
|
|
40
|
+
function rightTriangle(x, y, width, height) {
|
|
41
|
+
return [
|
|
42
|
+
[x, height / 2],
|
|
43
|
+
[x + width, 0],
|
|
44
|
+
[x + width, height],
|
|
45
|
+
].toString();
|
|
46
|
+
}
|
|
33
47
|
const colorMap = {
|
|
34
48
|
gneg: 'rgb(227,227,227)',
|
|
35
49
|
gpos25: 'rgb(142,142,142)',
|
|
@@ -40,52 +54,37 @@ const colorMap = {
|
|
|
40
54
|
stalk: 'rgb(127,127,127)',
|
|
41
55
|
acen: '#800',
|
|
42
56
|
};
|
|
43
|
-
|
|
57
|
+
const Cytobands = (0, mobx_react_1.observer)(function ({ overview, block, assembly, }) {
|
|
44
58
|
const { offsetPx, reversed } = block;
|
|
45
59
|
const cytobands = (0, util_1.getCytobands)(assembly, block.refName);
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const lcap = reversed ? arr.length - 1 : 0;
|
|
62
|
-
const rcap = reversed ? 0 : arr.length - 1;
|
|
63
|
-
let firstCent = true;
|
|
64
|
-
return (react_1.default.createElement("g", { transform: `translate(-${offsetPx})` }, coords.map(([start, end, type], index) => {
|
|
65
|
-
const key = `${start}-${end}-${type}`;
|
|
66
|
-
if (type === 'acen' && firstCent) {
|
|
67
|
-
firstCent = false;
|
|
68
|
-
return (react_1.default.createElement("polygon", { key: key, points: [
|
|
69
|
-
[start, 0],
|
|
70
|
-
[end, __1.HEADER_OVERVIEW_HEIGHT / 2],
|
|
71
|
-
[start, __1.HEADER_OVERVIEW_HEIGHT],
|
|
72
|
-
].toString(), fill: colorMap[type] }));
|
|
60
|
+
const lcap = reversed ? cytobands.length - 1 : 0;
|
|
61
|
+
const rcap = reversed ? 0 : cytobands.length - 1;
|
|
62
|
+
const h = __1.HEADER_OVERVIEW_HEIGHT;
|
|
63
|
+
let centromereSeen = false;
|
|
64
|
+
return (react_1.default.createElement("g", { transform: `translate(-${offsetPx})` }, cytobands.map((args, index) => {
|
|
65
|
+
const k = JSON.stringify(args);
|
|
66
|
+
const { refName, type, start, end } = args;
|
|
67
|
+
const s = overview.bpToPx({ refName, coord: start }) || 0;
|
|
68
|
+
const e = overview.bpToPx({ refName, coord: end }) || 0;
|
|
69
|
+
const l = Math.min(s, e);
|
|
70
|
+
const w = Math.abs(e - s);
|
|
71
|
+
const c = colorMap[type];
|
|
72
|
+
if (type === 'acen' && !centromereSeen) {
|
|
73
|
+
centromereSeen = true; // the next acen entry is drawn with different right triangle
|
|
74
|
+
return react_1.default.createElement("polygon", { key: k, points: leftTriangle(s, 0, w, h), fill: c });
|
|
73
75
|
}
|
|
74
|
-
if (type === 'acen' &&
|
|
75
|
-
return
|
|
76
|
-
[start, __1.HEADER_OVERVIEW_HEIGHT / 2],
|
|
77
|
-
[end, 0],
|
|
78
|
-
[end, __1.HEADER_OVERVIEW_HEIGHT],
|
|
79
|
-
].toString(), fill: colorMap[type] }));
|
|
76
|
+
else if (type === 'acen' && centromereSeen) {
|
|
77
|
+
return react_1.default.createElement("polygon", { key: k, points: rightTriangle(s, 0, w, h), fill: c });
|
|
80
78
|
}
|
|
81
|
-
if (lcap === index) {
|
|
82
|
-
return
|
|
79
|
+
else if (lcap === index) {
|
|
80
|
+
return react_1.default.createElement("path", { key: k, d: leftRoundedRect(l, 0, w, h, 8), fill: c });
|
|
83
81
|
}
|
|
84
82
|
else if (rcap === index) {
|
|
85
|
-
return
|
|
83
|
+
return react_1.default.createElement("path", { key: k, d: rightRoundedRect(l, 0, w, h, 8), fill: c });
|
|
86
84
|
}
|
|
87
85
|
else {
|
|
88
|
-
return
|
|
86
|
+
return react_1.default.createElement("rect", { key: k, x: l, y: 0, width: w, height: h, fill: c });
|
|
89
87
|
}
|
|
90
88
|
})));
|
|
91
89
|
});
|
|
90
|
+
exports.default = Cytobands;
|
|
@@ -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 GetSequenceDialog: ({ model, handleClose, }: {
|
|
5
5
|
model: LGV;
|
|
6
6
|
handleClose: () => void;
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default GetSequenceDialog;
|
|
@@ -74,7 +74,7 @@ async function fetchSequence(model, regions, signal) {
|
|
|
74
74
|
signal,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
const GetSequenceDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) {
|
|
78
78
|
const { classes } = useStyles();
|
|
79
79
|
const session = (0, util_1.getSession)(model);
|
|
80
80
|
const [error, setError] = (0, react_1.useState)();
|
|
@@ -170,5 +170,5 @@ function SequenceDialog({ model, handleClose, }) {
|
|
|
170
170
|
}), 'jbrowse_ref_seq.fa');
|
|
171
171
|
}, disabled: loading || !!error, color: "primary", startIcon: react_1.default.createElement(GetApp_1.default, null) }, "Download FASTA"),
|
|
172
172
|
react_1.default.createElement(material_1.Button, { onClick: handleClose, variant: "contained" }, "Close"))));
|
|
173
|
-
}
|
|
174
|
-
exports.default =
|
|
173
|
+
});
|
|
174
|
+
exports.default = GetSequenceDialog;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare
|
|
4
|
+
declare const Gridlines: ({ model }: {
|
|
5
5
|
model: LGV;
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export default _default;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export default Gridlines;
|
|
@@ -36,30 +36,33 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
36
36
|
background: theme.palette.divider,
|
|
37
37
|
},
|
|
38
38
|
}));
|
|
39
|
-
|
|
39
|
+
function RenderedBlockLines({ block, bpPerPx, }) {
|
|
40
40
|
const { classes, cx } = useStyles();
|
|
41
|
-
|
|
41
|
+
const ticks = (0, util_1.makeTicks)(block.start, block.end, bpPerPx);
|
|
42
|
+
return (react_1.default.createElement(Block_1.ContentBlock, { block: block }, ticks.map(({ type, base }) => {
|
|
43
|
+
const x = (block.reversed ? block.end - base : base - block.start) / bpPerPx;
|
|
44
|
+
return (react_1.default.createElement("div", { key: base, className: cx(classes.tick, type === 'major' || type === 'labeledMajor'
|
|
45
|
+
? classes.majorTick
|
|
46
|
+
: classes.minorTick), style: { left: x } }));
|
|
47
|
+
})));
|
|
48
|
+
}
|
|
49
|
+
const RenderedVerticalGuides = (0, mobx_react_1.observer)(({ model }) => {
|
|
50
|
+
const { staticBlocks, bpPerPx } = model;
|
|
51
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, staticBlocks.map((block, index) => {
|
|
52
|
+
const k = `${block.key}-${index}`;
|
|
42
53
|
if (block instanceof blockTypes_1.ContentBlock) {
|
|
43
|
-
|
|
44
|
-
return (react_1.default.createElement(Block_1.ContentBlock, { key: `${block.key}-${index}`, block: block }, ticks.map(tick => {
|
|
45
|
-
const x = (block.reversed
|
|
46
|
-
? block.end - tick.base
|
|
47
|
-
: tick.base - block.start) / model.bpPerPx;
|
|
48
|
-
return (react_1.default.createElement("div", { key: tick.base, className: cx(classes.tick, tick.type === 'major' || tick.type === 'labeledMajor'
|
|
49
|
-
? classes.majorTick
|
|
50
|
-
: classes.minorTick), style: { left: x } }));
|
|
51
|
-
})));
|
|
54
|
+
return react_1.default.createElement(RenderedBlockLines, { key: k, block: block, bpPerPx: bpPerPx });
|
|
52
55
|
}
|
|
53
|
-
if (block instanceof blockTypes_1.ElidedBlock) {
|
|
54
|
-
return react_1.default.createElement(Block_1.ElidedBlock, { key:
|
|
56
|
+
else if (block instanceof blockTypes_1.ElidedBlock) {
|
|
57
|
+
return react_1.default.createElement(Block_1.ElidedBlock, { key: k, width: block.widthPx });
|
|
55
58
|
}
|
|
56
|
-
if (block instanceof blockTypes_1.InterRegionPaddingBlock) {
|
|
57
|
-
return (react_1.default.createElement(Block_1.InterRegionPaddingBlock, { key:
|
|
59
|
+
else if (block instanceof blockTypes_1.InterRegionPaddingBlock) {
|
|
60
|
+
return (react_1.default.createElement(Block_1.InterRegionPaddingBlock, { key: k, width: block.widthPx, boundary: block.variant === 'boundary' }));
|
|
58
61
|
}
|
|
59
62
|
return null;
|
|
60
63
|
})));
|
|
61
64
|
});
|
|
62
|
-
function
|
|
65
|
+
const Gridlines = (0, mobx_react_1.observer)(function ({ model }) {
|
|
63
66
|
const { classes } = useStyles();
|
|
64
67
|
// find the block that needs pinning to the left side for context
|
|
65
68
|
const offsetLeft = model.staticBlocks.offsetPx - model.offsetPx;
|
|
@@ -71,5 +74,5 @@ function VerticalGuides({ model }) {
|
|
|
71
74
|
width: model.staticBlocks.totalWidthPx,
|
|
72
75
|
} },
|
|
73
76
|
react_1.default.createElement(RenderedVerticalGuides, { model: model }))));
|
|
74
|
-
}
|
|
75
|
-
exports.default =
|
|
77
|
+
});
|
|
78
|
+
exports.default = Gridlines;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare const
|
|
4
|
+
declare const LinearGenomeViewImportForm: ({ model, }: {
|
|
5
5
|
model: LGV;
|
|
6
6
|
}) => React.JSX.Element;
|
|
7
|
-
export default
|
|
7
|
+
export default LinearGenomeViewImportForm;
|
|
@@ -48,7 +48,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
48
48
|
padding: theme.spacing(4),
|
|
49
49
|
},
|
|
50
50
|
}));
|
|
51
|
-
|
|
51
|
+
const LinearGenomeViewImportForm = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
52
52
|
var _a;
|
|
53
53
|
const { classes } = useStyles();
|
|
54
54
|
const session = (0, util_1.getSession)(model);
|
|
@@ -168,3 +168,4 @@ exports.default = (0, mobx_react_1.observer)(function ({ model }) {
|
|
|
168
168
|
model.showAllRegionsInAssembly(selectedAsm);
|
|
169
169
|
}, variant: "contained", color: "secondary" }, "Show all regions in assembly"))))))));
|
|
170
170
|
});
|
|
171
|
+
exports.default = LinearGenomeViewImportForm;
|
|
@@ -35,6 +35,7 @@ const mobx_react_1 = require("mobx-react");
|
|
|
35
35
|
const Icons_1 = require("@jbrowse/core/ui/Icons");
|
|
36
36
|
const TrackContainer_1 = __importDefault(require("./TrackContainer"));
|
|
37
37
|
const TracksContainer_1 = __importDefault(require("./TracksContainer"));
|
|
38
|
+
const util_1 = require("@jbrowse/core/util");
|
|
38
39
|
const ImportForm = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./ImportForm'))));
|
|
39
40
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
40
41
|
note: {
|
|
@@ -46,6 +47,23 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
46
47
|
const LinearGenomeView = (0, mobx_react_1.observer)(({ model }) => {
|
|
47
48
|
const { tracks, error, initialized, hasDisplayedRegions } = model;
|
|
48
49
|
const { classes } = useStyles();
|
|
50
|
+
const ref = (0, react_1.useRef)(null);
|
|
51
|
+
const session = (0, util_1.getSession)(model);
|
|
52
|
+
(0, react_1.useEffect)(() => {
|
|
53
|
+
// sets the focused view id based on a click within the LGV; necessary for subviews to be focused properly
|
|
54
|
+
function handleSelectView(e) {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
if (e.target instanceof Element && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
57
|
+
(_b = session.setFocusedViewId) === null || _b === void 0 ? void 0 : _b.call(session, model.id);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
document.addEventListener('mousedown', handleSelectView);
|
|
61
|
+
document.addEventListener('keydown', handleSelectView);
|
|
62
|
+
return () => {
|
|
63
|
+
document.removeEventListener('mousedown', handleSelectView);
|
|
64
|
+
document.removeEventListener('keydown', handleSelectView);
|
|
65
|
+
};
|
|
66
|
+
}, [session, model]);
|
|
49
67
|
if (!initialized && !error) {
|
|
50
68
|
return react_1.default.createElement(ui_1.LoadingEllipses, { variant: "h6" });
|
|
51
69
|
}
|
|
@@ -54,7 +72,7 @@ const LinearGenomeView = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
54
72
|
}
|
|
55
73
|
const MiniControlsComponent = model.MiniControlsComponent();
|
|
56
74
|
const HeaderComponent = model.HeaderComponent();
|
|
57
|
-
return (react_1.default.createElement("div", { style: { position: 'relative' } },
|
|
75
|
+
return (react_1.default.createElement("div", { style: { position: 'relative' }, ref: ref },
|
|
58
76
|
react_1.default.createElement(HeaderComponent, { model: model }),
|
|
59
77
|
react_1.default.createElement(MiniControlsComponent, { model: model }),
|
|
60
78
|
react_1.default.createElement(TracksContainer_1.default, { model: model }, !tracks.length ? (react_1.default.createElement(material_1.Paper, { variant: "outlined", className: classes.note }, !model.hideNoTracksActive ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -12,23 +12,31 @@ const ZoomOut_1 = __importDefault(require("@mui/icons-material/ZoomOut"));
|
|
|
12
12
|
const KeyboardArrowDown_1 = __importDefault(require("@mui/icons-material/KeyboardArrowDown"));
|
|
13
13
|
const CascadingMenuButton_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenuButton"));
|
|
14
14
|
const mui_1 = require("tss-react/mui");
|
|
15
|
+
const util_1 = require("@jbrowse/core/util");
|
|
15
16
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
16
|
-
|
|
17
|
+
background: {
|
|
17
18
|
position: 'absolute',
|
|
18
19
|
right: 0,
|
|
19
20
|
zIndex: 1001,
|
|
20
21
|
background: theme.palette.background.paper,
|
|
21
22
|
},
|
|
23
|
+
focusedBackground: {
|
|
24
|
+
background: theme.palette.secondary.light,
|
|
25
|
+
svg: {
|
|
26
|
+
fill: theme.palette.secondary.contrastText,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
22
29
|
}));
|
|
23
30
|
const MiniControls = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
24
|
-
const { classes } = useStyles();
|
|
25
|
-
const { bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor, hideHeader } = model;
|
|
26
|
-
|
|
31
|
+
const { classes, cx } = useStyles();
|
|
32
|
+
const { id, bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor, hideHeader } = model;
|
|
33
|
+
const { focusedViewId } = (0, util_1.getSession)(model);
|
|
34
|
+
return hideHeader ? (react_1.default.createElement(material_1.Paper, { className: cx(classes.background, focusedViewId === id ? classes.focusedBackground : undefined) },
|
|
27
35
|
react_1.default.createElement(CascadingMenuButton_1.default, { menuItems: model.menuItems() },
|
|
28
36
|
react_1.default.createElement(KeyboardArrowDown_1.default, { fontSize: "small" })),
|
|
29
37
|
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_out", onClick: () => model.zoom(bpPerPx * 2), disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1 },
|
|
30
38
|
react_1.default.createElement(ZoomOut_1.default, { fontSize: "small" })),
|
|
31
|
-
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(
|
|
39
|
+
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(bpPerPx / 2), disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1 },
|
|
32
40
|
react_1.default.createElement(ZoomIn_1.default, { fontSize: "small" })))) : null;
|
|
33
41
|
});
|
|
34
42
|
exports.default = MiniControls;
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
3
3
|
import { LinearGenomeViewModel } from '..';
|
|
4
4
|
type LGV = LinearGenomeViewModel;
|
|
5
|
-
declare const
|
|
5
|
+
declare const OverviewRubberband: ({ model, overview, ControlComponent, }: {
|
|
6
6
|
model: LGV;
|
|
7
7
|
overview: Base1DViewModel;
|
|
8
8
|
ControlComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
9
9
|
}) => React.JSX.Element;
|
|
10
|
-
export default
|
|
10
|
+
export default OverviewRubberband;
|
|
@@ -60,7 +60,7 @@ const HoverTooltip = (0, mobx_react_1.observer)(function ({ model, open, guideX,
|
|
|
60
60
|
return (react_1.default.createElement(material_1.Tooltip, { open: open, placement: "top", title: [(0, util_1.stringify)(px), cytoband === null || cytoband === void 0 ? void 0 : cytoband.get('name')].join(' '), arrow: true },
|
|
61
61
|
react_1.default.createElement("div", { className: classes.guide, style: { left: guideX } })));
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
const OverviewRubberband = (0, mobx_react_1.observer)(function OverviewRubberband({ model, overview, ControlComponent = react_1.default.createElement("div", null), }) {
|
|
64
64
|
const { cytobandOffset } = model;
|
|
65
65
|
const [startX, setStartX] = (0, react_1.useState)();
|
|
66
66
|
const [currentX, setCurrentX] = (0, react_1.useState)();
|
|
@@ -156,3 +156,4 @@ exports.default = (0, mobx_react_1.observer)(function OverviewRubberband({ model
|
|
|
156
156
|
leftBpOffset && rightBpOffset ? (react_1.default.createElement(RubberbandSpan_1.default, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, width: Math.abs(width), left: left })) : null,
|
|
157
157
|
react_1.default.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
158
158
|
});
|
|
159
|
+
exports.default = OverviewRubberband;
|
|
@@ -7,10 +7,10 @@ declare const Polygon: ({ model, overview, useOffset, }: {
|
|
|
7
7
|
useOffset?: boolean | undefined;
|
|
8
8
|
}) => React.JSX.Element | null;
|
|
9
9
|
type LGV = LinearGenomeViewModel;
|
|
10
|
-
declare const
|
|
10
|
+
declare const OverviewScalebar: ({ model, children, }: {
|
|
11
11
|
model: LGV;
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
}) => React.JSX.Element;
|
|
14
|
-
export default _default;
|
|
15
14
|
export { Polygon };
|
|
16
15
|
export { default as Cytobands } from './Cytobands';
|
|
16
|
+
export default OverviewScalebar;
|