@jbrowse/plugin-linear-genome-view 5.0.0-beta.2 → 5.0.0-beta.20
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/esm/LinearGenomeView/afterAttach.d.ts +22 -5
- package/esm/LinearGenomeView/afterAttach.js +129 -106
- package/esm/LinearGenomeView/axisConfigSchema.d.ts +18 -0
- package/esm/LinearGenomeView/axisConfigSchema.js +22 -0
- package/esm/LinearGenomeView/components/CenterLine.js +10 -5
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +2 -3
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +3 -5
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +9 -4
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +45 -8
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +2 -2
- package/esm/LinearGenomeView/components/Header.js +11 -1
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +2 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -3
- package/esm/LinearGenomeView/components/HeaderPanControls.js +6 -3
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +4 -1
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +6 -35
- package/esm/LinearGenomeView/components/Highlight.js +27 -11
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +11 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +32 -13
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +3 -3
- package/esm/LinearGenomeView/components/HighlightChip.js +13 -8
- package/esm/LinearGenomeView/components/HighlightLabelDialog.d.ts +6 -0
- package/esm/LinearGenomeView/components/HighlightLabelDialog.js +18 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +3 -3
- package/esm/LinearGenomeView/components/ImportForm.js +7 -9
- package/esm/LinearGenomeView/components/LinearGenomeView.js +5 -12
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +13 -14
- package/esm/LinearGenomeView/components/MiniControls.js +11 -5
- package/esm/LinearGenomeView/components/OverviewHighlight.js +3 -3
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +6 -5
- package/esm/LinearGenomeView/components/OverviewRubberband.js +25 -48
- package/esm/LinearGenomeView/components/OverviewScalebar.js +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +5 -3
- package/esm/LinearGenomeView/components/PaddingBlocks.js +3 -8
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +5 -6
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +3 -2
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +4 -4
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +74 -0
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -2
- package/esm/LinearGenomeView/components/Rubberband.js +3 -2
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -1
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +16 -5
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
- package/esm/LinearGenomeView/components/Scalebar.js +8 -5
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +51 -36
- package/esm/LinearGenomeView/components/SearchBox.js +10 -16
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +3 -2
- package/esm/LinearGenomeView/components/SearchPanelForm.js +4 -2
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +4 -8
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -4
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -7
- package/esm/LinearGenomeView/components/SearchResultsTable.js +25 -53
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +2 -3
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -4
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +3 -2
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +4 -2
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackContainer.js +63 -10
- package/esm/LinearGenomeView/components/TrackLabel.js +14 -4
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +2 -2
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +4 -5
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +11 -14
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +3 -4
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +23 -10
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +6 -4
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +12 -24
- package/esm/LinearGenomeView/components/TracksContainer.js +11 -23
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -2
- package/esm/LinearGenomeView/components/VerticalGuide.js +3 -16
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +1 -2
- package/esm/LinearGenomeView/components/fetchSequence.js +15 -7
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +10 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +0 -3
- package/esm/LinearGenomeView/components/useRangeSelect.js +26 -61
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +3 -1
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +4 -2
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -2
- package/esm/LinearGenomeView/components/useSideScroll.js +156 -102
- package/esm/LinearGenomeView/components/util.d.ts +4 -0
- package/esm/LinearGenomeView/components/util.js +4 -2
- package/esm/LinearGenomeView/consts.d.ts +2 -0
- package/esm/LinearGenomeView/consts.js +3 -1
- package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
- package/esm/LinearGenomeView/containingLgv.js +23 -0
- package/esm/LinearGenomeView/headerFit.d.ts +4 -2
- package/esm/LinearGenomeView/headerFit.js +20 -7
- package/esm/LinearGenomeView/index.d.ts +2 -7
- package/esm/LinearGenomeView/index.js +5 -7
- package/esm/LinearGenomeView/keyboardHandler.d.ts +8 -7
- package/esm/LinearGenomeView/keyboardHandler.js +61 -23
- package/esm/LinearGenomeView/launchKeys.d.ts +1 -1
- package/esm/LinearGenomeView/launchKeys.js +11 -6
- package/esm/LinearGenomeView/lazyDialogs.d.ts +16 -3
- package/esm/LinearGenomeView/lazyDialogs.js +1 -0
- package/esm/LinearGenomeView/linkedViewSync.d.ts +3 -11
- package/esm/LinearGenomeView/linkedViewSync.js +27 -49
- package/esm/LinearGenomeView/menuItems.d.ts +16 -18
- package/esm/LinearGenomeView/menuItems.js +264 -164
- package/esm/LinearGenomeView/model.d.ts +1192 -560
- package/esm/LinearGenomeView/model.js +805 -590
- package/esm/LinearGenomeView/rExport/exportLinearView.d.ts +17 -0
- package/esm/LinearGenomeView/rExport/exportLinearView.js +117 -0
- package/esm/LinearGenomeView/rExport/rScript.d.ts +110 -0
- package/esm/LinearGenomeView/rExport/rScript.js +524 -0
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +1 -1
- package/esm/LinearGenomeView/sharedScaleContainer.js +2 -12
- package/esm/LinearGenomeView/showFiles.d.ts +2 -0
- package/esm/LinearGenomeView/showFiles.js +19 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +1 -1
- package/esm/LinearGenomeView/showRegionsWithUndo.js +13 -5
- package/esm/LinearGenomeView/stickyChrome.d.ts +5 -9
- package/esm/LinearGenomeView/stickyChrome.js +5 -9
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +4 -4
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +4 -1
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +8 -21
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +3 -1
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +9 -9
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +3 -1
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +5 -5
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +13 -18
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +2 -5
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +5 -6
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +9 -10
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +21 -13
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +4 -5
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +7 -6
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +2 -3
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +17 -3
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +24 -20
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +42 -29
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +74 -77
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +28 -12
- package/esm/LinearGenomeView/svgcomponents/util.js +41 -29
- package/esm/LinearGenomeView/types.d.ts +13 -10
- package/esm/LinearGenomeView/types.js +0 -1
- package/esm/LinearGenomeView/util.d.ts +103 -46
- package/esm/LinearGenomeView/util.js +222 -170
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +9 -6
- package/esm/MultiLevelRubberband/index.d.ts +2 -0
- package/esm/MultiLevelRubberband/index.js +2 -0
- package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
- package/esm/MultiLevelRubberband/menuItems.js +52 -0
- package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
- package/esm/MultiLevelRubberband/rowLabel.js +27 -0
- package/esm/MultiLevelRubberband/types.d.ts +1 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +2 -1
- package/esm/MultiLevelRubberband/useRangeSelect.js +45 -59
- package/esm/TrackModifiers/index.d.ts +83 -0
- package/esm/TrackModifiers/index.js +231 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +244 -68
- package/esm/displayKitTests/perRegionTestEnv.js +30 -26
- package/esm/index.d.ts +21 -99
- package/esm/index.js +17 -38
- package/esm/searchUtils.d.ts +26 -10
- package/esm/searchUtils.js +137 -137
- package/esm/shared/RubberbandSpan.d.ts +3 -2
- package/esm/shared/RubberbandSpan.js +6 -3
- package/esm/shared/coordLabels.d.ts +11 -4
- package/esm/shared/coordLabels.js +20 -5
- package/esm/shared/useWindowDrag.d.ts +18 -0
- package/esm/shared/useWindowDrag.js +47 -0
- package/package.json +12 -11
- package/esm/FeatureTrack/configSchema.d.ts +0 -124
- package/esm/FeatureTrack/configSchema.js +0 -54
- package/esm/FeatureTrack/index.d.ts +0 -2
- package/esm/FeatureTrack/index.js +0 -13
- package/esm/LinearGenomeView/initKeys.d.ts +0 -12
- package/esm/LinearGenomeView/initKeys.js +0 -68
- package/esm/MultiLevelRubberband/VerticalGuide.d.ts +0 -6
- package/esm/MultiLevelRubberband/VerticalGuide.js +0 -21
- package/esm/lazyPluginExports.d.ts +0 -23
- package/esm/lazyPluginExports.js +0 -36
|
@@ -1,34 +1,72 @@
|
|
|
1
1
|
import { getSession } from '@jbrowse/core/util';
|
|
2
|
+
import { isTextEntryFocused } from '@jbrowse/core/util/isTextEntryFocused';
|
|
2
3
|
import { addDisposer } from '@jbrowse/mobx-state-tree';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
// every entry also needs Ctrl or Cmd; an arrow fires with or without Shift
|
|
5
|
+
export const lgvKeyboardShortcuts = [
|
|
6
|
+
{
|
|
7
|
+
keys: 'Ctrl/Cmd + ←',
|
|
8
|
+
description: 'Pan left',
|
|
9
|
+
code: 'ArrowLeft',
|
|
10
|
+
run: self => {
|
|
11
|
+
self.slide(-0.9);
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
keys: 'Ctrl/Cmd + →',
|
|
16
|
+
description: 'Pan right',
|
|
17
|
+
code: 'ArrowRight',
|
|
18
|
+
run: self => {
|
|
19
|
+
self.slide(0.9);
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
keys: 'Ctrl/Cmd + ↑',
|
|
24
|
+
description: 'Zoom in',
|
|
25
|
+
code: 'ArrowUp',
|
|
26
|
+
run: self => {
|
|
27
|
+
self.zoom(self.bpPerPx / 2);
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
keys: 'Ctrl/Cmd + ↓',
|
|
32
|
+
description: 'Zoom out',
|
|
33
|
+
code: 'ArrowDown',
|
|
34
|
+
run: self => {
|
|
35
|
+
self.zoom(self.bpPerPx * 2);
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
keys: 'Ctrl/Cmd + Shift + D',
|
|
40
|
+
description: 'Highlight the region in view',
|
|
41
|
+
code: 'KeyD',
|
|
42
|
+
shift: true,
|
|
43
|
+
run: self => {
|
|
44
|
+
self.highlightCurrentRegion();
|
|
45
|
+
getSession(self).notify('Region highlighted.', 'success');
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
keys: 'Ctrl/Cmd + Shift + M',
|
|
50
|
+
description: 'Go to the newest highlight',
|
|
51
|
+
code: 'KeyM',
|
|
52
|
+
shift: true,
|
|
53
|
+
run: self => {
|
|
54
|
+
void self.navigateNewestHighlight();
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
];
|
|
10
58
|
export function setupKeyboardHandler(self) {
|
|
11
59
|
if (typeof document === 'undefined') {
|
|
12
60
|
return;
|
|
13
61
|
}
|
|
14
62
|
function handler(e) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
63
|
+
if (getSession(self).focusedViewId === self.id &&
|
|
64
|
+
(e.ctrlKey || e.metaKey) &&
|
|
65
|
+
!isTextEntryFocused()) {
|
|
66
|
+
const shortcut = lgvKeyboardShortcuts.find(s => s.code === e.code && (!s.shift || e.shiftKey));
|
|
67
|
+
if (shortcut) {
|
|
18
68
|
e.preventDefault();
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
else if (e.code === 'ArrowRight') {
|
|
22
|
-
e.preventDefault();
|
|
23
|
-
self.slide(0.9);
|
|
24
|
-
}
|
|
25
|
-
else if (e.code === 'ArrowUp') {
|
|
26
|
-
e.preventDefault();
|
|
27
|
-
self.zoom(self.bpPerPx / 2);
|
|
28
|
-
}
|
|
29
|
-
else if (e.code === 'ArrowDown') {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
self.zoom(self.bpPerPx * 2);
|
|
69
|
+
shortcut.run(self);
|
|
32
70
|
}
|
|
33
71
|
}
|
|
34
72
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { InitState } from './types.ts';
|
|
2
|
-
export declare const lgvLaunchKeys: import("@jbrowse/core/util/withLaunchInput").LaunchKeyRegistration<InitState, "bpPerPx" | "offsetPx">;
|
|
2
|
+
export declare const lgvLaunchKeys: import("@jbrowse/core/util/withLaunchInput").LaunchKeyRegistration<InitState, "bpPerPx" | "colorByCDS" | "offsetPx" | "showCytobandsSetting">;
|
|
@@ -3,10 +3,12 @@ import { defineLaunchKeys } from '@jbrowse/core/util/withLaunchInput';
|
|
|
3
3
|
// view interprets and nobody registered here is a compile error rather than a
|
|
4
4
|
// key that partitions as a typo.
|
|
5
5
|
//
|
|
6
|
-
// `bpPerPx`/`offsetPx` are
|
|
7
|
-
// window
|
|
8
|
-
//
|
|
9
|
-
//
|
|
6
|
+
// `bpPerPx`/`offsetPx` are v4's viewport spelling from before it was stored as
|
|
7
|
+
// a window, `showCytobandsSetting` its cytoband toggle and `colorByCDS` its
|
|
8
|
+
// frame coloring. None is a declared property, so the partition would read them
|
|
9
|
+
// as typos; the model's own preProcessSnapshot still converts them, so a URL or
|
|
10
|
+
// saved spec naming them goes on working. Share links carry all four, so they
|
|
11
|
+
// stay.
|
|
10
12
|
//
|
|
11
13
|
// #launchKeys LinearGenomeView — the URL parameters page renders this list
|
|
12
14
|
// rather than restating it; each of these keys has its own `¶m=` section
|
|
@@ -14,10 +16,13 @@ import { defineLaunchKeys } from '@jbrowse/core/util/withLaunchInput';
|
|
|
14
16
|
export const lgvLaunchKeys = defineLaunchKeys()({
|
|
15
17
|
loc: { kind: 'launch' },
|
|
16
18
|
grow: { kind: 'launch' },
|
|
19
|
+
showHitTrack: { kind: 'launch' },
|
|
17
20
|
assembly: { kind: 'launch' },
|
|
18
21
|
displayedRegionNames: { kind: 'launch' },
|
|
19
22
|
tracklist: { kind: 'launch' },
|
|
20
23
|
nav: { kind: 'launch' },
|
|
21
24
|
tracks: { kind: 'trackEntries' },
|
|
22
|
-
highlight: { kind: '
|
|
23
|
-
}, {
|
|
25
|
+
highlight: { kind: 'launch' },
|
|
26
|
+
}, {
|
|
27
|
+
passThrough: ['bpPerPx', 'offsetPx', 'showCytobandsSetting', 'colorByCDS'],
|
|
28
|
+
});
|
|
@@ -5,15 +5,28 @@ export declare const ReturnToImportFormDialog: import("react").LazyExoticCompone
|
|
|
5
5
|
handleClose: () => void;
|
|
6
6
|
}) => import("react").JSX.Element>;
|
|
7
7
|
export declare const SequenceSearchDialog: import("react").LazyExoticComponent<({ model, handleClose, }: {
|
|
8
|
+
model: import("./components/searchModes.ts").SequenceSearchModel;
|
|
9
|
+
handleClose: () => void;
|
|
10
|
+
}) => import("react").JSX.Element>;
|
|
11
|
+
export declare const ExportSvgDialog: import("react").LazyExoticComponent<({ model, handleClose, chooseWidth, }: {
|
|
8
12
|
model: {
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
width?: number;
|
|
14
|
+
effectiveTrackLabels?: import("@jbrowse/display-kit/types").ViewTrackLabelMode;
|
|
15
|
+
exportSvg(opts: import("@jbrowse/core/ui").BaseExportSvgOptions & {
|
|
16
|
+
trackLabels: import("@jbrowse/display-kit/types").TrackLabelMode;
|
|
17
|
+
showGridlines: boolean;
|
|
18
|
+
viewWidth?: number;
|
|
19
|
+
}): Promise<unknown>;
|
|
11
20
|
};
|
|
12
21
|
handleClose: () => void;
|
|
22
|
+
chooseWidth?: boolean;
|
|
13
23
|
}) => import("react").JSX.Element>;
|
|
14
|
-
export declare const ExportSvgDialog: import("react").LazyExoticComponent<typeof import("./components/ExportSvgDialog.tsx").default>;
|
|
15
24
|
export declare const GetSequenceDialog: import("react").LazyExoticComponent<({ model, regions, handleClose, }: {
|
|
16
25
|
model: import("@jbrowse/mobx-state-tree").IAnyStateTreeNode;
|
|
17
26
|
regions: import("@jbrowse/core/util").Region[];
|
|
18
27
|
handleClose: () => void;
|
|
19
28
|
}) => import("react").JSX.Element>;
|
|
29
|
+
export declare const RegionWidthEditorDialog: import("react").LazyExoticComponent<({ model, handleClose, }: {
|
|
30
|
+
model: import("./model.ts").LinearGenomeViewModel;
|
|
31
|
+
handleClose: () => void;
|
|
32
|
+
}) => import("react").JSX.Element>;
|
|
@@ -3,3 +3,4 @@ export const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/Retu
|
|
|
3
3
|
export const SequenceSearchDialog = lazy(() => import('./components/SequenceSearchDialog.js'));
|
|
4
4
|
export const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog.js'));
|
|
5
5
|
export const GetSequenceDialog = lazy(() => import('./components/GetSequenceDialog.js'));
|
|
6
|
+
export const RegionWidthEditorDialog = lazy(() => import('./components/RegionWidthEditorDialog.js'));
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from './model.ts';
|
|
2
2
|
import type { IStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
3
|
-
/**
|
|
4
|
-
* The single source of truth for which LinearGenomeView actions can be
|
|
5
|
-
* replayed across linked views. Keeping it here (rather than as loose string
|
|
6
|
-
* arrays in each parent view) means the dispatch below stays exhaustive and a
|
|
7
|
-
* typo can't silently produce a no-op sync.
|
|
8
|
-
*/
|
|
9
|
-
export type SyncableViewAction = 'horizontalScroll' | 'zoomTo' | 'showTrack' | 'toggleTrack' | 'launchTrack' | 'launchToggleTrack' | 'hideTrack' | 'setTrackLabels' | 'setShowCenterLine';
|
|
10
3
|
interface LinkableViews {
|
|
11
4
|
linkViews: boolean;
|
|
12
5
|
views: LinearGenomeViewModel[];
|
|
13
6
|
}
|
|
14
7
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* sync. Used by linear-comparative-view and breakpoint-split-view.
|
|
8
|
+
* While `linkViews` is on, replay each pan, zoom and track toggle made on one
|
|
9
|
+
* sub-view onto every other, with the same arguments.
|
|
18
10
|
*/
|
|
19
|
-
export declare function installLinkedViewSync(self: IStateTreeNode & LinkableViews
|
|
11
|
+
export declare function installLinkedViewSync(self: IStateTreeNode & LinkableViews): void;
|
|
20
12
|
export {};
|
|
@@ -1,58 +1,36 @@
|
|
|
1
|
-
import { addDisposer, addMiddleware
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
break;
|
|
16
|
-
case 'launchTrack':
|
|
17
|
-
void view.launchTrack(args[0]);
|
|
18
|
-
break;
|
|
19
|
-
case 'launchToggleTrack':
|
|
20
|
-
void view.launchToggleTrack(args[0]);
|
|
21
|
-
break;
|
|
22
|
-
case 'hideTrack':
|
|
23
|
-
view.hideTrack(args[0]);
|
|
24
|
-
break;
|
|
25
|
-
case 'setTrackLabels':
|
|
26
|
-
view.setTrackLabels(args[0]);
|
|
27
|
-
break;
|
|
28
|
-
case 'setShowCenterLine':
|
|
29
|
-
view.setShowCenterLine(args[0]);
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
1
|
+
import { addDisposer, addMiddleware } from '@jbrowse/mobx-state-tree';
|
|
2
|
+
const LINKED_ACTIONS = [
|
|
3
|
+
'horizontalScroll',
|
|
4
|
+
'zoomTo',
|
|
5
|
+
'showTrack',
|
|
6
|
+
'toggleTrack',
|
|
7
|
+
'launchTrack',
|
|
8
|
+
'launchToggleTrack',
|
|
9
|
+
'hideTrack',
|
|
10
|
+
'setTrackLabels',
|
|
11
|
+
'setShowCenterLine',
|
|
12
|
+
];
|
|
13
|
+
function isLinkedAction(name) {
|
|
14
|
+
return LINKED_ACTIONS.includes(name);
|
|
32
15
|
}
|
|
33
16
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* sync. Used by linear-comparative-view and breakpoint-split-view.
|
|
17
|
+
* While `linkViews` is on, replay each pan, zoom and track toggle made on one
|
|
18
|
+
* sub-view onto every other, with the same arguments.
|
|
37
19
|
*/
|
|
38
|
-
export function installLinkedViewSync(self
|
|
39
|
-
addDisposer(self, addMiddleware(self, (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const sourcePath = getPath(rawCall.context);
|
|
47
|
-
next(rawCall);
|
|
20
|
+
export function installLinkedViewSync(self) {
|
|
21
|
+
addDisposer(self, addMiddleware(self, (call, next) => {
|
|
22
|
+
next(call);
|
|
23
|
+
const { name, args, context } = call;
|
|
24
|
+
if (call.type === 'action' &&
|
|
25
|
+
call.id === call.rootId &&
|
|
26
|
+
self.linkViews &&
|
|
27
|
+
isLinkedAction(name)) {
|
|
48
28
|
for (const view of self.views) {
|
|
49
|
-
if (
|
|
50
|
-
|
|
29
|
+
if (view !== context) {
|
|
30
|
+
const action = view[name];
|
|
31
|
+
void action(...args);
|
|
51
32
|
}
|
|
52
33
|
}
|
|
53
34
|
}
|
|
54
|
-
else {
|
|
55
|
-
next(rawCall);
|
|
56
|
-
}
|
|
57
35
|
}));
|
|
58
36
|
}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from './model.ts';
|
|
2
2
|
import type { BpOffset } from './types.ts';
|
|
3
3
|
import type { MenuItem } from '@jbrowse/core/ui';
|
|
4
|
+
export declare function zoomMenuItems(self: LinearGenomeViewModel): MenuItem[];
|
|
5
|
+
export declare function buildHighlightsSubMenuItems(self: LinearGenomeViewModel): MenuItem[];
|
|
4
6
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* only one of the two that survives `hideHeader`.
|
|
8
|
-
*
|
|
9
|
-
* The zoom menu earns it on the merits: this is the bottom of the same "Zoom
|
|
10
|
-
* out 100x" ladder, and it is where someone already zooming looks.
|
|
11
|
-
*
|
|
12
|
-
* The label is the import form's button text verbatim (`ImportForm.tsx`), which
|
|
13
|
-
* is where most people meet the phrase. No icon: the four-arrows glyph it
|
|
14
|
-
* carried reads as "fullscreen", and nothing else names the same gesture, so a
|
|
15
|
-
* substitute would be decoration rather than a distinction.
|
|
7
|
+
* Build the main view menu items. A row stacked in another view has no import
|
|
8
|
+
* form of its own, so only a top-level view offers the way back to one.
|
|
16
9
|
*/
|
|
17
|
-
export declare function
|
|
10
|
+
export declare function buildMenuItems(self: LinearGenomeViewModel): MenuItem[];
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
12
|
+
* Open a copy of the view, tracks and their settings included, framed on the
|
|
13
|
+
* span between two offsets. The same copy as the view menu's "Copy view", and
|
|
14
|
+
* nothing links it back to the original.
|
|
20
15
|
*/
|
|
21
|
-
export declare function
|
|
16
|
+
export declare function openSpanInNewView(view: LinearGenomeViewModel, start?: BpOffset, end?: BpOffset): import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
22
17
|
/**
|
|
23
|
-
* Build rubberband selection menu items.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
18
|
+
* Build rubberband selection menu items. What a selection can open collects
|
|
19
|
+
* under one "Launch" submenu, which sorts last, below any row a plugin appends
|
|
20
|
+
* to the menu itself: a new linear genome view of the span first, then
|
|
21
|
+
* `launchItems`, the plugin-supplied ones (`rubberBandLaunchMenuItems()`).
|
|
22
|
+
*
|
|
23
|
+
* The new view is a copy of this one, so only a top-level view offers it: a row
|
|
24
|
+
* of a comparative view carries that view's framing, such as a hidden header.
|
|
27
25
|
*/
|
|
28
26
|
export declare function buildRubberBandMenuItems(self: LinearGenomeViewModel, launchItems: MenuItem[]): MenuItem[];
|
|
29
27
|
/**
|