@jbrowse/plugin-linear-genome-view 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseLinearDisplay/components/Tooltip.js +4 -2
- package/dist/LinearGenomeView/components/LinearGenomeView.js +29 -7
- package/dist/LinearGenomeView/components/OverviewRubberband.js +5 -2
- package/dist/LinearGenomeView/components/TrackLabelContainer.js +2 -2
- package/dist/LinearGenomeView/model.d.ts +7 -1
- package/dist/LinearGenomeView/model.js +30 -19
- package/dist/index.d.ts +52 -15
- package/dist/index.js +19 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js +4 -2
- package/esm/LinearGenomeView/components/LinearGenomeView.js +29 -7
- package/esm/LinearGenomeView/components/OverviewRubberband.js +5 -2
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +2 -2
- package/esm/LinearGenomeView/model.d.ts +7 -1
- package/esm/LinearGenomeView/model.js +30 -19
- package/esm/index.d.ts +52 -15
- package/esm/index.js +19 -0
- package/package.json +2 -2
|
@@ -53,7 +53,8 @@ const TooltipContents = react_1.default.forwardRef(function TooltipContents2({ m
|
|
|
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, }) => {
|
|
56
|
-
|
|
56
|
+
var _a, _b;
|
|
57
|
+
const { theme, classes } = useStyles();
|
|
57
58
|
const { featureUnderMouse } = model;
|
|
58
59
|
const [width, setWidth] = (0, react_1.useState)(0);
|
|
59
60
|
const [popperElt, setPopperElt] = (0, react_1.useState)(null);
|
|
@@ -79,7 +80,8 @@ const Tooltip = (0, mobx_react_1.observer)(({ model, clientMouseCoord, }) => {
|
|
|
79
80
|
const contents = featureUnderMouse
|
|
80
81
|
? (0, configuration_1.getConf)(model, 'mouseover', { feature: featureUnderMouse })
|
|
81
82
|
: undefined;
|
|
82
|
-
|
|
83
|
+
const popperTheme = (_a = theme === null || theme === void 0 ? void 0 : theme.components) === null || _a === void 0 ? void 0 : _a.MuiPopper;
|
|
84
|
+
return featureUnderMouse && contents ? (react_1.default.createElement(material_1.Portal, { container: (_b = popperTheme === null || popperTheme === void 0 ? void 0 : popperTheme.defaultProps) === null || _b === void 0 ? void 0 : _b.container },
|
|
83
85
|
react_1.default.createElement("div", { ref: setPopperElt, className: classes.tooltip,
|
|
84
86
|
// zIndex needed to go over widget drawer
|
|
85
87
|
style: { ...styles.popper, zIndex: 100000 }, ...attributes.popper },
|
|
@@ -30,12 +30,12 @@ const react_1 = __importStar(require("react"));
|
|
|
30
30
|
const material_1 = require("@mui/material");
|
|
31
31
|
const mui_1 = require("tss-react/mui");
|
|
32
32
|
const ui_1 = require("@jbrowse/core/ui");
|
|
33
|
+
const util_1 = require("@jbrowse/core/util");
|
|
33
34
|
const mobx_react_1 = require("mobx-react");
|
|
34
35
|
// icons
|
|
35
36
|
const Icons_1 = require("@jbrowse/core/ui/Icons");
|
|
36
37
|
const TrackContainer_1 = __importDefault(require("./TrackContainer"));
|
|
37
38
|
const TracksContainer_1 = __importDefault(require("./TracksContainer"));
|
|
38
|
-
const util_1 = require("@jbrowse/core/util");
|
|
39
39
|
const ImportForm = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./ImportForm'))));
|
|
40
40
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
41
41
|
note: {
|
|
@@ -43,14 +43,28 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
43
43
|
paddingTop: theme.spacing(1),
|
|
44
44
|
paddingBottom: theme.spacing(1),
|
|
45
45
|
},
|
|
46
|
+
rel: {
|
|
47
|
+
position: 'relative',
|
|
48
|
+
},
|
|
49
|
+
top: {
|
|
50
|
+
zIndex: 1000,
|
|
51
|
+
},
|
|
46
52
|
}));
|
|
53
|
+
function NoTracksActive({ model }) {
|
|
54
|
+
const { classes } = useStyles();
|
|
55
|
+
const { hideNoTracksActive } = model;
|
|
56
|
+
return (react_1.default.createElement(material_1.Paper, { className: classes.note }, !hideNoTracksActive ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
57
|
+
react_1.default.createElement(material_1.Typography, null, "No tracks active."),
|
|
58
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: () => model.activateTrackSelector(), className: classes.top, startIcon: react_1.default.createElement(Icons_1.TrackSelector, null) }, "Open track selector"))) : (react_1.default.createElement("div", { style: { height: '48px' } }))));
|
|
59
|
+
}
|
|
47
60
|
const LinearGenomeView = (0, mobx_react_1.observer)(({ model }) => {
|
|
48
61
|
const { tracks, error, initialized, hasDisplayedRegions } = model;
|
|
49
|
-
const { classes } = useStyles();
|
|
50
62
|
const ref = (0, react_1.useRef)(null);
|
|
51
63
|
const session = (0, util_1.getSession)(model);
|
|
64
|
+
const { classes } = useStyles();
|
|
52
65
|
(0, react_1.useEffect)(() => {
|
|
53
|
-
// sets the focused view id based on a click within the LGV;
|
|
66
|
+
// sets the focused view id based on a click within the LGV;
|
|
67
|
+
// necessary for subviews to be focused properly
|
|
54
68
|
function handleSelectView(e) {
|
|
55
69
|
var _a, _b;
|
|
56
70
|
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))) {
|
|
@@ -72,11 +86,19 @@ const LinearGenomeView = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
72
86
|
}
|
|
73
87
|
const MiniControlsComponent = model.MiniControlsComponent();
|
|
74
88
|
const HeaderComponent = model.HeaderComponent();
|
|
75
|
-
return (react_1.default.createElement("div", {
|
|
89
|
+
return (react_1.default.createElement("div", { className: classes.rel, ref: ref, onMouseLeave: () => session.setHovered(undefined), onMouseMove: event => {
|
|
90
|
+
const c = ref.current;
|
|
91
|
+
if (!c) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const { tracks } = model;
|
|
95
|
+
const leftPx = event.clientX - c.getBoundingClientRect().left;
|
|
96
|
+
const hoverPosition = model.pxToBp(leftPx);
|
|
97
|
+
const hoverFeature = tracks.find(t => t.displays[0].featureUnderMouse);
|
|
98
|
+
session.setHovered({ hoverPosition, hoverFeature });
|
|
99
|
+
} },
|
|
76
100
|
react_1.default.createElement(HeaderComponent, { model: model }),
|
|
77
101
|
react_1.default.createElement(MiniControlsComponent, { model: model }),
|
|
78
|
-
react_1.default.createElement(TracksContainer_1.default, { model: model }, !tracks.length ? (react_1.default.createElement(
|
|
79
|
-
react_1.default.createElement(material_1.Typography, null, "No tracks active."),
|
|
80
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: model.activateTrackSelector, style: { zIndex: 1000 }, startIcon: react_1.default.createElement(Icons_1.TrackSelector, null) }, "Open track selector"))) : (react_1.default.createElement("div", { style: { height: '48px' } })))) : (tracks.map(track => (react_1.default.createElement(TrackContainer_1.default, { key: track.id, model: model, track: track })))))));
|
|
102
|
+
react_1.default.createElement(TracksContainer_1.default, { model: model }, !tracks.length ? (react_1.default.createElement(NoTracksActive, { model: model })) : (tracks.map(track => (react_1.default.createElement(TrackContainer_1.default, { key: track.id, model: model, track: track })))))));
|
|
81
103
|
});
|
|
82
104
|
exports.default = LinearGenomeView;
|
|
@@ -46,6 +46,9 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
46
46
|
position: 'absolute',
|
|
47
47
|
zIndex: 10,
|
|
48
48
|
},
|
|
49
|
+
rel: {
|
|
50
|
+
position: 'relative',
|
|
51
|
+
},
|
|
49
52
|
});
|
|
50
53
|
const HoverTooltip = (0, mobx_react_1.observer)(function ({ model, open, guideX, overview, }) {
|
|
51
54
|
var _a;
|
|
@@ -131,7 +134,7 @@ const OverviewRubberband = (0, mobx_react_1.observer)(function OverviewRubberban
|
|
|
131
134
|
setGuideX(undefined);
|
|
132
135
|
}
|
|
133
136
|
if (startX === undefined) {
|
|
134
|
-
return (react_1.default.createElement("div", {
|
|
137
|
+
return (react_1.default.createElement("div", { className: classes.rel },
|
|
135
138
|
guideX !== undefined ? (react_1.default.createElement(HoverTooltip, { model: model, open: !mouseDragging, overview: overview, guideX: guideX })) : null,
|
|
136
139
|
react_1.default.createElement("div", { className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
137
140
|
}
|
|
@@ -152,7 +155,7 @@ const OverviewRubberband = (0, mobx_react_1.observer)(function OverviewRubberban
|
|
|
152
155
|
[leftBpOffset, rightBpOffset] = [rightBpOffset, leftBpOffset];
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
|
-
return (react_1.default.createElement("div", {
|
|
158
|
+
return (react_1.default.createElement("div", { className: classes.rel },
|
|
156
159
|
leftBpOffset && rightBpOffset ? (react_1.default.createElement(RubberbandSpan_1.default, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, width: Math.abs(width), left: left })) : null,
|
|
157
160
|
react_1.default.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
158
161
|
});
|
|
@@ -23,9 +23,9 @@ const TrackLabelContainer = (0, mobx_react_1.observer)(function ({ track, view,
|
|
|
23
23
|
const { classes, cx } = useStyles();
|
|
24
24
|
const display = track.displays[0];
|
|
25
25
|
const { trackLabel, trackLabelOverlap, trackLabelOffset } = classes;
|
|
26
|
-
const labelStyle = view.
|
|
26
|
+
const labelStyle = view.trackLabelsSetting !== 'overlapping' || display.prefersOffset
|
|
27
27
|
? trackLabelOffset
|
|
28
28
|
: trackLabelOverlap;
|
|
29
|
-
return view.
|
|
29
|
+
return view.trackLabelsSetting !== 'hidden' ? (react_1.default.createElement(TrackLabel_1.default, { track: track, className: cx(trackLabel, labelStyle) })) : null;
|
|
30
30
|
});
|
|
31
31
|
exports.default = TrackLabelContainer;
|
|
@@ -71,9 +71,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
71
71
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
72
72
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
73
73
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
74
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
75
74
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
76
75
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
76
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
77
77
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
78
78
|
}, {
|
|
79
79
|
width: number;
|
|
@@ -96,6 +96,12 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
96
96
|
leftOffset: BpOffset | undefined;
|
|
97
97
|
rightOffset: BpOffset | undefined;
|
|
98
98
|
} & {
|
|
99
|
+
/**
|
|
100
|
+
* #getter
|
|
101
|
+
* this is the effective value of the track labels setting, incorporating
|
|
102
|
+
* both the config and view state. use this instead of view.trackLabels
|
|
103
|
+
*/
|
|
104
|
+
readonly trackLabelsSetting: any;
|
|
99
105
|
/**
|
|
100
106
|
* #getter
|
|
101
107
|
*/
|
|
@@ -85,7 +85,7 @@ exports.WIDGET_HEIGHT = 32;
|
|
|
85
85
|
*/
|
|
86
86
|
function stateModelFactory(pluginManager) {
|
|
87
87
|
return mobx_state_tree_1.types
|
|
88
|
-
.compose(models_1.BaseViewModel, mobx_state_tree_1.types.model(
|
|
88
|
+
.compose('LinearGenomeView', models_1.BaseViewModel, mobx_state_tree_1.types.model({
|
|
89
89
|
/**
|
|
90
90
|
* #property
|
|
91
91
|
*/
|
|
@@ -137,12 +137,6 @@ function stateModelFactory(pluginManager) {
|
|
|
137
137
|
* #property
|
|
138
138
|
*/
|
|
139
139
|
trackSelectorType: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.enumeration(['hierarchical']), 'hierarchical'),
|
|
140
|
-
/**
|
|
141
|
-
* #property
|
|
142
|
-
* how to display the track labels, can be "overlapping", "offset", or
|
|
143
|
-
* "hidden"
|
|
144
|
-
*/
|
|
145
|
-
trackLabels: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, () => (0, util_1.localStorageGetItem)('lgv-trackLabels') || 'overlapping'),
|
|
146
140
|
/**
|
|
147
141
|
* #property
|
|
148
142
|
* show the "center line"
|
|
@@ -153,6 +147,15 @@ function stateModelFactory(pluginManager) {
|
|
|
153
147
|
* show the "cytobands" in the overview scale bar
|
|
154
148
|
*/
|
|
155
149
|
showCytobandsSetting: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, () => Boolean(JSON.parse((0, util_1.localStorageGetItem)('lgv-showCytobands') || 'true'))),
|
|
150
|
+
/**
|
|
151
|
+
* #property
|
|
152
|
+
* how to display the track labels, can be "overlapping", "offset", or
|
|
153
|
+
* "hidden", or empty string "" (which results in conf being used). see
|
|
154
|
+
* LinearGenomeViewPlugin
|
|
155
|
+
* https://jbrowse.org/jb2/docs/config/lineargenomeviewplugin/ docs for
|
|
156
|
+
* how conf is used
|
|
157
|
+
*/
|
|
158
|
+
trackLabels: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, () => (0, util_1.localStorageGetItem)('lgv-trackLabels') || ''),
|
|
156
159
|
/**
|
|
157
160
|
* #property
|
|
158
161
|
* show the "gridlines" in the track area
|
|
@@ -175,6 +178,18 @@ function stateModelFactory(pluginManager) {
|
|
|
175
178
|
rightOffset: undefined,
|
|
176
179
|
}))
|
|
177
180
|
.views(self => ({
|
|
181
|
+
/**
|
|
182
|
+
* #getter
|
|
183
|
+
* this is the effective value of the track labels setting, incorporating
|
|
184
|
+
* both the config and view state. use this instead of view.trackLabels
|
|
185
|
+
*/
|
|
186
|
+
get trackLabelsSetting() {
|
|
187
|
+
const sessionSetting = (0, configuration_1.getConf)((0, util_1.getSession)(self), [
|
|
188
|
+
'LinearGenomeViewPlugin',
|
|
189
|
+
'trackLabels',
|
|
190
|
+
]);
|
|
191
|
+
return self.trackLabels || sessionSetting;
|
|
192
|
+
},
|
|
178
193
|
/**
|
|
179
194
|
* #getter
|
|
180
195
|
*/
|
|
@@ -615,6 +630,7 @@ function stateModelFactory(pluginManager) {
|
|
|
615
630
|
* #action
|
|
616
631
|
*/
|
|
617
632
|
setTrackLabels(setting) {
|
|
633
|
+
localStorage.setItem('lgv-trackLabels', setting);
|
|
618
634
|
self.trackLabels = setting;
|
|
619
635
|
},
|
|
620
636
|
/**
|
|
@@ -945,21 +961,21 @@ function stateModelFactory(pluginManager) {
|
|
|
945
961
|
label: 'Overlapping',
|
|
946
962
|
icon: Visibility_1.default,
|
|
947
963
|
type: 'radio',
|
|
948
|
-
checked: self.
|
|
964
|
+
checked: self.trackLabelsSetting === 'overlapping',
|
|
949
965
|
onClick: () => self.setTrackLabels('overlapping'),
|
|
950
966
|
},
|
|
951
967
|
{
|
|
952
968
|
label: 'Offset',
|
|
953
969
|
icon: Visibility_1.default,
|
|
954
970
|
type: 'radio',
|
|
955
|
-
checked: self.
|
|
971
|
+
checked: self.trackLabelsSetting === 'offset',
|
|
956
972
|
onClick: () => self.setTrackLabels('offset'),
|
|
957
973
|
},
|
|
958
974
|
{
|
|
959
975
|
label: 'Hidden',
|
|
960
976
|
icon: Visibility_1.default,
|
|
961
977
|
type: 'radio',
|
|
962
|
-
checked: self.
|
|
978
|
+
checked: self.trackLabelsSetting === 'hidden',
|
|
963
979
|
onClick: () => self.setTrackLabels('hidden'),
|
|
964
980
|
},
|
|
965
981
|
],
|
|
@@ -1050,9 +1066,8 @@ function stateModelFactory(pluginManager) {
|
|
|
1050
1066
|
}, { delay: 150 }));
|
|
1051
1067
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
1052
1068
|
const s = (s) => JSON.stringify(s);
|
|
1053
|
-
const {
|
|
1069
|
+
const { showCytobandsSetting, showCenterLine } = self;
|
|
1054
1070
|
if (typeof localStorage !== 'undefined') {
|
|
1055
|
-
localStorage.setItem('lgv-trackLabels', trackLabels);
|
|
1056
1071
|
localStorage.setItem('lgv-showCytobands', s(showCytobandsSetting));
|
|
1057
1072
|
localStorage.setItem('lgv-showCenterLine', s(showCenterLine));
|
|
1058
1073
|
}
|
|
@@ -1264,22 +1279,18 @@ function stateModelFactory(pluginManager) {
|
|
|
1264
1279
|
if (session.focusedViewId === self.id && (e.ctrlKey || e.metaKey)) {
|
|
1265
1280
|
if (e.code === 'ArrowLeft') {
|
|
1266
1281
|
e.preventDefault();
|
|
1267
|
-
// pan left
|
|
1268
1282
|
self.slide(-0.9);
|
|
1269
1283
|
}
|
|
1270
|
-
if (e.code === 'ArrowRight') {
|
|
1284
|
+
else if (e.code === 'ArrowRight') {
|
|
1271
1285
|
e.preventDefault();
|
|
1272
|
-
// pan right
|
|
1273
1286
|
self.slide(0.9);
|
|
1274
1287
|
}
|
|
1275
|
-
if (e.code === 'ArrowUp' && self.scaleFactor === 1) {
|
|
1288
|
+
else if (e.code === 'ArrowUp' && self.scaleFactor === 1) {
|
|
1276
1289
|
e.preventDefault();
|
|
1277
|
-
// zoom in
|
|
1278
1290
|
self.zoom(self.bpPerPx / 2);
|
|
1279
1291
|
}
|
|
1280
|
-
if (e.code === 'ArrowDown' && self.scaleFactor === 1) {
|
|
1292
|
+
else if (e.code === 'ArrowDown' && self.scaleFactor === 1) {
|
|
1281
1293
|
e.preventDefault();
|
|
1282
|
-
// zoom out
|
|
1283
1294
|
self.zoom(self.bpPerPx * 2);
|
|
1284
1295
|
}
|
|
1285
1296
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -198,7 +198,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
198
198
|
resizeHeight(distance: number): number;
|
|
199
199
|
} & {
|
|
200
200
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
201
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
201
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
202
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
203
|
+
*/
|
|
202
204
|
currStatsBpPerPx: number;
|
|
203
205
|
} & {
|
|
204
206
|
readonly currentBytesRequested: number;
|
|
@@ -401,7 +403,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
401
403
|
resizeHeight(distance: number): number;
|
|
402
404
|
} & {
|
|
403
405
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
404
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
406
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
407
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
408
|
+
*/
|
|
405
409
|
currStatsBpPerPx: number;
|
|
406
410
|
} & {
|
|
407
411
|
readonly currentBytesRequested: number;
|
|
@@ -694,7 +698,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
694
698
|
resizeHeight(distance: number): number;
|
|
695
699
|
} & {
|
|
696
700
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
697
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
701
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
702
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
703
|
+
*/
|
|
698
704
|
currStatsBpPerPx: number;
|
|
699
705
|
} & {
|
|
700
706
|
readonly currentBytesRequested: number;
|
|
@@ -894,9 +900,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
894
900
|
hideHeaderOverview: boolean;
|
|
895
901
|
hideNoTracksActive: boolean;
|
|
896
902
|
trackSelectorType: string;
|
|
897
|
-
trackLabels: string;
|
|
898
903
|
showCenterLine: boolean;
|
|
899
904
|
showCytobandsSetting: boolean;
|
|
905
|
+
trackLabels: string;
|
|
900
906
|
showGridlines: boolean;
|
|
901
907
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
902
908
|
width: number;
|
|
@@ -905,7 +911,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
905
911
|
} & {
|
|
906
912
|
setDisplayName(name: string): void;
|
|
907
913
|
setWidth(newWidth: number): void;
|
|
908
|
-
setMinimized(flag: boolean): void;
|
|
914
|
+
setMinimized(flag: boolean): void; /**
|
|
915
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
916
|
+
*/
|
|
909
917
|
} & {
|
|
910
918
|
volatileWidth: number | undefined;
|
|
911
919
|
minimumBlockWidth: number;
|
|
@@ -919,6 +927,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
919
927
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
920
928
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
921
929
|
} & {
|
|
930
|
+
readonly trackLabelsSetting: any;
|
|
922
931
|
readonly width: number;
|
|
923
932
|
readonly interRegionPaddingWidth: number;
|
|
924
933
|
readonly assemblyNames: string[];
|
|
@@ -1082,9 +1091,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1082
1091
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1083
1092
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1084
1093
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1085
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1086
1094
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1087
1095
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1096
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1088
1097
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1089
1098
|
}, {
|
|
1090
1099
|
width: number;
|
|
@@ -1093,7 +1102,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1093
1102
|
} & {
|
|
1094
1103
|
setDisplayName(name: string): void;
|
|
1095
1104
|
setWidth(newWidth: number): void;
|
|
1096
|
-
setMinimized(flag: boolean): void;
|
|
1105
|
+
setMinimized(flag: boolean): void; /**
|
|
1106
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1107
|
+
*/
|
|
1097
1108
|
} & {
|
|
1098
1109
|
volatileWidth: number | undefined;
|
|
1099
1110
|
minimumBlockWidth: number;
|
|
@@ -1107,6 +1118,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1107
1118
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1108
1119
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1109
1120
|
} & {
|
|
1121
|
+
readonly trackLabelsSetting: any;
|
|
1110
1122
|
readonly width: number;
|
|
1111
1123
|
readonly interRegionPaddingWidth: number;
|
|
1112
1124
|
readonly assemblyNames: string[];
|
|
@@ -1280,9 +1292,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1280
1292
|
hideHeaderOverview: boolean;
|
|
1281
1293
|
hideNoTracksActive: boolean;
|
|
1282
1294
|
trackSelectorType: string;
|
|
1283
|
-
trackLabels: string;
|
|
1284
1295
|
showCenterLine: boolean;
|
|
1285
1296
|
showCytobandsSetting: boolean;
|
|
1297
|
+
trackLabels: string;
|
|
1286
1298
|
showGridlines: boolean;
|
|
1287
1299
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
1288
1300
|
width: number;
|
|
@@ -1291,7 +1303,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1291
1303
|
} & {
|
|
1292
1304
|
setDisplayName(name: string): void;
|
|
1293
1305
|
setWidth(newWidth: number): void;
|
|
1294
|
-
setMinimized(flag: boolean): void;
|
|
1306
|
+
setMinimized(flag: boolean): void; /**
|
|
1307
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1308
|
+
*/
|
|
1295
1309
|
} & {
|
|
1296
1310
|
volatileWidth: number | undefined;
|
|
1297
1311
|
minimumBlockWidth: number;
|
|
@@ -1305,6 +1319,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1305
1319
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1306
1320
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1307
1321
|
} & {
|
|
1322
|
+
readonly trackLabelsSetting: any;
|
|
1308
1323
|
readonly width: number;
|
|
1309
1324
|
readonly interRegionPaddingWidth: number;
|
|
1310
1325
|
readonly assemblyNames: string[];
|
|
@@ -1468,9 +1483,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1468
1483
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1469
1484
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1470
1485
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1471
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1472
1486
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1473
1487
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1488
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1474
1489
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1475
1490
|
}, {
|
|
1476
1491
|
width: number;
|
|
@@ -1479,7 +1494,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1479
1494
|
} & {
|
|
1480
1495
|
setDisplayName(name: string): void;
|
|
1481
1496
|
setWidth(newWidth: number): void;
|
|
1482
|
-
setMinimized(flag: boolean): void;
|
|
1497
|
+
setMinimized(flag: boolean): void; /**
|
|
1498
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1499
|
+
*/
|
|
1483
1500
|
} & {
|
|
1484
1501
|
volatileWidth: number | undefined;
|
|
1485
1502
|
minimumBlockWidth: number;
|
|
@@ -1493,6 +1510,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1493
1510
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1494
1511
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1495
1512
|
} & {
|
|
1513
|
+
readonly trackLabelsSetting: any;
|
|
1496
1514
|
readonly width: number;
|
|
1497
1515
|
readonly interRegionPaddingWidth: number;
|
|
1498
1516
|
readonly assemblyNames: string[];
|
|
@@ -1666,9 +1684,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1666
1684
|
hideHeaderOverview: boolean;
|
|
1667
1685
|
hideNoTracksActive: boolean;
|
|
1668
1686
|
trackSelectorType: string;
|
|
1669
|
-
trackLabels: string;
|
|
1670
1687
|
showCenterLine: boolean;
|
|
1671
1688
|
showCytobandsSetting: boolean;
|
|
1689
|
+
trackLabels: string;
|
|
1672
1690
|
showGridlines: boolean;
|
|
1673
1691
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
1674
1692
|
width: number;
|
|
@@ -1677,7 +1695,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1677
1695
|
} & {
|
|
1678
1696
|
setDisplayName(name: string): void;
|
|
1679
1697
|
setWidth(newWidth: number): void;
|
|
1680
|
-
setMinimized(flag: boolean): void;
|
|
1698
|
+
setMinimized(flag: boolean): void; /**
|
|
1699
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1700
|
+
*/
|
|
1681
1701
|
} & {
|
|
1682
1702
|
volatileWidth: number | undefined;
|
|
1683
1703
|
minimumBlockWidth: number;
|
|
@@ -1691,6 +1711,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1691
1711
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1692
1712
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1693
1713
|
} & {
|
|
1714
|
+
readonly trackLabelsSetting: any;
|
|
1694
1715
|
readonly width: number;
|
|
1695
1716
|
readonly interRegionPaddingWidth: number;
|
|
1696
1717
|
readonly assemblyNames: string[];
|
|
@@ -1854,9 +1875,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1854
1875
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1855
1876
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1856
1877
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1857
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1858
1878
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1859
1879
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1880
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1860
1881
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1861
1882
|
}, {
|
|
1862
1883
|
width: number;
|
|
@@ -1865,7 +1886,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1865
1886
|
} & {
|
|
1866
1887
|
setDisplayName(name: string): void;
|
|
1867
1888
|
setWidth(newWidth: number): void;
|
|
1868
|
-
setMinimized(flag: boolean): void;
|
|
1889
|
+
setMinimized(flag: boolean): void; /**
|
|
1890
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1891
|
+
*/
|
|
1869
1892
|
} & {
|
|
1870
1893
|
volatileWidth: number | undefined;
|
|
1871
1894
|
minimumBlockWidth: number;
|
|
@@ -1879,6 +1902,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1879
1902
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1880
1903
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1881
1904
|
} & {
|
|
1905
|
+
readonly trackLabelsSetting: any;
|
|
1882
1906
|
readonly width: number;
|
|
1883
1907
|
readonly interRegionPaddingWidth: number;
|
|
1884
1908
|
readonly assemblyNames: string[];
|
|
@@ -2021,6 +2045,19 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
2021
2045
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
2022
2046
|
}) => import("react").JSX.Element;
|
|
2023
2047
|
};
|
|
2048
|
+
/**
|
|
2049
|
+
* #config LinearGenomeViewConfigSchema
|
|
2050
|
+
*/
|
|
2051
|
+
configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2052
|
+
/**
|
|
2053
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
2054
|
+
*/
|
|
2055
|
+
trackLabels: {
|
|
2056
|
+
type: string;
|
|
2057
|
+
defaultValue: string;
|
|
2058
|
+
model: import("mobx-state-tree").ISimpleType<string>;
|
|
2059
|
+
};
|
|
2060
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
2024
2061
|
install(pluginManager: PluginManager): void;
|
|
2025
2062
|
configure(pluginManager: PluginManager): void;
|
|
2026
2063
|
}
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,8 @@ const LinearBasicDisplay_1 = __importDefault(require("./LinearBasicDisplay"));
|
|
|
39
39
|
const FeatureTrack_1 = __importDefault(require("./FeatureTrack"));
|
|
40
40
|
const BasicTrack_1 = __importDefault(require("./BasicTrack"));
|
|
41
41
|
const LaunchLinearGenomeView_1 = __importDefault(require("./LaunchLinearGenomeView"));
|
|
42
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
43
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
44
|
class LinearGenomeViewPlugin extends Plugin_1.default {
|
|
43
45
|
constructor() {
|
|
44
46
|
super(...arguments);
|
|
@@ -51,6 +53,23 @@ class LinearGenomeViewPlugin extends Plugin_1.default {
|
|
|
51
53
|
ZoomControls: LinearGenomeView_1.ZoomControls,
|
|
52
54
|
LinearGenomeView: LinearGenomeView_1.LinearGenomeView,
|
|
53
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* #config LinearGenomeViewConfigSchema
|
|
58
|
+
*/
|
|
59
|
+
this.configurationSchema = (0, configuration_1.ConfigurationSchema)('LinearGenomeViewConfigSchema', {
|
|
60
|
+
/**
|
|
61
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
62
|
+
*/
|
|
63
|
+
trackLabels: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
defaultValue: 'overlapping',
|
|
66
|
+
model: mobx_state_tree_1.types.enumeration('trackLabelOptions', [
|
|
67
|
+
'offset',
|
|
68
|
+
'overlapping',
|
|
69
|
+
'hidden',
|
|
70
|
+
]),
|
|
71
|
+
},
|
|
72
|
+
});
|
|
54
73
|
}
|
|
55
74
|
install(pluginManager) {
|
|
56
75
|
(0, FeatureTrack_1.default)(pluginManager);
|
|
@@ -28,7 +28,8 @@ const TooltipContents = React.forwardRef(function TooltipContents2({ message },
|
|
|
28
28
|
return (React.createElement("div", { ref: ref }, React.isValidElement(message) ? (message) : message ? (React.createElement(SanitizedHTML, { html: String(message) })) : null));
|
|
29
29
|
});
|
|
30
30
|
const Tooltip = observer(({ model, clientMouseCoord, }) => {
|
|
31
|
-
|
|
31
|
+
var _a, _b;
|
|
32
|
+
const { theme, classes } = useStyles();
|
|
32
33
|
const { featureUnderMouse } = model;
|
|
33
34
|
const [width, setWidth] = useState(0);
|
|
34
35
|
const [popperElt, setPopperElt] = useState(null);
|
|
@@ -54,7 +55,8 @@ const Tooltip = observer(({ model, clientMouseCoord, }) => {
|
|
|
54
55
|
const contents = featureUnderMouse
|
|
55
56
|
? getConf(model, 'mouseover', { feature: featureUnderMouse })
|
|
56
57
|
: undefined;
|
|
57
|
-
|
|
58
|
+
const popperTheme = (_a = theme === null || theme === void 0 ? void 0 : theme.components) === null || _a === void 0 ? void 0 : _a.MuiPopper;
|
|
59
|
+
return featureUnderMouse && contents ? (React.createElement(Portal, { container: (_b = popperTheme === null || popperTheme === void 0 ? void 0 : popperTheme.defaultProps) === null || _b === void 0 ? void 0 : _b.container },
|
|
58
60
|
React.createElement("div", { ref: setPopperElt, className: classes.tooltip,
|
|
59
61
|
// zIndex needed to go over widget drawer
|
|
60
62
|
style: { ...styles.popper, zIndex: 100000 }, ...attributes.popper },
|
|
@@ -2,12 +2,12 @@ import React, { lazy, useEffect, useRef } from 'react';
|
|
|
2
2
|
import { Button, Paper, Typography } from '@mui/material';
|
|
3
3
|
import { makeStyles } from 'tss-react/mui';
|
|
4
4
|
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
5
|
+
import { getSession } from '@jbrowse/core/util';
|
|
5
6
|
import { observer } from 'mobx-react';
|
|
6
7
|
// icons
|
|
7
8
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
|
|
8
9
|
import TrackContainer from './TrackContainer';
|
|
9
10
|
import TracksContainer from './TracksContainer';
|
|
10
|
-
import { getSession } from '@jbrowse/core/util';
|
|
11
11
|
const ImportForm = lazy(() => import('./ImportForm'));
|
|
12
12
|
const useStyles = makeStyles()(theme => ({
|
|
13
13
|
note: {
|
|
@@ -15,14 +15,28 @@ const useStyles = makeStyles()(theme => ({
|
|
|
15
15
|
paddingTop: theme.spacing(1),
|
|
16
16
|
paddingBottom: theme.spacing(1),
|
|
17
17
|
},
|
|
18
|
+
rel: {
|
|
19
|
+
position: 'relative',
|
|
20
|
+
},
|
|
21
|
+
top: {
|
|
22
|
+
zIndex: 1000,
|
|
23
|
+
},
|
|
18
24
|
}));
|
|
25
|
+
function NoTracksActive({ model }) {
|
|
26
|
+
const { classes } = useStyles();
|
|
27
|
+
const { hideNoTracksActive } = model;
|
|
28
|
+
return (React.createElement(Paper, { className: classes.note }, !hideNoTracksActive ? (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement(Typography, null, "No tracks active."),
|
|
30
|
+
React.createElement(Button, { variant: "contained", color: "primary", onClick: () => model.activateTrackSelector(), className: classes.top, startIcon: React.createElement(TrackSelectorIcon, null) }, "Open track selector"))) : (React.createElement("div", { style: { height: '48px' } }))));
|
|
31
|
+
}
|
|
19
32
|
const LinearGenomeView = observer(({ model }) => {
|
|
20
33
|
const { tracks, error, initialized, hasDisplayedRegions } = model;
|
|
21
|
-
const { classes } = useStyles();
|
|
22
34
|
const ref = useRef(null);
|
|
23
35
|
const session = getSession(model);
|
|
36
|
+
const { classes } = useStyles();
|
|
24
37
|
useEffect(() => {
|
|
25
|
-
// sets the focused view id based on a click within the LGV;
|
|
38
|
+
// sets the focused view id based on a click within the LGV;
|
|
39
|
+
// necessary for subviews to be focused properly
|
|
26
40
|
function handleSelectView(e) {
|
|
27
41
|
var _a, _b;
|
|
28
42
|
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))) {
|
|
@@ -44,11 +58,19 @@ const LinearGenomeView = observer(({ model }) => {
|
|
|
44
58
|
}
|
|
45
59
|
const MiniControlsComponent = model.MiniControlsComponent();
|
|
46
60
|
const HeaderComponent = model.HeaderComponent();
|
|
47
|
-
return (React.createElement("div", {
|
|
61
|
+
return (React.createElement("div", { className: classes.rel, ref: ref, onMouseLeave: () => session.setHovered(undefined), onMouseMove: event => {
|
|
62
|
+
const c = ref.current;
|
|
63
|
+
if (!c) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const { tracks } = model;
|
|
67
|
+
const leftPx = event.clientX - c.getBoundingClientRect().left;
|
|
68
|
+
const hoverPosition = model.pxToBp(leftPx);
|
|
69
|
+
const hoverFeature = tracks.find(t => t.displays[0].featureUnderMouse);
|
|
70
|
+
session.setHovered({ hoverPosition, hoverFeature });
|
|
71
|
+
} },
|
|
48
72
|
React.createElement(HeaderComponent, { model: model }),
|
|
49
73
|
React.createElement(MiniControlsComponent, { model: model }),
|
|
50
|
-
React.createElement(TracksContainer, { model: model }, !tracks.length ? (React.createElement(
|
|
51
|
-
React.createElement(Typography, null, "No tracks active."),
|
|
52
|
-
React.createElement(Button, { variant: "contained", color: "primary", onClick: model.activateTrackSelector, style: { zIndex: 1000 }, startIcon: React.createElement(TrackSelectorIcon, null) }, "Open track selector"))) : (React.createElement("div", { style: { height: '48px' } })))) : (tracks.map(track => (React.createElement(TrackContainer, { key: track.id, model: model, track: track })))))));
|
|
74
|
+
React.createElement(TracksContainer, { model: model }, !tracks.length ? (React.createElement(NoTracksActive, { model: model })) : (tracks.map(track => (React.createElement(TrackContainer, { key: track.id, model: model, track: track })))))));
|
|
53
75
|
});
|
|
54
76
|
export default LinearGenomeView;
|
|
@@ -18,6 +18,9 @@ const useStyles = makeStyles()({
|
|
|
18
18
|
position: 'absolute',
|
|
19
19
|
zIndex: 10,
|
|
20
20
|
},
|
|
21
|
+
rel: {
|
|
22
|
+
position: 'relative',
|
|
23
|
+
},
|
|
21
24
|
});
|
|
22
25
|
const HoverTooltip = observer(function ({ model, open, guideX, overview, }) {
|
|
23
26
|
var _a;
|
|
@@ -103,7 +106,7 @@ const OverviewRubberband = observer(function OverviewRubberband({ model, overvie
|
|
|
103
106
|
setGuideX(undefined);
|
|
104
107
|
}
|
|
105
108
|
if (startX === undefined) {
|
|
106
|
-
return (React.createElement("div", {
|
|
109
|
+
return (React.createElement("div", { className: classes.rel },
|
|
107
110
|
guideX !== undefined ? (React.createElement(HoverTooltip, { model: model, open: !mouseDragging, overview: overview, guideX: guideX })) : null,
|
|
108
111
|
React.createElement("div", { className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
109
112
|
}
|
|
@@ -124,7 +127,7 @@ const OverviewRubberband = observer(function OverviewRubberband({ model, overvie
|
|
|
124
127
|
[leftBpOffset, rightBpOffset] = [rightBpOffset, leftBpOffset];
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
|
-
return (React.createElement("div", {
|
|
130
|
+
return (React.createElement("div", { className: classes.rel },
|
|
128
131
|
leftBpOffset && rightBpOffset ? (React.createElement(RubberbandSpan, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, width: Math.abs(width), left: left })) : null,
|
|
129
132
|
React.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
130
133
|
});
|
|
@@ -18,9 +18,9 @@ const TrackLabelContainer = observer(function ({ track, view, }) {
|
|
|
18
18
|
const { classes, cx } = useStyles();
|
|
19
19
|
const display = track.displays[0];
|
|
20
20
|
const { trackLabel, trackLabelOverlap, trackLabelOffset } = classes;
|
|
21
|
-
const labelStyle = view.
|
|
21
|
+
const labelStyle = view.trackLabelsSetting !== 'overlapping' || display.prefersOffset
|
|
22
22
|
? trackLabelOffset
|
|
23
23
|
: trackLabelOverlap;
|
|
24
|
-
return view.
|
|
24
|
+
return view.trackLabelsSetting !== 'hidden' ? (React.createElement(TrackLabel, { track: track, className: cx(trackLabel, labelStyle) })) : null;
|
|
25
25
|
});
|
|
26
26
|
export default TrackLabelContainer;
|
|
@@ -71,9 +71,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
71
71
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
72
72
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
73
73
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
74
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
75
74
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
76
75
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
76
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
77
77
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
78
78
|
}, {
|
|
79
79
|
width: number;
|
|
@@ -96,6 +96,12 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
96
96
|
leftOffset: BpOffset | undefined;
|
|
97
97
|
rightOffset: BpOffset | undefined;
|
|
98
98
|
} & {
|
|
99
|
+
/**
|
|
100
|
+
* #getter
|
|
101
|
+
* this is the effective value of the track labels setting, incorporating
|
|
102
|
+
* both the config and view state. use this instead of view.trackLabels
|
|
103
|
+
*/
|
|
104
|
+
readonly trackLabelsSetting: any;
|
|
99
105
|
/**
|
|
100
106
|
* #getter
|
|
101
107
|
*/
|
|
@@ -56,7 +56,7 @@ export const WIDGET_HEIGHT = 32;
|
|
|
56
56
|
*/
|
|
57
57
|
export function stateModelFactory(pluginManager) {
|
|
58
58
|
return types
|
|
59
|
-
.compose(BaseViewModel, types.model(
|
|
59
|
+
.compose('LinearGenomeView', BaseViewModel, types.model({
|
|
60
60
|
/**
|
|
61
61
|
* #property
|
|
62
62
|
*/
|
|
@@ -108,12 +108,6 @@ export function stateModelFactory(pluginManager) {
|
|
|
108
108
|
* #property
|
|
109
109
|
*/
|
|
110
110
|
trackSelectorType: types.optional(types.enumeration(['hierarchical']), 'hierarchical'),
|
|
111
|
-
/**
|
|
112
|
-
* #property
|
|
113
|
-
* how to display the track labels, can be "overlapping", "offset", or
|
|
114
|
-
* "hidden"
|
|
115
|
-
*/
|
|
116
|
-
trackLabels: types.optional(types.string, () => localStorageGetItem('lgv-trackLabels') || 'overlapping'),
|
|
117
111
|
/**
|
|
118
112
|
* #property
|
|
119
113
|
* show the "center line"
|
|
@@ -124,6 +118,15 @@ export function stateModelFactory(pluginManager) {
|
|
|
124
118
|
* show the "cytobands" in the overview scale bar
|
|
125
119
|
*/
|
|
126
120
|
showCytobandsSetting: types.optional(types.boolean, () => Boolean(JSON.parse(localStorageGetItem('lgv-showCytobands') || 'true'))),
|
|
121
|
+
/**
|
|
122
|
+
* #property
|
|
123
|
+
* how to display the track labels, can be "overlapping", "offset", or
|
|
124
|
+
* "hidden", or empty string "" (which results in conf being used). see
|
|
125
|
+
* LinearGenomeViewPlugin
|
|
126
|
+
* https://jbrowse.org/jb2/docs/config/lineargenomeviewplugin/ docs for
|
|
127
|
+
* how conf is used
|
|
128
|
+
*/
|
|
129
|
+
trackLabels: types.optional(types.string, () => localStorageGetItem('lgv-trackLabels') || ''),
|
|
127
130
|
/**
|
|
128
131
|
* #property
|
|
129
132
|
* show the "gridlines" in the track area
|
|
@@ -146,6 +149,18 @@ export function stateModelFactory(pluginManager) {
|
|
|
146
149
|
rightOffset: undefined,
|
|
147
150
|
}))
|
|
148
151
|
.views(self => ({
|
|
152
|
+
/**
|
|
153
|
+
* #getter
|
|
154
|
+
* this is the effective value of the track labels setting, incorporating
|
|
155
|
+
* both the config and view state. use this instead of view.trackLabels
|
|
156
|
+
*/
|
|
157
|
+
get trackLabelsSetting() {
|
|
158
|
+
const sessionSetting = getConf(getSession(self), [
|
|
159
|
+
'LinearGenomeViewPlugin',
|
|
160
|
+
'trackLabels',
|
|
161
|
+
]);
|
|
162
|
+
return self.trackLabels || sessionSetting;
|
|
163
|
+
},
|
|
149
164
|
/**
|
|
150
165
|
* #getter
|
|
151
166
|
*/
|
|
@@ -586,6 +601,7 @@ export function stateModelFactory(pluginManager) {
|
|
|
586
601
|
* #action
|
|
587
602
|
*/
|
|
588
603
|
setTrackLabels(setting) {
|
|
604
|
+
localStorage.setItem('lgv-trackLabels', setting);
|
|
589
605
|
self.trackLabels = setting;
|
|
590
606
|
},
|
|
591
607
|
/**
|
|
@@ -916,21 +932,21 @@ export function stateModelFactory(pluginManager) {
|
|
|
916
932
|
label: 'Overlapping',
|
|
917
933
|
icon: VisibilityIcon,
|
|
918
934
|
type: 'radio',
|
|
919
|
-
checked: self.
|
|
935
|
+
checked: self.trackLabelsSetting === 'overlapping',
|
|
920
936
|
onClick: () => self.setTrackLabels('overlapping'),
|
|
921
937
|
},
|
|
922
938
|
{
|
|
923
939
|
label: 'Offset',
|
|
924
940
|
icon: VisibilityIcon,
|
|
925
941
|
type: 'radio',
|
|
926
|
-
checked: self.
|
|
942
|
+
checked: self.trackLabelsSetting === 'offset',
|
|
927
943
|
onClick: () => self.setTrackLabels('offset'),
|
|
928
944
|
},
|
|
929
945
|
{
|
|
930
946
|
label: 'Hidden',
|
|
931
947
|
icon: VisibilityIcon,
|
|
932
948
|
type: 'radio',
|
|
933
|
-
checked: self.
|
|
949
|
+
checked: self.trackLabelsSetting === 'hidden',
|
|
934
950
|
onClick: () => self.setTrackLabels('hidden'),
|
|
935
951
|
},
|
|
936
952
|
],
|
|
@@ -1021,9 +1037,8 @@ export function stateModelFactory(pluginManager) {
|
|
|
1021
1037
|
}, { delay: 150 }));
|
|
1022
1038
|
addDisposer(self, autorun(() => {
|
|
1023
1039
|
const s = (s) => JSON.stringify(s);
|
|
1024
|
-
const {
|
|
1040
|
+
const { showCytobandsSetting, showCenterLine } = self;
|
|
1025
1041
|
if (typeof localStorage !== 'undefined') {
|
|
1026
|
-
localStorage.setItem('lgv-trackLabels', trackLabels);
|
|
1027
1042
|
localStorage.setItem('lgv-showCytobands', s(showCytobandsSetting));
|
|
1028
1043
|
localStorage.setItem('lgv-showCenterLine', s(showCenterLine));
|
|
1029
1044
|
}
|
|
@@ -1235,22 +1250,18 @@ export function stateModelFactory(pluginManager) {
|
|
|
1235
1250
|
if (session.focusedViewId === self.id && (e.ctrlKey || e.metaKey)) {
|
|
1236
1251
|
if (e.code === 'ArrowLeft') {
|
|
1237
1252
|
e.preventDefault();
|
|
1238
|
-
// pan left
|
|
1239
1253
|
self.slide(-0.9);
|
|
1240
1254
|
}
|
|
1241
|
-
if (e.code === 'ArrowRight') {
|
|
1255
|
+
else if (e.code === 'ArrowRight') {
|
|
1242
1256
|
e.preventDefault();
|
|
1243
|
-
// pan right
|
|
1244
1257
|
self.slide(0.9);
|
|
1245
1258
|
}
|
|
1246
|
-
if (e.code === 'ArrowUp' && self.scaleFactor === 1) {
|
|
1259
|
+
else if (e.code === 'ArrowUp' && self.scaleFactor === 1) {
|
|
1247
1260
|
e.preventDefault();
|
|
1248
|
-
// zoom in
|
|
1249
1261
|
self.zoom(self.bpPerPx / 2);
|
|
1250
1262
|
}
|
|
1251
|
-
if (e.code === 'ArrowDown' && self.scaleFactor === 1) {
|
|
1263
|
+
else if (e.code === 'ArrowDown' && self.scaleFactor === 1) {
|
|
1252
1264
|
e.preventDefault();
|
|
1253
|
-
// zoom out
|
|
1254
1265
|
self.zoom(self.bpPerPx * 2);
|
|
1255
1266
|
}
|
|
1256
1267
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -198,7 +198,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
198
198
|
resizeHeight(distance: number): number;
|
|
199
199
|
} & {
|
|
200
200
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
201
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
201
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
202
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
203
|
+
*/
|
|
202
204
|
currStatsBpPerPx: number;
|
|
203
205
|
} & {
|
|
204
206
|
readonly currentBytesRequested: number;
|
|
@@ -401,7 +403,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
401
403
|
resizeHeight(distance: number): number;
|
|
402
404
|
} & {
|
|
403
405
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
404
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
406
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
407
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
408
|
+
*/
|
|
405
409
|
currStatsBpPerPx: number;
|
|
406
410
|
} & {
|
|
407
411
|
readonly currentBytesRequested: number;
|
|
@@ -694,7 +698,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
694
698
|
resizeHeight(distance: number): number;
|
|
695
699
|
} & {
|
|
696
700
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
697
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
701
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
702
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
703
|
+
*/
|
|
698
704
|
currStatsBpPerPx: number;
|
|
699
705
|
} & {
|
|
700
706
|
readonly currentBytesRequested: number;
|
|
@@ -894,9 +900,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
894
900
|
hideHeaderOverview: boolean;
|
|
895
901
|
hideNoTracksActive: boolean;
|
|
896
902
|
trackSelectorType: string;
|
|
897
|
-
trackLabels: string;
|
|
898
903
|
showCenterLine: boolean;
|
|
899
904
|
showCytobandsSetting: boolean;
|
|
905
|
+
trackLabels: string;
|
|
900
906
|
showGridlines: boolean;
|
|
901
907
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
902
908
|
width: number;
|
|
@@ -905,7 +911,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
905
911
|
} & {
|
|
906
912
|
setDisplayName(name: string): void;
|
|
907
913
|
setWidth(newWidth: number): void;
|
|
908
|
-
setMinimized(flag: boolean): void;
|
|
914
|
+
setMinimized(flag: boolean): void; /**
|
|
915
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
916
|
+
*/
|
|
909
917
|
} & {
|
|
910
918
|
volatileWidth: number | undefined;
|
|
911
919
|
minimumBlockWidth: number;
|
|
@@ -919,6 +927,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
919
927
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
920
928
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
921
929
|
} & {
|
|
930
|
+
readonly trackLabelsSetting: any;
|
|
922
931
|
readonly width: number;
|
|
923
932
|
readonly interRegionPaddingWidth: number;
|
|
924
933
|
readonly assemblyNames: string[];
|
|
@@ -1082,9 +1091,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1082
1091
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1083
1092
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1084
1093
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1085
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1086
1094
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1087
1095
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1096
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1088
1097
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1089
1098
|
}, {
|
|
1090
1099
|
width: number;
|
|
@@ -1093,7 +1102,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1093
1102
|
} & {
|
|
1094
1103
|
setDisplayName(name: string): void;
|
|
1095
1104
|
setWidth(newWidth: number): void;
|
|
1096
|
-
setMinimized(flag: boolean): void;
|
|
1105
|
+
setMinimized(flag: boolean): void; /**
|
|
1106
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1107
|
+
*/
|
|
1097
1108
|
} & {
|
|
1098
1109
|
volatileWidth: number | undefined;
|
|
1099
1110
|
minimumBlockWidth: number;
|
|
@@ -1107,6 +1118,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1107
1118
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1108
1119
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1109
1120
|
} & {
|
|
1121
|
+
readonly trackLabelsSetting: any;
|
|
1110
1122
|
readonly width: number;
|
|
1111
1123
|
readonly interRegionPaddingWidth: number;
|
|
1112
1124
|
readonly assemblyNames: string[];
|
|
@@ -1280,9 +1292,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1280
1292
|
hideHeaderOverview: boolean;
|
|
1281
1293
|
hideNoTracksActive: boolean;
|
|
1282
1294
|
trackSelectorType: string;
|
|
1283
|
-
trackLabels: string;
|
|
1284
1295
|
showCenterLine: boolean;
|
|
1285
1296
|
showCytobandsSetting: boolean;
|
|
1297
|
+
trackLabels: string;
|
|
1286
1298
|
showGridlines: boolean;
|
|
1287
1299
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
1288
1300
|
width: number;
|
|
@@ -1291,7 +1303,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1291
1303
|
} & {
|
|
1292
1304
|
setDisplayName(name: string): void;
|
|
1293
1305
|
setWidth(newWidth: number): void;
|
|
1294
|
-
setMinimized(flag: boolean): void;
|
|
1306
|
+
setMinimized(flag: boolean): void; /**
|
|
1307
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1308
|
+
*/
|
|
1295
1309
|
} & {
|
|
1296
1310
|
volatileWidth: number | undefined;
|
|
1297
1311
|
minimumBlockWidth: number;
|
|
@@ -1305,6 +1319,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1305
1319
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1306
1320
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1307
1321
|
} & {
|
|
1322
|
+
readonly trackLabelsSetting: any;
|
|
1308
1323
|
readonly width: number;
|
|
1309
1324
|
readonly interRegionPaddingWidth: number;
|
|
1310
1325
|
readonly assemblyNames: string[];
|
|
@@ -1468,9 +1483,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1468
1483
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1469
1484
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1470
1485
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1471
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1472
1486
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1473
1487
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1488
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1474
1489
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1475
1490
|
}, {
|
|
1476
1491
|
width: number;
|
|
@@ -1479,7 +1494,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1479
1494
|
} & {
|
|
1480
1495
|
setDisplayName(name: string): void;
|
|
1481
1496
|
setWidth(newWidth: number): void;
|
|
1482
|
-
setMinimized(flag: boolean): void;
|
|
1497
|
+
setMinimized(flag: boolean): void; /**
|
|
1498
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1499
|
+
*/
|
|
1483
1500
|
} & {
|
|
1484
1501
|
volatileWidth: number | undefined;
|
|
1485
1502
|
minimumBlockWidth: number;
|
|
@@ -1493,6 +1510,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1493
1510
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1494
1511
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1495
1512
|
} & {
|
|
1513
|
+
readonly trackLabelsSetting: any;
|
|
1496
1514
|
readonly width: number;
|
|
1497
1515
|
readonly interRegionPaddingWidth: number;
|
|
1498
1516
|
readonly assemblyNames: string[];
|
|
@@ -1666,9 +1684,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1666
1684
|
hideHeaderOverview: boolean;
|
|
1667
1685
|
hideNoTracksActive: boolean;
|
|
1668
1686
|
trackSelectorType: string;
|
|
1669
|
-
trackLabels: string;
|
|
1670
1687
|
showCenterLine: boolean;
|
|
1671
1688
|
showCytobandsSetting: boolean;
|
|
1689
|
+
trackLabels: string;
|
|
1672
1690
|
showGridlines: boolean;
|
|
1673
1691
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
1674
1692
|
width: number;
|
|
@@ -1677,7 +1695,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1677
1695
|
} & {
|
|
1678
1696
|
setDisplayName(name: string): void;
|
|
1679
1697
|
setWidth(newWidth: number): void;
|
|
1680
|
-
setMinimized(flag: boolean): void;
|
|
1698
|
+
setMinimized(flag: boolean): void; /**
|
|
1699
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1700
|
+
*/
|
|
1681
1701
|
} & {
|
|
1682
1702
|
volatileWidth: number | undefined;
|
|
1683
1703
|
minimumBlockWidth: number;
|
|
@@ -1691,6 +1711,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1691
1711
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1692
1712
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1693
1713
|
} & {
|
|
1714
|
+
readonly trackLabelsSetting: any;
|
|
1694
1715
|
readonly width: number;
|
|
1695
1716
|
readonly interRegionPaddingWidth: number;
|
|
1696
1717
|
readonly assemblyNames: string[];
|
|
@@ -1854,9 +1875,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1854
1875
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1855
1876
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1856
1877
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1857
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1858
1878
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1859
1879
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1880
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1860
1881
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1861
1882
|
}, {
|
|
1862
1883
|
width: number;
|
|
@@ -1865,7 +1886,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1865
1886
|
} & {
|
|
1866
1887
|
setDisplayName(name: string): void;
|
|
1867
1888
|
setWidth(newWidth: number): void;
|
|
1868
|
-
setMinimized(flag: boolean): void;
|
|
1889
|
+
setMinimized(flag: boolean): void; /**
|
|
1890
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1891
|
+
*/
|
|
1869
1892
|
} & {
|
|
1870
1893
|
volatileWidth: number | undefined;
|
|
1871
1894
|
minimumBlockWidth: number;
|
|
@@ -1879,6 +1902,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1879
1902
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1880
1903
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1881
1904
|
} & {
|
|
1905
|
+
readonly trackLabelsSetting: any;
|
|
1882
1906
|
readonly width: number;
|
|
1883
1907
|
readonly interRegionPaddingWidth: number;
|
|
1884
1908
|
readonly assemblyNames: string[];
|
|
@@ -2021,6 +2045,19 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
2021
2045
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
2022
2046
|
}) => import("react").JSX.Element;
|
|
2023
2047
|
};
|
|
2048
|
+
/**
|
|
2049
|
+
* #config LinearGenomeViewConfigSchema
|
|
2050
|
+
*/
|
|
2051
|
+
configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2052
|
+
/**
|
|
2053
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
2054
|
+
*/
|
|
2055
|
+
trackLabels: {
|
|
2056
|
+
type: string;
|
|
2057
|
+
defaultValue: string;
|
|
2058
|
+
model: import("mobx-state-tree").ISimpleType<string>;
|
|
2059
|
+
};
|
|
2060
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
2024
2061
|
install(pluginManager: PluginManager): void;
|
|
2025
2062
|
configure(pluginManager: PluginManager): void;
|
|
2026
2063
|
}
|
package/esm/index.js
CHANGED
|
@@ -10,6 +10,8 @@ import LinearBasicDisplayF from './LinearBasicDisplay';
|
|
|
10
10
|
import FeatureTrackF from './FeatureTrack';
|
|
11
11
|
import BasicTrackF from './BasicTrack';
|
|
12
12
|
import LaunchLinearGenomeViewF from './LaunchLinearGenomeView';
|
|
13
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
14
|
+
import { types } from 'mobx-state-tree';
|
|
13
15
|
export default class LinearGenomeViewPlugin extends Plugin {
|
|
14
16
|
constructor() {
|
|
15
17
|
super(...arguments);
|
|
@@ -22,6 +24,23 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
22
24
|
ZoomControls,
|
|
23
25
|
LinearGenomeView,
|
|
24
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* #config LinearGenomeViewConfigSchema
|
|
29
|
+
*/
|
|
30
|
+
this.configurationSchema = ConfigurationSchema('LinearGenomeViewConfigSchema', {
|
|
31
|
+
/**
|
|
32
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
33
|
+
*/
|
|
34
|
+
trackLabels: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
defaultValue: 'overlapping',
|
|
37
|
+
model: types.enumeration('trackLabelOptions', [
|
|
38
|
+
'offset',
|
|
39
|
+
'overlapping',
|
|
40
|
+
'hidden',
|
|
41
|
+
]),
|
|
42
|
+
},
|
|
43
|
+
});
|
|
25
44
|
}
|
|
26
45
|
install(pluginManager) {
|
|
27
46
|
FeatureTrackF(pluginManager);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-genome-view",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "JBrowse 2 linear genome view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"module": "esm/index.js",
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "9052b295f2d322e729254457ed9fe2231fb22cce"
|
|
69
69
|
}
|