@jbrowse/plugin-dotplot-view 2.15.3 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DotplotView/components/DotplotControls.js +6 -2
- package/dist/DotplotView/components/DotplotTooltipClick.js +1 -1
- package/dist/DotplotView/components/DotplotView.js +1 -1
- package/dist/DotplotView/components/PanButtons.js +14 -8
- package/dist/DotplotView/model.d.ts +3 -3
- package/dist/DotplotView/model.js +3 -3
- package/esm/DotplotView/components/DotplotControls.js +6 -2
- package/esm/DotplotView/components/DotplotTooltipClick.js +1 -1
- package/esm/DotplotView/components/DotplotView.js +1 -1
- package/esm/DotplotView/components/PanButtons.js +14 -8
- package/esm/DotplotView/model.d.ts +3 -3
- package/esm/DotplotView/model.js +3 -3
- package/package.json +2 -2
|
@@ -15,9 +15,13 @@ const CursorIcon_1 = require("./CursorIcon");
|
|
|
15
15
|
const Icons_1 = require("@jbrowse/core/ui/Icons");
|
|
16
16
|
const DotplotControls = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
17
17
|
return (react_1.default.createElement("div", null,
|
|
18
|
-
react_1.default.createElement(material_1.IconButton, { onClick:
|
|
18
|
+
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
19
|
+
model.zoomOut();
|
|
20
|
+
} },
|
|
19
21
|
react_1.default.createElement(ZoomOut_1.default, null)),
|
|
20
|
-
react_1.default.createElement(material_1.IconButton, { onClick:
|
|
22
|
+
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
23
|
+
model.zoomIn();
|
|
24
|
+
} },
|
|
21
25
|
react_1.default.createElement(ZoomIn_1.default, null)),
|
|
22
26
|
react_1.default.createElement(material_1.IconButton, { onClick: () => model.activateTrackSelector(), title: "Open track selector" },
|
|
23
27
|
react_1.default.createElement(Icons_1.TrackSelector, null)),
|
|
@@ -12,7 +12,7 @@ exports.DotplotTooltipClick = (0, mobx_react_1.observer)(function ({ model, mous
|
|
|
12
12
|
const { hview, vview, viewHeight } = model;
|
|
13
13
|
const x = ((mousedownClient === null || mousedownClient === void 0 ? void 0 : mousedownClient[0]) || 0) - (xdistance < 0 ? 0 : 0);
|
|
14
14
|
const y = ((mousedownClient === null || mousedownClient === void 0 ? void 0 : mousedownClient[1]) || 0) - (ydistance < 0 ? 0 : 0);
|
|
15
|
-
return mousedown && Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 ? (react_1.default.createElement(BaseTooltip_1.default, { clientPoint: { x, y } },
|
|
15
|
+
return mousedown && Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 ? (react_1.default.createElement(BaseTooltip_1.default, { placement: xdistance < 0 ? 'right' : 'left', clientPoint: { x, y } },
|
|
16
16
|
`x - ${(0, util_1.locstr)(mousedown[0], hview)}`,
|
|
17
17
|
react_1.default.createElement("br", null),
|
|
18
18
|
`y - ${(0, util_1.locstr)(viewHeight - mousedown[1], vview)}`,
|
|
@@ -255,7 +255,7 @@ const DotplotViewInternal = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
255
255
|
label: 'Zoom in',
|
|
256
256
|
onClick: () => {
|
|
257
257
|
if (mousedown && mouseup) {
|
|
258
|
-
model.
|
|
258
|
+
model.zoomInToMouseCoords(mousedown, mouseup);
|
|
259
259
|
}
|
|
260
260
|
// below line is needed to prevent tooltip from sticking
|
|
261
261
|
setMouseOvered(false);
|
|
@@ -33,27 +33,33 @@ const PanButtons = (0, mobx_react_1.observer)(function PanButtons({ model, }) {
|
|
|
33
33
|
const { classes } = useStyles();
|
|
34
34
|
return (react_1.default.createElement(material_1.Paper, { className: classes.dpad, elevation: 6 },
|
|
35
35
|
react_1.default.createElement("div", null),
|
|
36
|
-
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () =>
|
|
36
|
+
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () => {
|
|
37
|
+
model.vview.scroll(100);
|
|
38
|
+
} },
|
|
37
39
|
react_1.default.createElement(ArrowDropUp_1.default, null)),
|
|
38
40
|
react_1.default.createElement("div", null),
|
|
39
|
-
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () =>
|
|
41
|
+
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () => {
|
|
42
|
+
model.hview.scroll(-100);
|
|
43
|
+
} },
|
|
40
44
|
react_1.default.createElement(ArrowLeft_1.default, null)),
|
|
41
45
|
react_1.default.createElement("div", null),
|
|
42
|
-
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () =>
|
|
46
|
+
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () => {
|
|
47
|
+
model.hview.scroll(100);
|
|
48
|
+
} },
|
|
43
49
|
react_1.default.createElement(ArrowRight_1.default, null)),
|
|
44
50
|
react_1.default.createElement("div", null),
|
|
45
|
-
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () =>
|
|
51
|
+
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () => {
|
|
52
|
+
model.vview.scroll(-100);
|
|
53
|
+
} },
|
|
46
54
|
react_1.default.createElement(ArrowDropDown_1.default, null)),
|
|
47
55
|
react_1.default.createElement("div", null),
|
|
48
56
|
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () => {
|
|
49
|
-
model.
|
|
50
|
-
model.vview.zoomIn();
|
|
57
|
+
model.zoomIn();
|
|
51
58
|
} },
|
|
52
59
|
react_1.default.createElement(ZoomIn_1.default, null)),
|
|
53
60
|
react_1.default.createElement("div", null),
|
|
54
61
|
react_1.default.createElement(material_1.IconButton, { className: classes.icon, onClick: () => {
|
|
55
|
-
model.
|
|
56
|
-
model.vview.zoomOut();
|
|
62
|
+
model.zoomOut();
|
|
57
63
|
} },
|
|
58
64
|
react_1.default.createElement(ZoomOut_1.default, null))));
|
|
59
65
|
});
|
|
@@ -452,11 +452,11 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
452
452
|
/**
|
|
453
453
|
* #action
|
|
454
454
|
*/
|
|
455
|
-
|
|
455
|
+
zoomOut(): void;
|
|
456
456
|
/**
|
|
457
457
|
* #action
|
|
458
458
|
*/
|
|
459
|
-
|
|
459
|
+
zoomIn(): void;
|
|
460
460
|
/**
|
|
461
461
|
* #action
|
|
462
462
|
*/
|
|
@@ -499,7 +499,7 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
499
499
|
* #action
|
|
500
500
|
* zooms into clicked and dragged region
|
|
501
501
|
*/
|
|
502
|
-
|
|
502
|
+
zoomInToMouseCoords(mousedown: Coord, mouseup: Coord): void;
|
|
503
503
|
/**
|
|
504
504
|
* #action
|
|
505
505
|
*/
|
|
@@ -308,14 +308,14 @@ function stateModelFactory(pm) {
|
|
|
308
308
|
/**
|
|
309
309
|
* #action
|
|
310
310
|
*/
|
|
311
|
-
|
|
311
|
+
zoomOut() {
|
|
312
312
|
self.hview.zoomOut();
|
|
313
313
|
self.vview.zoomOut();
|
|
314
314
|
},
|
|
315
315
|
/**
|
|
316
316
|
* #action
|
|
317
317
|
*/
|
|
318
|
-
|
|
318
|
+
zoomIn() {
|
|
319
319
|
self.hview.zoomIn();
|
|
320
320
|
self.vview.zoomIn();
|
|
321
321
|
},
|
|
@@ -411,7 +411,7 @@ function stateModelFactory(pm) {
|
|
|
411
411
|
* #action
|
|
412
412
|
* zooms into clicked and dragged region
|
|
413
413
|
*/
|
|
414
|
-
|
|
414
|
+
zoomInToMouseCoords(mousedown, mouseup) {
|
|
415
415
|
const result = this.getCoords(mousedown, mouseup);
|
|
416
416
|
if (result) {
|
|
417
417
|
const [x1, x2, y1, y2] = result;
|
|
@@ -10,9 +10,13 @@ import { CursorMouse, CursorMove } from './CursorIcon';
|
|
|
10
10
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
|
|
11
11
|
const DotplotControls = observer(function ({ model, }) {
|
|
12
12
|
return (React.createElement("div", null,
|
|
13
|
-
React.createElement(IconButton, { onClick:
|
|
13
|
+
React.createElement(IconButton, { onClick: () => {
|
|
14
|
+
model.zoomOut();
|
|
15
|
+
} },
|
|
14
16
|
React.createElement(ZoomOut, null)),
|
|
15
|
-
React.createElement(IconButton, { onClick:
|
|
17
|
+
React.createElement(IconButton, { onClick: () => {
|
|
18
|
+
model.zoomIn();
|
|
19
|
+
} },
|
|
16
20
|
React.createElement(ZoomIn, null)),
|
|
17
21
|
React.createElement(IconButton, { onClick: () => model.activateTrackSelector(), title: "Open track selector" },
|
|
18
22
|
React.createElement(TrackSelectorIcon, null)),
|
|
@@ -6,7 +6,7 @@ export const DotplotTooltipClick = observer(function ({ model, mousedown, moused
|
|
|
6
6
|
const { hview, vview, viewHeight } = model;
|
|
7
7
|
const x = ((mousedownClient === null || mousedownClient === void 0 ? void 0 : mousedownClient[0]) || 0) - (xdistance < 0 ? 0 : 0);
|
|
8
8
|
const y = ((mousedownClient === null || mousedownClient === void 0 ? void 0 : mousedownClient[1]) || 0) - (ydistance < 0 ? 0 : 0);
|
|
9
|
-
return mousedown && Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 ? (React.createElement(BaseTooltip, { clientPoint: { x, y } },
|
|
9
|
+
return mousedown && Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 ? (React.createElement(BaseTooltip, { placement: xdistance < 0 ? 'right' : 'left', clientPoint: { x, y } },
|
|
10
10
|
`x - ${locstr(mousedown[0], hview)}`,
|
|
11
11
|
React.createElement("br", null),
|
|
12
12
|
`y - ${locstr(viewHeight - mousedown[1], vview)}`,
|
|
@@ -227,7 +227,7 @@ const DotplotViewInternal = observer(function ({ model, }) {
|
|
|
227
227
|
label: 'Zoom in',
|
|
228
228
|
onClick: () => {
|
|
229
229
|
if (mousedown && mouseup) {
|
|
230
|
-
model.
|
|
230
|
+
model.zoomInToMouseCoords(mousedown, mouseup);
|
|
231
231
|
}
|
|
232
232
|
// below line is needed to prevent tooltip from sticking
|
|
233
233
|
setMouseOvered(false);
|
|
@@ -28,27 +28,33 @@ const PanButtons = observer(function PanButtons({ model, }) {
|
|
|
28
28
|
const { classes } = useStyles();
|
|
29
29
|
return (React.createElement(Paper, { className: classes.dpad, elevation: 6 },
|
|
30
30
|
React.createElement("div", null),
|
|
31
|
-
React.createElement(IconButton, { className: classes.icon, onClick: () =>
|
|
31
|
+
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
32
|
+
model.vview.scroll(100);
|
|
33
|
+
} },
|
|
32
34
|
React.createElement(ArrowDropUp, null)),
|
|
33
35
|
React.createElement("div", null),
|
|
34
|
-
React.createElement(IconButton, { className: classes.icon, onClick: () =>
|
|
36
|
+
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
37
|
+
model.hview.scroll(-100);
|
|
38
|
+
} },
|
|
35
39
|
React.createElement(ArrowLeft, null)),
|
|
36
40
|
React.createElement("div", null),
|
|
37
|
-
React.createElement(IconButton, { className: classes.icon, onClick: () =>
|
|
41
|
+
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
42
|
+
model.hview.scroll(100);
|
|
43
|
+
} },
|
|
38
44
|
React.createElement(ArrowRight, null)),
|
|
39
45
|
React.createElement("div", null),
|
|
40
|
-
React.createElement(IconButton, { className: classes.icon, onClick: () =>
|
|
46
|
+
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
47
|
+
model.vview.scroll(-100);
|
|
48
|
+
} },
|
|
41
49
|
React.createElement(ArrowDropDown, null)),
|
|
42
50
|
React.createElement("div", null),
|
|
43
51
|
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
44
|
-
model.
|
|
45
|
-
model.vview.zoomIn();
|
|
52
|
+
model.zoomIn();
|
|
46
53
|
} },
|
|
47
54
|
React.createElement(ZoomIn, null)),
|
|
48
55
|
React.createElement("div", null),
|
|
49
56
|
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
50
|
-
model.
|
|
51
|
-
model.vview.zoomOut();
|
|
57
|
+
model.zoomOut();
|
|
52
58
|
} },
|
|
53
59
|
React.createElement(ZoomOut, null))));
|
|
54
60
|
});
|
|
@@ -452,11 +452,11 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
452
452
|
/**
|
|
453
453
|
* #action
|
|
454
454
|
*/
|
|
455
|
-
|
|
455
|
+
zoomOut(): void;
|
|
456
456
|
/**
|
|
457
457
|
* #action
|
|
458
458
|
*/
|
|
459
|
-
|
|
459
|
+
zoomIn(): void;
|
|
460
460
|
/**
|
|
461
461
|
* #action
|
|
462
462
|
*/
|
|
@@ -499,7 +499,7 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
499
499
|
* #action
|
|
500
500
|
* zooms into clicked and dragged region
|
|
501
501
|
*/
|
|
502
|
-
|
|
502
|
+
zoomInToMouseCoords(mousedown: Coord, mouseup: Coord): void;
|
|
503
503
|
/**
|
|
504
504
|
* #action
|
|
505
505
|
*/
|
package/esm/DotplotView/model.js
CHANGED
|
@@ -278,14 +278,14 @@ export default function stateModelFactory(pm) {
|
|
|
278
278
|
/**
|
|
279
279
|
* #action
|
|
280
280
|
*/
|
|
281
|
-
|
|
281
|
+
zoomOut() {
|
|
282
282
|
self.hview.zoomOut();
|
|
283
283
|
self.vview.zoomOut();
|
|
284
284
|
},
|
|
285
285
|
/**
|
|
286
286
|
* #action
|
|
287
287
|
*/
|
|
288
|
-
|
|
288
|
+
zoomIn() {
|
|
289
289
|
self.hview.zoomIn();
|
|
290
290
|
self.vview.zoomIn();
|
|
291
291
|
},
|
|
@@ -381,7 +381,7 @@ export default function stateModelFactory(pm) {
|
|
|
381
381
|
* #action
|
|
382
382
|
* zooms into clicked and dragged region
|
|
383
383
|
*/
|
|
384
|
-
|
|
384
|
+
zoomInToMouseCoords(mousedown, mouseup) {
|
|
385
385
|
const result = this.getCoords(mousedown, mouseup);
|
|
386
386
|
if (result) {
|
|
387
387
|
const [x1, x2, y1, y2] = result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-dotplot-view",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"description": "JBrowse 2 dotplot view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "1e6d4fbc27ce684eed19e3c217f34bd2da24ab75"
|
|
65
65
|
}
|