@jbrowse/plugin-linear-comparative-view 3.7.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +3 -3
- package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +9 -9
- package/esm/LGVSyntenyDisplay/configSchemaF.js +1 -1
- package/esm/LGVSyntenyDisplay/index.js +2 -2
- package/esm/LGVSyntenyDisplay/model.d.ts +1179 -133
- package/esm/LGVSyntenyDisplay/model.js +2 -2
- package/esm/LaunchLinearSyntenyView.js +13 -86
- package/esm/LinearComparativeDisplay/configSchemaF.d.ts +1 -1
- package/esm/LinearComparativeDisplay/index.js +2 -2
- package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +95 -135
- package/esm/LinearComparativeDisplay/stateModelFactory.js +18 -17
- package/esm/LinearComparativeView/components/ColorBySelector.d.ts +1 -1
- package/esm/LinearComparativeView/components/ColorBySelector.js +3 -4
- package/esm/LinearComparativeView/components/Header.d.ts +1 -1
- package/esm/LinearComparativeView/components/Header.js +8 -9
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +2 -2
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -1
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +9 -8
- package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +1 -1
- package/esm/LinearComparativeView/components/LinearComparativeView.js +5 -5
- package/esm/LinearComparativeView/components/MinLengthSlider.d.ts +1 -1
- package/esm/LinearComparativeView/components/MinLengthSlider.js +7 -7
- package/esm/LinearComparativeView/components/OpacitySlider.d.ts +1 -1
- package/esm/LinearComparativeView/components/OpacitySlider.js +5 -6
- package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearComparativeView/components/Rubberband.js +5 -5
- package/esm/LinearComparativeView/components/RubberbandSpan.js +3 -5
- package/esm/LinearComparativeView/components/VerticalGuide.d.ts +1 -1
- package/esm/LinearComparativeView/components/VerticalGuide.js +2 -2
- package/esm/LinearComparativeView/components/useRangeSelect.d.ts +1 -1
- package/esm/LinearComparativeView/components/useRangeSelect.js +1 -1
- package/esm/LinearComparativeView/components/util.js +1 -1
- package/esm/LinearComparativeView/index.js +2 -2
- package/esm/LinearComparativeView/model.d.ts +474 -222
- package/esm/LinearComparativeView/model.js +50 -29
- package/esm/LinearReadVsRef/LinearReadVsRef.js +8 -9
- package/esm/LinearReadVsRef/index.js +1 -1
- package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/afterAttach.js +10 -11
- package/esm/LinearSyntenyDisplay/components/BlockError.js +1 -1
- package/esm/LinearSyntenyDisplay/components/BlockMessage.js +6 -15
- package/esm/LinearSyntenyDisplay/components/Component.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/Component.js +5 -5
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +10 -14
- package/esm/LinearSyntenyDisplay/components/LoadingMessage.js +1 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +8 -33
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
- package/esm/LinearSyntenyDisplay/components/util.d.ts +2 -2
- package/esm/LinearSyntenyDisplay/components/util.js +3 -3
- package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +2 -2
- package/esm/LinearSyntenyDisplay/configSchemaF.js +1 -1
- package/esm/LinearSyntenyDisplay/drawMouseoverClickMap.d.ts +2 -0
- package/esm/LinearSyntenyDisplay/drawMouseoverClickMap.js +53 -0
- package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.js +3 -5
- package/esm/LinearSyntenyDisplay/index.js +3 -3
- package/esm/LinearSyntenyDisplay/model.d.ts +97 -137
- package/esm/LinearSyntenyDisplay/model.js +3 -3
- package/esm/LinearSyntenyView/components/DiagonalizationProgressDialog.d.ts +1 -1
- package/esm/LinearSyntenyView/components/DiagonalizationProgressDialog.js +2 -2
- package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +6 -2
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +4 -4
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +4 -5
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +11 -1
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +8 -4
- package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.js +26 -9
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +5 -5
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +1 -2
- package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +2 -2
- package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +2 -2
- package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +3 -3
- package/esm/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +3 -3
- package/esm/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +4 -4
- package/esm/LinearSyntenyView/components/ImportForm/selectors/index.js +4 -4
- package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -1
- package/esm/LinearSyntenyView/components/LinearSyntenyView.js +14 -4
- package/esm/LinearSyntenyView/index.js +2 -2
- package/esm/LinearSyntenyView/model.d.ts +522 -254
- package/esm/LinearSyntenyView/model.js +99 -15
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +3 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +3 -3
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +2 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +34 -31
- package/esm/LinearSyntenyView/types.d.ts +10 -1
- package/esm/LinearSyntenyViewHelper/index.js +1 -1
- package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +11 -11
- package/esm/LinearSyntenyViewHelper/stateModelFactory.js +5 -43
- package/esm/SyntenyFeatureDetail/Formatter.js +2 -2
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +1 -1
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +6 -7
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -3
- package/esm/SyntenyFeatureDetail/index.js +2 -2
- package/esm/SyntenyTrack/configSchema.d.ts +16 -11
- package/esm/SyntenyTrack/index.js +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +11 -14
- package/esm/util.d.ts +1 -1
- package/esm/util.js +4 -8
- package/package.json +29 -35
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +0 -9
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +0 -53
- package/dist/LGVSyntenyDisplay/components/util.d.ts +0 -14
- package/dist/LGVSyntenyDisplay/components/util.js +0 -100
- package/dist/LGVSyntenyDisplay/configSchemaF.d.ts +0 -66
- package/dist/LGVSyntenyDisplay/configSchemaF.js +0 -38
- package/dist/LGVSyntenyDisplay/index.d.ts +0 -2
- package/dist/LGVSyntenyDisplay/index.js +0 -24
- package/dist/LGVSyntenyDisplay/model.d.ts +0 -418
- package/dist/LGVSyntenyDisplay/model.js +0 -118
- package/dist/LaunchLinearSyntenyView.d.ts +0 -2
- package/dist/LaunchLinearSyntenyView.js +0 -93
- package/dist/LinearComparativeDisplay/configSchemaF.d.ts +0 -2
- package/dist/LinearComparativeDisplay/configSchemaF.js +0 -10
- package/dist/LinearComparativeDisplay/index.d.ts +0 -2
- package/dist/LinearComparativeDisplay/index.js +0 -24
- package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +0 -243
- package/dist/LinearComparativeDisplay/stateModelFactory.js +0 -146
- package/dist/LinearComparativeView/components/ColorBySelector.d.ts +0 -5
- package/dist/LinearComparativeView/components/ColorBySelector.js +0 -54
- package/dist/LinearComparativeView/components/Header.d.ts +0 -5
- package/dist/LinearComparativeView/components/Header.js +0 -87
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +0 -5
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +0 -24
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +0 -5
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +0 -46
- package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +0 -5
- package/dist/LinearComparativeView/components/LinearComparativeView.js +0 -30
- package/dist/LinearComparativeView/components/MinLengthSlider.d.ts +0 -5
- package/dist/LinearComparativeView/components/MinLengthSlider.js +0 -47
- package/dist/LinearComparativeView/components/OpacitySlider.d.ts +0 -5
- package/dist/LinearComparativeView/components/OpacitySlider.js +0 -46
- package/dist/LinearComparativeView/components/Rubberband.d.ts +0 -7
- package/dist/LinearComparativeView/components/Rubberband.js +0 -32
- package/dist/LinearComparativeView/components/RubberbandSpan.d.ts +0 -15
- package/dist/LinearComparativeView/components/RubberbandSpan.js +0 -38
- package/dist/LinearComparativeView/components/RubberbandTooltip.d.ts +0 -5
- package/dist/LinearComparativeView/components/RubberbandTooltip.js +0 -20
- package/dist/LinearComparativeView/components/SliderTooltip.d.ts +0 -2
- package/dist/LinearComparativeView/components/SliderTooltip.js +0 -9
- package/dist/LinearComparativeView/components/VerticalGuide.d.ts +0 -7
- package/dist/LinearComparativeView/components/VerticalGuide.js +0 -26
- package/dist/LinearComparativeView/components/useRangeSelect.d.ts +0 -59
- package/dist/LinearComparativeView/components/useRangeSelect.js +0 -124
- package/dist/LinearComparativeView/components/util.d.ts +0 -4
- package/dist/LinearComparativeView/components/util.js +0 -6
- package/dist/LinearComparativeView/index.d.ts +0 -2
- package/dist/LinearComparativeView/index.js +0 -55
- package/dist/LinearComparativeView/model.d.ts +0 -606
- package/dist/LinearComparativeView/model.js +0 -238
- package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +0 -6
- package/dist/LinearReadVsRef/LinearReadVsRef.js +0 -241
- package/dist/LinearReadVsRef/index.d.ts +0 -2
- package/dist/LinearReadVsRef/index.js +0 -86
- package/dist/LinearSyntenyDisplay/afterAttach.d.ts +0 -2
- package/dist/LinearSyntenyDisplay/afterAttach.js +0 -104
- package/dist/LinearSyntenyDisplay/components/BlockError.d.ts +0 -3
- package/dist/LinearSyntenyDisplay/components/BlockError.js +0 -16
- package/dist/LinearSyntenyDisplay/components/BlockMessage.d.ts +0 -3
- package/dist/LinearSyntenyDisplay/components/BlockMessage.js +0 -24
- package/dist/LinearSyntenyDisplay/components/Component.d.ts +0 -5
- package/dist/LinearSyntenyDisplay/components/Component.js +0 -26
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +0 -5
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +0 -223
- package/dist/LinearSyntenyDisplay/components/LoadingMessage.d.ts +0 -3
- package/dist/LinearSyntenyDisplay/components/LoadingMessage.js +0 -21
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +0 -15
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +0 -56
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +0 -4
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +0 -13
- package/dist/LinearSyntenyDisplay/components/util.d.ts +0 -45
- package/dist/LinearSyntenyDisplay/components/util.js +0 -199
- package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +0 -12
- package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -23
- package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +0 -6
- package/dist/LinearSyntenyDisplay/drawSynteny.js +0 -470
- package/dist/LinearSyntenyDisplay/index.d.ts +0 -2
- package/dist/LinearSyntenyDisplay/index.js +0 -56
- package/dist/LinearSyntenyDisplay/model.d.ts +0 -291
- package/dist/LinearSyntenyDisplay/model.js +0 -133
- package/dist/LinearSyntenyView/components/DiagonalizationProgressDialog.d.ts +0 -6
- package/dist/LinearSyntenyView/components/DiagonalizationProgressDialog.js +0 -87
- package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +0 -7
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +0 -58
- package/dist/LinearSyntenyView/components/Icons.d.ts +0 -3
- package/dist/LinearSyntenyView/components/Icons.js +0 -12
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +0 -8
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +0 -81
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +0 -8
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +0 -39
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +0 -7
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +0 -22
- package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +0 -11
- package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.js +0 -58
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +0 -5
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +0 -60
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +0 -5
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +0 -43
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +0 -117
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +0 -68
- package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +0 -3
- package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +0 -13
- package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +0 -3
- package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +0 -13
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.d.ts +0 -19
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.js +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +0 -3
- package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +0 -20
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.d.ts +0 -13
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +0 -32
- package/dist/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +0 -4
- package/dist/LinearSyntenyView/components/ImportForm/selectors/index.js +0 -27
- package/dist/LinearSyntenyView/components/ImportForm/util.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/util.js +0 -24
- package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +0 -5
- package/dist/LinearSyntenyView/components/LinearSyntenyView.js +0 -47
- package/dist/LinearSyntenyView/components/TextField2.d.ts +0 -2
- package/dist/LinearSyntenyView/components/TextField2.js +0 -8
- package/dist/LinearSyntenyView/index.d.ts +0 -2
- package/dist/LinearSyntenyView/index.js +0 -52
- package/dist/LinearSyntenyView/model.d.ts +0 -702
- package/dist/LinearSyntenyView/model.js +0 -240
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +0 -5
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +0 -10
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +0 -11
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +0 -11
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +0 -3
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +0 -80
- package/dist/LinearSyntenyView/types.d.ts +0 -29
- package/dist/LinearSyntenyView/types.js +0 -2
- package/dist/LinearSyntenyView/util/diagonalize.d.ts +0 -27
- package/dist/LinearSyntenyView/util/diagonalize.js +0 -91
- package/dist/LinearSyntenyViewHelper/index.d.ts +0 -2
- package/dist/LinearSyntenyViewHelper/index.js +0 -25
- package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +0 -18
- package/dist/LinearSyntenyViewHelper/stateModelFactory.js +0 -78
- package/dist/SyntenyFeatureDetail/Formatter.d.ts +0 -3
- package/dist/SyntenyFeatureDetail/Formatter.js +0 -23
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +0 -7
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +0 -87
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +0 -5
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +0 -19
- package/dist/SyntenyFeatureDetail/index.d.ts +0 -2
- package/dist/SyntenyFeatureDetail/index.js +0 -60
- package/dist/SyntenyFeatureDetail/types.d.ts +0 -9
- package/dist/SyntenyFeatureDetail/types.js +0 -2
- package/dist/SyntenyTrack/configSchema.d.ts +0 -80
- package/dist/SyntenyTrack/configSchema.js +0 -9
- package/dist/SyntenyTrack/index.d.ts +0 -2
- package/dist/SyntenyTrack/index.js +0 -19
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -48
- package/dist/util.d.ts +0 -25
- package/dist/util.js +0 -67
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { getSession } from '@jbrowse/core/util';
|
|
3
|
+
import { addDisposer, types } from '@jbrowse/mobx-state-tree';
|
|
3
4
|
import CropFreeIcon from '@mui/icons-material/CropFree';
|
|
4
5
|
import LinkIcon from '@mui/icons-material/Link';
|
|
5
6
|
import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
|
|
6
7
|
import ShuffleIcon from '@mui/icons-material/Shuffle';
|
|
7
8
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog'));
|
|
14
|
-
const DiagonalizationProgressDialog = lazy(() => import('./components/DiagonalizationProgressDialog'));
|
|
9
|
+
import { autorun, observable, when } from 'mobx';
|
|
10
|
+
import { Curves } from "./components/Icons.js";
|
|
11
|
+
import baseModel from "../LinearComparativeView/model.js";
|
|
12
|
+
const ExportSvgDialog = lazy(() => import("./components/ExportSvgDialog.js"));
|
|
13
|
+
const DiagonalizationProgressDialog = lazy(() => import("./components/DiagonalizationProgressDialog.js"));
|
|
15
14
|
export default function stateModelFactory(pluginManager) {
|
|
16
15
|
return types
|
|
17
16
|
.compose('LinearSyntenyView', baseModel(pluginManager), types.model({
|
|
@@ -20,9 +19,23 @@ export default function stateModelFactory(pluginManager) {
|
|
|
20
19
|
drawCIGARMatchesOnly: false,
|
|
21
20
|
drawCurves: false,
|
|
22
21
|
drawLocationMarkers: false,
|
|
22
|
+
init: types.frozen(),
|
|
23
23
|
}))
|
|
24
24
|
.volatile(() => ({
|
|
25
25
|
importFormSyntenyTrackSelections: observable.array(),
|
|
26
|
+
}))
|
|
27
|
+
.views(self => ({
|
|
28
|
+
get hasSomethingToShow() {
|
|
29
|
+
return self.views.length > 0 || !!self.init;
|
|
30
|
+
},
|
|
31
|
+
}))
|
|
32
|
+
.views(self => ({
|
|
33
|
+
get showLoading() {
|
|
34
|
+
return self.isLoading || (!self.initialized && self.hasSomethingToShow);
|
|
35
|
+
},
|
|
36
|
+
get showImportForm() {
|
|
37
|
+
return !self.hasSomethingToShow;
|
|
38
|
+
},
|
|
26
39
|
}))
|
|
27
40
|
.actions(self => ({
|
|
28
41
|
importFormRemoveRow(idx) {
|
|
@@ -47,19 +60,20 @@ export default function stateModelFactory(pluginManager) {
|
|
|
47
60
|
self.drawLocationMarkers = arg;
|
|
48
61
|
},
|
|
49
62
|
showAllRegions() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
for (const view of self.views) {
|
|
64
|
+
view.showAllRegionsInAssembly();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
setInit(init) {
|
|
68
|
+
self.init = init;
|
|
55
69
|
},
|
|
56
70
|
}))
|
|
57
71
|
.actions(self => ({
|
|
58
72
|
async exportSvg(opts) {
|
|
59
|
-
const { renderToSvg } = await import(
|
|
73
|
+
const { renderToSvg } = await import("./svgcomponents/SVGLinearSyntenyView.js");
|
|
60
74
|
const html = await renderToSvg(self, opts);
|
|
61
|
-
const
|
|
62
|
-
saveAs(
|
|
75
|
+
const { saveAs } = await import('file-saver-es');
|
|
76
|
+
saveAs(new Blob([html], { type: 'image/svg+xml' }), opts.filename || 'image.svg');
|
|
63
77
|
},
|
|
64
78
|
}))
|
|
65
79
|
.views(self => {
|
|
@@ -197,5 +211,75 @@ export default function stateModelFactory(pluginManager) {
|
|
|
197
211
|
];
|
|
198
212
|
},
|
|
199
213
|
};
|
|
214
|
+
})
|
|
215
|
+
.actions(self => ({
|
|
216
|
+
afterAttach() {
|
|
217
|
+
addDisposer(self, autorun(async function initAutorun() {
|
|
218
|
+
const { init, width } = self;
|
|
219
|
+
if (!width || !init) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const session = getSession(self);
|
|
223
|
+
const { assemblyManager } = session;
|
|
224
|
+
try {
|
|
225
|
+
const assemblies = await Promise.all(init.views.map(async (v) => {
|
|
226
|
+
const asm = await assemblyManager.waitForAssembly(v.assembly);
|
|
227
|
+
if (!asm) {
|
|
228
|
+
throw new Error(`Assembly ${v.assembly} failed to load`);
|
|
229
|
+
}
|
|
230
|
+
return asm;
|
|
231
|
+
}));
|
|
232
|
+
self.setViews(assemblies.map(asm => ({
|
|
233
|
+
type: 'LinearGenomeView',
|
|
234
|
+
bpPerPx: 1,
|
|
235
|
+
offsetPx: 0,
|
|
236
|
+
hideHeader: true,
|
|
237
|
+
displayedRegions: asm.regions,
|
|
238
|
+
})));
|
|
239
|
+
await Promise.all(self.views.map(view => when(() => view.initialized)));
|
|
240
|
+
await Promise.all(init.views.map(async (viewInit, idx) => {
|
|
241
|
+
const view = self.views[idx];
|
|
242
|
+
if (!view) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (viewInit.loc) {
|
|
246
|
+
await view.navToLocString(viewInit.loc, viewInit.assembly);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
view.showAllRegionsInAssembly(viewInit.assembly);
|
|
250
|
+
}
|
|
251
|
+
if (viewInit.tracks) {
|
|
252
|
+
for (const trackId of viewInit.tracks) {
|
|
253
|
+
view.showTrack(trackId);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}));
|
|
257
|
+
if (init.tracks) {
|
|
258
|
+
for (const trackId of init.tracks) {
|
|
259
|
+
self.showTrack(trackId);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
self.setInit(undefined);
|
|
263
|
+
}
|
|
264
|
+
catch (e) {
|
|
265
|
+
console.error(e);
|
|
266
|
+
session.notifyError(`${e}`, e);
|
|
267
|
+
self.setInit(undefined);
|
|
268
|
+
}
|
|
269
|
+
}, { name: 'LinearSyntenyViewInit' }));
|
|
270
|
+
},
|
|
271
|
+
}))
|
|
272
|
+
.postProcessSnapshot(snap => {
|
|
273
|
+
if (!snap) {
|
|
274
|
+
return snap;
|
|
275
|
+
}
|
|
276
|
+
const { init, drawCIGAR, drawCIGARMatchesOnly, drawCurves, drawLocationMarkers, ...rest } = snap;
|
|
277
|
+
return {
|
|
278
|
+
...rest,
|
|
279
|
+
...(!drawCIGAR ? { drawCIGAR } : {}),
|
|
280
|
+
...(drawCIGARMatchesOnly ? { drawCIGARMatchesOnly } : {}),
|
|
281
|
+
...(drawCurves ? { drawCurves } : {}),
|
|
282
|
+
...(drawLocationMarkers ? { drawLocationMarkers } : {}),
|
|
283
|
+
};
|
|
200
284
|
});
|
|
201
285
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
2
|
-
export default function SVGLinearGenomeView({ trackLabelOffset, fontSize, textHeight, trackLabels, view, displayResults, rulerHeight, shift, }: {
|
|
2
|
+
export default function SVGLinearGenomeView({ trackLabelOffset, fontSize, textHeight, trackLabels, view, displayResults, rulerHeight, shift, showGridlines, tracksHeight, }: {
|
|
3
3
|
textHeight: number;
|
|
4
4
|
trackLabels: string;
|
|
5
5
|
trackLabelOffset: number;
|
|
@@ -8,4 +8,6 @@ export default function SVGLinearGenomeView({ trackLabelOffset, fontSize, textHe
|
|
|
8
8
|
displayResults: any;
|
|
9
9
|
rulerHeight: number;
|
|
10
10
|
shift: number;
|
|
11
|
+
showGridlines?: boolean;
|
|
12
|
+
tracksHeight: number;
|
|
11
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getFillProps } from '@jbrowse/core/util';
|
|
3
|
-
import { SVGRuler, SVGTracks } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
+
import { SVGGridlines, SVGRuler, SVGTracks, } from '@jbrowse/plugin-linear-genome-view';
|
|
4
4
|
import { useTheme } from '@mui/material';
|
|
5
|
-
export default function SVGLinearGenomeView({ trackLabelOffset, fontSize, textHeight, trackLabels, view, displayResults, rulerHeight, shift, }) {
|
|
5
|
+
export default function SVGLinearGenomeView({ trackLabelOffset, fontSize, textHeight, trackLabels, view, displayResults, rulerHeight, shift, showGridlines = false, tracksHeight, }) {
|
|
6
6
|
const theme = useTheme();
|
|
7
|
-
return (_jsxs("g", { transform: `translate(${shift} ${fontSize})`, children: [_jsxs("g", { transform: `translate(${trackLabelOffset})`, children: [_jsx("text", { x: 0, fontSize: fontSize, ...getFillProps(theme.palette.text.primary), children: view.assemblyNames.join(', ') }), _jsx(SVGRuler, { model: displayResults.view, fontSize: fontSize })] }), _jsx("g", { transform: `translate(0 ${rulerHeight + fontSize})`, children: _jsx(SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults.view, displayResults: displayResults.data, trackLabelOffset: trackLabelOffset }) })] }));
|
|
7
|
+
return (_jsxs("g", { transform: `translate(${shift} ${fontSize})`, children: [_jsxs("g", { transform: `translate(${trackLabelOffset})`, children: [_jsx("text", { x: 0, fontSize: fontSize, ...getFillProps(theme.palette.text.primary), children: view.assemblyNames.join(', ') }), _jsx(SVGRuler, { model: displayResults.view, fontSize: fontSize })] }), showGridlines ? (_jsx("g", { transform: `translate(${trackLabelOffset} ${rulerHeight + fontSize})`, children: _jsx(SVGGridlines, { model: displayResults.view, height: tracksHeight }) })) : null, _jsx("g", { transform: `translate(0 ${rulerHeight + fontSize})`, children: _jsx(SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults.view, displayResults: displayResults.data, trackLabelOffset: trackLabelOffset }) })] }));
|
|
8
8
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { LinearSyntenyViewModel } from '../model';
|
|
2
|
-
import type { ExportSvgOptions } from '../types';
|
|
1
|
+
import type { LinearSyntenyViewModel } from '../model.ts';
|
|
2
|
+
import type { ExportSvgOptions } from '../types.ts';
|
|
3
3
|
export declare function renderToSvg(model: LinearSyntenyViewModel, opts: ExportSvgOptions): Promise<string>;
|
|
@@ -5,15 +5,14 @@ import { getTrackName } from '@jbrowse/core/util/tracks';
|
|
|
5
5
|
import { totalHeight } from '@jbrowse/plugin-linear-genome-view';
|
|
6
6
|
import { ThemeProvider } from '@mui/material';
|
|
7
7
|
import { when } from 'mobx';
|
|
8
|
-
import SVGBackground from
|
|
9
|
-
import SVGLinearGenomeView from
|
|
10
|
-
import { drawRef } from
|
|
8
|
+
import SVGBackground from "./SVGBackground.js";
|
|
9
|
+
import SVGLinearGenomeView from "./SVGLinearGenomeView.js";
|
|
10
|
+
import { drawRef } from "../../LinearSyntenyDisplay/drawSynteny.js";
|
|
11
11
|
export async function renderToSvg(model, opts) {
|
|
12
|
-
var _a;
|
|
13
12
|
await when(() => model.initialized);
|
|
14
|
-
const { textHeight = 18, rulerHeight = 30, fontSize = 13, trackLabels = 'offset', Wrapper = ({ children }) => children, themeName = 'default', } = opts;
|
|
13
|
+
const { textHeight = 18, rulerHeight = 30, fontSize = 13, trackLabels = 'offset', showGridlines = false, Wrapper = ({ children }) => children, themeName = 'default', } = opts;
|
|
15
14
|
const session = getSession(model);
|
|
16
|
-
const themeVar =
|
|
15
|
+
const themeVar = session.allThemes?.()[themeName];
|
|
17
16
|
const { width, views, levels } = model;
|
|
18
17
|
const shift = 50;
|
|
19
18
|
const offset = rulerHeight;
|
|
@@ -30,35 +29,39 @@ export async function renderToSvg(model, opts) {
|
|
|
30
29
|
};
|
|
31
30
|
})),
|
|
32
31
|
})));
|
|
33
|
-
const renderings = await Promise.all(levels.map(async (level) =>
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
const renderings = await Promise.all(levels.map(async (level) => {
|
|
33
|
+
const { tracks } = level;
|
|
34
|
+
return Promise.all(tracks.map(async (track) => {
|
|
35
|
+
const d = track.displays[0];
|
|
36
|
+
await when(() => d.ready);
|
|
37
|
+
const r = await renderToAbstractCanvas(width, level.height, { exportSVG: opts }, ctx => {
|
|
38
|
+
drawRef(d, ctx);
|
|
39
|
+
return undefined;
|
|
40
|
+
});
|
|
41
|
+
if ('imageData' in r) {
|
|
42
|
+
throw new Error('found a canvas in svg export, probably a bug');
|
|
43
|
+
}
|
|
44
|
+
else if ('canvasRecordedData' in r) {
|
|
45
|
+
return {
|
|
46
|
+
html: await getSerializedSvg({
|
|
47
|
+
...r,
|
|
48
|
+
width,
|
|
49
|
+
height: level.height,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return r;
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
}));
|
|
56
58
|
const trackLabelMaxLen = max(views.flatMap(view => view.tracks.map(track => measureText(getTrackName(track.configuration, session), fontSize))), 0) + 40;
|
|
57
59
|
const trackLabelOffset = trackLabels === 'left' ? trackLabelMaxLen : 0;
|
|
58
60
|
const w = width + trackLabelOffset;
|
|
59
61
|
const theme = createJBrowseTheme(themeVar);
|
|
62
|
+
const tracksHeights = views.map(v => totalHeight(v.tracks, textHeight, trackLabels));
|
|
60
63
|
const RenderList = [
|
|
61
|
-
_jsx(SVGLinearGenomeView, { rulerHeight: rulerHeight, trackLabelOffset: trackLabelOffset, shift: shift, textHeight: textHeight, trackLabels: trackLabels, displayResults: displayResults[0], view: views[0], fontSize: fontSize }, views[0].id),
|
|
64
|
+
_jsx(SVGLinearGenomeView, { rulerHeight: rulerHeight, trackLabelOffset: trackLabelOffset, shift: shift, textHeight: textHeight, trackLabels: trackLabels, displayResults: displayResults[0], view: views[0], fontSize: fontSize, showGridlines: showGridlines, tracksHeight: tracksHeights[0] }, views[0].id),
|
|
62
65
|
];
|
|
63
66
|
let currOffset = heights[0] + fontSize + rulerHeight;
|
|
64
67
|
for (let i = 1; i < views.length; i++) {
|
|
@@ -67,7 +70,7 @@ export async function renderToSvg(model, opts) {
|
|
|
67
70
|
const rendering = renderings[i - 1];
|
|
68
71
|
const height = heights[i];
|
|
69
72
|
const levelHeight = level.height || 0;
|
|
70
|
-
RenderList.push(_jsxs("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? (_jsx("defs", { children: _jsx("clipPath", { id: `synclip-${i}`, children: _jsx("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, _jsx("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering
|
|
73
|
+
RenderList.push(_jsxs("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? (_jsx("defs", { children: _jsx("clipPath", { id: `synclip-${i}`, children: _jsx("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, _jsx("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering?.map((r, i) => (_jsx(ReactRendering, { rendering: r }, i))) }), _jsx("g", { transform: `translate(0 ${levelHeight})`, children: _jsx(SVGLinearGenomeView, { rulerHeight: rulerHeight, shift: shift, trackLabelOffset: trackLabelOffset, textHeight: textHeight, trackLabels: trackLabels, displayResults: displayResults[i], view: view, fontSize: fontSize, showGridlines: showGridlines, tracksHeight: tracksHeights[i] }, view.id) })] }, view.id));
|
|
71
74
|
currOffset += height + fontSize + rulerHeight + levelHeight;
|
|
72
75
|
}
|
|
73
76
|
return renderToStaticMarkup(_jsx(ThemeProvider, { theme: theme, children: _jsx(Wrapper, { children: _jsxs("svg", { width: width, height: totalHeightSvg, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w + shift * 2, totalHeightSvg].toString(), children: [_jsx(SVGBackground, { width: w, height: totalHeightSvg, shift: shift }), RenderList] }) }) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
-
import type { SnapshotIn } from 'mobx-state-tree';
|
|
3
|
+
import type { SnapshotIn } from '@jbrowse/mobx-state-tree';
|
|
4
4
|
export type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
5
5
|
export type ImportFormSyntenyTrack = {
|
|
6
6
|
type: 'preConfigured';
|
|
@@ -11,6 +11,14 @@ export type ImportFormSyntenyTrack = {
|
|
|
11
11
|
} | {
|
|
12
12
|
type: 'none';
|
|
13
13
|
};
|
|
14
|
+
export interface LinearSyntenyViewInit {
|
|
15
|
+
views: {
|
|
16
|
+
loc?: string;
|
|
17
|
+
assembly: string;
|
|
18
|
+
tracks?: string[];
|
|
19
|
+
}[];
|
|
20
|
+
tracks?: string[];
|
|
21
|
+
}
|
|
14
22
|
export interface ExportSvgOptions {
|
|
15
23
|
rasterizeLayers?: boolean;
|
|
16
24
|
scale?: number;
|
|
@@ -26,4 +34,5 @@ export interface ExportSvgOptions {
|
|
|
26
34
|
cytobandHeight?: number;
|
|
27
35
|
themeName?: string;
|
|
28
36
|
trackLabels?: string;
|
|
37
|
+
showGridlines?: boolean;
|
|
29
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
|
|
3
|
-
import { linearSyntenyViewHelperModelFactory } from
|
|
3
|
+
import { linearSyntenyViewHelperModelFactory } from "./stateModelFactory.js";
|
|
4
4
|
function UnusedComponent() {
|
|
5
5
|
return _jsx("div", {});
|
|
6
6
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
import type { Instance } from 'mobx-state-tree';
|
|
3
|
-
export declare function linearSyntenyViewHelperModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
4
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
|
-
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
6
|
-
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>;
|
|
7
|
-
height: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
8
|
-
level: import("mobx-state-tree").ISimpleType<number>;
|
|
2
|
+
import type { Instance } from '@jbrowse/mobx-state-tree';
|
|
3
|
+
export declare function linearSyntenyViewHelperModelFactory(pluginManager: PluginManager): import("@jbrowse/mobx-state-tree").IModelType<{
|
|
4
|
+
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
|
+
type: import("@jbrowse/mobx-state-tree").IType<string | undefined, string, string>;
|
|
6
|
+
tracks: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IAnyType>;
|
|
7
|
+
height: import("@jbrowse/mobx-state-tree").IType<number | undefined, number, number>;
|
|
8
|
+
level: import("@jbrowse/mobx-state-tree").ISimpleType<number>;
|
|
9
9
|
}, {
|
|
10
10
|
setHeight(n: number): number;
|
|
11
|
-
showTrack(trackId: string, initialSnapshot?: {}):
|
|
12
|
-
hideTrack(trackId: string):
|
|
13
|
-
toggleTrack(trackId: string):
|
|
11
|
+
showTrack(trackId: string, initialSnapshot?: {}): any;
|
|
12
|
+
hideTrack(trackId: string): 0 | 1;
|
|
13
|
+
toggleTrack(trackId: string): void;
|
|
14
14
|
} & {
|
|
15
15
|
readonly assemblyNames: (string | undefined)[];
|
|
16
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
16
|
+
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
17
17
|
export type LinearSyntenyViewHelperStateModel = ReturnType<typeof linearSyntenyViewHelperModelFactory>;
|
|
18
18
|
export type LinearSyntenyViewHelperModel = Instance<LinearSyntenyViewHelperStateModel>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { hideTrackGeneric, showTrackGeneric, toggleTrackGeneric, } from '@jbrowse/core/util/tracks';
|
|
1
2
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
2
|
-
import {
|
|
3
|
-
import { getParent, getRoot, resolveIdentifier, types } from 'mobx-state-tree';
|
|
3
|
+
import { getParent, types } from '@jbrowse/mobx-state-tree';
|
|
4
4
|
export function linearSyntenyViewHelperModelFactory(pluginManager) {
|
|
5
5
|
return types
|
|
6
6
|
.model('LinearSyntenyViewHelper', {
|
|
@@ -16,51 +16,13 @@ export function linearSyntenyViewHelperModelFactory(pluginManager) {
|
|
|
16
16
|
return self.height;
|
|
17
17
|
},
|
|
18
18
|
showTrack(trackId, initialSnapshot = {}) {
|
|
19
|
-
|
|
20
|
-
const configuration = resolveIdentifier(schema, getRoot(self), trackId);
|
|
21
|
-
if (!configuration) {
|
|
22
|
-
throw new Error(`track not found ${trackId}`);
|
|
23
|
-
}
|
|
24
|
-
const trackType = pluginManager.getTrackType(configuration.type);
|
|
25
|
-
if (!trackType) {
|
|
26
|
-
throw new Error(`unknown track type ${configuration.type}`);
|
|
27
|
-
}
|
|
28
|
-
const viewType = pluginManager.getViewType(self.type);
|
|
29
|
-
const supportedDisplays = new Set(viewType.displayTypes.map(d => d.name));
|
|
30
|
-
const displayConf = configuration.displays.find((d) => supportedDisplays.has(d.type));
|
|
31
|
-
if (!displayConf) {
|
|
32
|
-
throw new Error(`could not find a compatible display for view type ${self.type}`);
|
|
33
|
-
}
|
|
34
|
-
self.tracks.push(trackType.stateModel.create({
|
|
35
|
-
...initialSnapshot,
|
|
36
|
-
type: configuration.type,
|
|
37
|
-
configuration,
|
|
38
|
-
displays: [
|
|
39
|
-
{
|
|
40
|
-
type: displayConf.type,
|
|
41
|
-
configuration: displayConf,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
}));
|
|
19
|
+
return showTrackGeneric(self, trackId, initialSnapshot);
|
|
45
20
|
},
|
|
46
21
|
hideTrack(trackId) {
|
|
47
|
-
|
|
48
|
-
const config = resolveIdentifier(schema, getRoot(self), trackId);
|
|
49
|
-
const shownTracks = self.tracks.filter(t => t.configuration === config);
|
|
50
|
-
transaction(() => {
|
|
51
|
-
for (const t of shownTracks) {
|
|
52
|
-
self.tracks.remove(t);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return shownTracks.length;
|
|
22
|
+
return hideTrackGeneric(self, trackId);
|
|
56
23
|
},
|
|
57
24
|
toggleTrack(trackId) {
|
|
58
|
-
|
|
59
|
-
if (!hiddenCount) {
|
|
60
|
-
this.showTrack(trackId);
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
25
|
+
toggleTrackGeneric(self, trackId);
|
|
64
26
|
},
|
|
65
27
|
}))
|
|
66
28
|
.views(self => ({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import copy from 'copy-to-clipboard';
|
|
4
3
|
export default function Formatter({ value }) {
|
|
5
4
|
const [show, setShow] = useState(false);
|
|
6
5
|
const [copied, setCopied] = useState(false);
|
|
7
6
|
const display = String(value);
|
|
8
|
-
return display.length > 100 ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => {
|
|
7
|
+
return display.length > 100 ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: async () => {
|
|
8
|
+
const { default: copy } = await import('copy-to-clipboard');
|
|
9
9
|
copy(display);
|
|
10
10
|
setCopied(true);
|
|
11
11
|
setTimeout(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SyntenyFeatureDetailModel } from './types';
|
|
1
|
+
import type { SyntenyFeatureDetailModel } from './types.ts';
|
|
2
2
|
import type { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
3
3
|
declare const LinkToSyntenyView: ({ model, feat, }: {
|
|
4
4
|
model: SyntenyFeatureDetailModel;
|
|
@@ -3,16 +3,15 @@ import { lazy } from 'react';
|
|
|
3
3
|
import { SimpleFeature, assembleLocString, getSession, } from '@jbrowse/core/util';
|
|
4
4
|
import { Link } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
-
const LaunchSyntenyViewDialog = lazy(() => import(
|
|
7
|
-
const LinkToSyntenyView = observer(function ({ model, feat, }) {
|
|
6
|
+
const LaunchSyntenyViewDialog = lazy(() => import("../LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js"));
|
|
7
|
+
const LinkToSyntenyView = observer(function LinkToSyntenyView({ model, feat, }) {
|
|
8
8
|
const { view, level, trackId } = model;
|
|
9
9
|
return (_jsxs("ul", { children: [view.type === 'LinearSyntenyView' ? (_jsx("li", { children: _jsx(Link, { href: "#", onClick: event => {
|
|
10
|
-
var _a, _b;
|
|
11
10
|
event.preventDefault();
|
|
12
11
|
const { views } = view;
|
|
13
12
|
if (level !== undefined) {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
views[level]?.navTo(feat);
|
|
14
|
+
views[level + 1]?.navTo(feat.mate);
|
|
16
15
|
}
|
|
17
16
|
else {
|
|
18
17
|
const f1 = feat;
|
|
@@ -31,8 +30,8 @@ const LinkToSyntenyView = observer(function ({ model, feat, }) {
|
|
|
31
30
|
: '',
|
|
32
31
|
].join(' ... '));
|
|
33
32
|
}
|
|
34
|
-
v1
|
|
35
|
-
v2
|
|
33
|
+
v1?.navTo(f1);
|
|
34
|
+
v2?.navTo(f2);
|
|
36
35
|
}
|
|
37
36
|
}, children: "Center view on this feature" }) })) : null, _jsx("li", { children: _jsx(Link, { href: "#", onClick: event => {
|
|
38
37
|
event.preventDefault();
|
|
@@ -3,9 +3,9 @@ import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard
|
|
|
3
3
|
import FeatureDetails from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails';
|
|
4
4
|
import { Paper } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
-
import Formatter from
|
|
7
|
-
import LinkToSyntenyView from
|
|
8
|
-
const SyntenyFeatureDetail = observer(function (props) {
|
|
6
|
+
import Formatter from "./Formatter.js";
|
|
7
|
+
import LinkToSyntenyView from "./LinkToSyntenyView.js";
|
|
8
|
+
const SyntenyFeatureDetail = observer(function SyntenyFeatureDetail(props) {
|
|
9
9
|
const { model } = props;
|
|
10
10
|
const { featureData } = model;
|
|
11
11
|
const feat = structuredClone(featureData);
|
|
@@ -2,7 +2,7 @@ import { lazy } from 'react';
|
|
|
2
2
|
import { stateModelFactory as BaseFeatureWidgetStateModelF } from '@jbrowse/core/BaseFeatureWidget';
|
|
3
3
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
4
4
|
import WidgetType from '@jbrowse/core/pluggableElementTypes/WidgetType';
|
|
5
|
-
import { types } from 'mobx-state-tree';
|
|
5
|
+
import { types } from '@jbrowse/mobx-state-tree';
|
|
6
6
|
const configSchema = ConfigurationSchema('SyntenyFeatureWidget', {});
|
|
7
7
|
function stateModelF(pluginManager) {
|
|
8
8
|
return types.compose(BaseFeatureWidgetStateModelF(pluginManager), types.model('SyntenyFeatureWidget', {
|
|
@@ -16,6 +16,6 @@ export default function SyntenyFeatureWidgetF(pluginManager) {
|
|
|
16
16
|
heading: 'Synteny feature details',
|
|
17
17
|
configSchema,
|
|
18
18
|
stateModel: stateModelF(pluginManager),
|
|
19
|
-
ReactComponent: lazy(() => import(
|
|
19
|
+
ReactComponent: lazy(() => import("./SyntenyFeatureDetail.js")),
|
|
20
20
|
}));
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
declare const configSchema: (pluginManager: PluginManager) => import("
|
|
2
|
+
declare const configSchema: (pluginManager: PluginManager) => import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
3
3
|
name: {
|
|
4
4
|
description: string;
|
|
5
5
|
type: string;
|
|
@@ -25,8 +25,13 @@ declare const configSchema: (pluginManager: PluginManager) => import("@jbrowse/c
|
|
|
25
25
|
description: string;
|
|
26
26
|
defaultValue: {};
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
rpcDriverName: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
defaultValue: string;
|
|
32
|
+
};
|
|
33
|
+
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
34
|
+
textSearching: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
30
35
|
indexingAttributes: {
|
|
31
36
|
type: string;
|
|
32
37
|
description: string;
|
|
@@ -37,10 +42,10 @@ declare const configSchema: (pluginManager: PluginManager) => import("@jbrowse/c
|
|
|
37
42
|
description: string;
|
|
38
43
|
defaultValue: string[];
|
|
39
44
|
};
|
|
40
|
-
textSearchAdapter: import("mobx-state-tree").IAnyModelType;
|
|
41
|
-
}, import("
|
|
42
|
-
displays: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
43
|
-
formatDetails: import("
|
|
45
|
+
textSearchAdapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
46
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
47
|
+
displays: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IAnyModelType>;
|
|
48
|
+
formatDetails: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
44
49
|
feature: {
|
|
45
50
|
type: string;
|
|
46
51
|
description: string;
|
|
@@ -63,8 +68,8 @@ declare const configSchema: (pluginManager: PluginManager) => import("@jbrowse/c
|
|
|
63
68
|
defaultValue: number;
|
|
64
69
|
description: string;
|
|
65
70
|
};
|
|
66
|
-
}, import("
|
|
67
|
-
formatAbout: import("
|
|
71
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
72
|
+
formatAbout: import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
68
73
|
config: {
|
|
69
74
|
type: string;
|
|
70
75
|
description: string;
|
|
@@ -75,6 +80,6 @@ declare const configSchema: (pluginManager: PluginManager) => import("@jbrowse/c
|
|
|
75
80
|
type: string;
|
|
76
81
|
defaultValue: boolean;
|
|
77
82
|
};
|
|
78
|
-
}, import("
|
|
79
|
-
}, import("
|
|
83
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
84
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "trackId">>, undefined>>;
|
|
80
85
|
export default configSchema;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
|
|
2
2
|
import { createBaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
|
-
import configSchemaF from
|
|
3
|
+
import configSchemaF from "./configSchema.js";
|
|
4
4
|
export default function registerSyntenyTrack(pluginManager) {
|
|
5
5
|
pluginManager.addTrackType(() => {
|
|
6
6
|
const configSchema = configSchemaF(pluginManager);
|
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
2
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
export type { LinearSyntenyImportFormSyntenyOption } from './LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.tsx';
|
|
4
|
+
export type { LinearSyntenyViewModel } from './LinearSyntenyView/model.ts';
|
|
3
5
|
export default class LinearComparativeViewPlugin extends Plugin {
|
|
4
6
|
name: string;
|
|
5
7
|
install(pluginManager: PluginManager): void;
|
package/esm/index.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
2
|
import { isAbstractMenuManager } from '@jbrowse/core/util';
|
|
3
3
|
import CalendarIcon from '@mui/icons-material/CalendarViewDay';
|
|
4
|
-
import LGVSyntenyDisplayF from
|
|
5
|
-
import LaunchLinearSyntenyViewF from
|
|
6
|
-
import LinearComparativeDisplayF from
|
|
7
|
-
import LinearComparativeViewF from
|
|
8
|
-
import LinearReadVsRefMenuItemF from
|
|
9
|
-
import LinearSyntenyDisplayF from
|
|
10
|
-
import LinearSyntenyViewF from
|
|
11
|
-
import LinearSyntenyViewHelperF from
|
|
12
|
-
import SyntenyFeatureWidgetF from
|
|
13
|
-
import SyntenyTrackF from
|
|
4
|
+
import LGVSyntenyDisplayF from "./LGVSyntenyDisplay/index.js";
|
|
5
|
+
import LaunchLinearSyntenyViewF from "./LaunchLinearSyntenyView.js";
|
|
6
|
+
import LinearComparativeDisplayF from "./LinearComparativeDisplay/index.js";
|
|
7
|
+
import LinearComparativeViewF from "./LinearComparativeView/index.js";
|
|
8
|
+
import LinearReadVsRefMenuItemF from "./LinearReadVsRef/index.js";
|
|
9
|
+
import LinearSyntenyDisplayF from "./LinearSyntenyDisplay/index.js";
|
|
10
|
+
import LinearSyntenyViewF from "./LinearSyntenyView/index.js";
|
|
11
|
+
import LinearSyntenyViewHelperF from "./LinearSyntenyViewHelper/index.js";
|
|
12
|
+
import SyntenyFeatureWidgetF from "./SyntenyFeatureDetail/index.js";
|
|
13
|
+
import SyntenyTrackF from "./SyntenyTrack/index.js";
|
|
14
14
|
export default class LinearComparativeViewPlugin extends Plugin {
|
|
15
|
-
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.name = 'LinearComparativeViewPlugin';
|
|
18
|
-
}
|
|
15
|
+
name = 'LinearComparativeViewPlugin';
|
|
19
16
|
install(pluginManager) {
|
|
20
17
|
LinearSyntenyViewHelperF(pluginManager);
|
|
21
18
|
LinearComparativeViewF(pluginManager);
|