@jbrowse/plugin-circular-view 2.17.0 → 2.18.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/BaseChordDisplay/components/BaseChordDisplay.js +5 -4
- package/dist/BaseChordDisplay/components/Loading.js +1 -2
- package/dist/BaseChordDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -3
- package/dist/BaseChordDisplay/{models/configSchema.js → configSchema.js} +1 -10
- package/dist/BaseChordDisplay/index.d.ts +2 -2
- package/dist/BaseChordDisplay/index.js +2 -2
- package/{esm/BaseChordDisplay/models → dist/BaseChordDisplay}/model.d.ts +11 -52
- package/dist/BaseChordDisplay/{models/model.js → model.js} +29 -89
- package/dist/BaseChordDisplay/renderReaction.d.ts +27 -0
- package/dist/BaseChordDisplay/{models/renderReaction.js → renderReaction.js} +5 -13
- package/dist/CircularView/components/CircularView.d.ts +1 -1
- package/dist/CircularView/components/CircularView.js +2 -3
- package/dist/CircularView/components/Controls.d.ts +1 -1
- package/dist/CircularView/components/Controls.js +11 -12
- package/dist/CircularView/components/ExportSvgDialog.d.ts +1 -1
- package/dist/CircularView/components/ExportSvgDialog.js +2 -4
- package/dist/CircularView/components/ImportForm.d.ts +1 -1
- package/dist/CircularView/components/ImportForm.js +3 -3
- package/dist/CircularView/components/Ruler.d.ts +2 -2
- package/dist/CircularView/components/Ruler.js +1 -7
- package/dist/CircularView/index.d.ts +1 -1
- package/dist/CircularView/index.js +1 -1
- package/dist/CircularView/{models/model.d.ts → model.d.ts} +9 -158
- package/dist/CircularView/{models/model.js → model.js} +8 -217
- package/dist/CircularView/{models/slices.d.ts → slices.d.ts} +1 -1
- package/dist/CircularView/svgcomponents/SVGBackground.js +1 -1
- package/dist/CircularView/svgcomponents/SVGCircularView.d.ts +1 -1
- package/dist/CircularView/svgcomponents/SVGCircularView.js +4 -9
- package/dist/CircularView/{models/viewportVisibleRegion.js → viewportVisibleRegion.js} +0 -70
- package/dist/LaunchCircularView/index.d.ts +1 -1
- package/dist/LaunchCircularView/index.js +1 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -7
- package/esm/BaseChordDisplay/components/BaseChordDisplay.js +5 -4
- package/esm/BaseChordDisplay/components/Loading.js +2 -3
- package/esm/BaseChordDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -3
- package/esm/BaseChordDisplay/{models/configSchema.js → configSchema.js} +1 -10
- package/esm/BaseChordDisplay/index.d.ts +2 -2
- package/esm/BaseChordDisplay/index.js +2 -2
- package/{dist/BaseChordDisplay/models → esm/BaseChordDisplay}/model.d.ts +11 -52
- package/esm/BaseChordDisplay/{models/model.js → model.js} +30 -90
- package/esm/BaseChordDisplay/renderReaction.d.ts +27 -0
- package/esm/BaseChordDisplay/{models/renderReaction.js → renderReaction.js} +5 -10
- package/esm/CircularView/components/CircularView.d.ts +1 -1
- package/esm/CircularView/components/CircularView.js +2 -3
- package/esm/CircularView/components/Controls.d.ts +1 -1
- package/esm/CircularView/components/Controls.js +11 -12
- package/esm/CircularView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/CircularView/components/ExportSvgDialog.js +2 -4
- package/esm/CircularView/components/ImportForm.d.ts +1 -1
- package/esm/CircularView/components/ImportForm.js +3 -3
- package/esm/CircularView/components/Ruler.d.ts +2 -2
- package/esm/CircularView/components/Ruler.js +2 -8
- package/esm/CircularView/index.d.ts +1 -1
- package/esm/CircularView/index.js +1 -1
- package/esm/CircularView/{models/model.d.ts → model.d.ts} +9 -158
- package/esm/CircularView/{models/model.js → model.js} +9 -218
- package/esm/CircularView/{models/slices.d.ts → slices.d.ts} +1 -1
- package/esm/CircularView/{models/slices.js → slices.js} +1 -1
- package/esm/CircularView/svgcomponents/SVGBackground.js +1 -1
- package/esm/CircularView/svgcomponents/SVGCircularView.d.ts +1 -1
- package/esm/CircularView/svgcomponents/SVGCircularView.js +4 -9
- package/esm/CircularView/{models/viewportVisibleRegion.js → viewportVisibleRegion.js} +0 -70
- package/esm/LaunchCircularView/index.d.ts +1 -1
- package/esm/LaunchCircularView/index.js +1 -3
- package/esm/index.d.ts +3 -3
- package/esm/index.js +3 -5
- package/package.json +2 -3
- package/dist/BaseChordDisplay/models/renderReaction.d.ts +0 -45
- package/esm/BaseChordDisplay/models/renderReaction.d.ts +0 -45
- /package/dist/CircularView/{models/slices.js → slices.js} +0 -0
- /package/dist/CircularView/{models/viewportVisibleRegion.d.ts → viewportVisibleRegion.d.ts} +0 -0
- /package/esm/CircularView/{models/viewportVisibleRegion.d.ts → viewportVisibleRegion.d.ts} +0 -0
|
@@ -5,16 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
// locals
|
|
9
|
-
const Loading_1 = __importDefault(require("./Loading"));
|
|
10
8
|
const DisplayError_1 = __importDefault(require("./DisplayError"));
|
|
9
|
+
const Loading_1 = __importDefault(require("./Loading"));
|
|
11
10
|
const BaseChordDisplay = (0, mobx_react_1.observer)(function ({ display, }) {
|
|
12
11
|
if (display.error) {
|
|
13
12
|
return react_1.default.createElement(DisplayError_1.default, { model: display });
|
|
14
13
|
}
|
|
15
|
-
if (!display.filled) {
|
|
14
|
+
else if (!display.filled) {
|
|
16
15
|
return react_1.default.createElement(Loading_1.default, { model: display });
|
|
17
16
|
}
|
|
18
|
-
|
|
17
|
+
else {
|
|
18
|
+
return display.reactElement;
|
|
19
|
+
}
|
|
19
20
|
});
|
|
20
21
|
exports.default = BaseChordDisplay;
|
|
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const react_1 = __importStar(require("react"));
|
|
27
|
-
const mui_1 = require("tss-react/mui");
|
|
28
27
|
const mobx_react_1 = require("mobx-react");
|
|
28
|
+
const mui_1 = require("tss-react/mui");
|
|
29
29
|
const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
30
30
|
const offset = 2;
|
|
31
31
|
const duration = 1.4;
|
|
@@ -70,7 +70,6 @@ const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
|
70
70
|
});
|
|
71
71
|
const Loading = (0, mobx_react_1.observer)(function ({ model: { renderProps: { radius }, }, }) {
|
|
72
72
|
const { classes } = useStyles();
|
|
73
|
-
// only show the loading message after 400ms to prevent excessive flickering
|
|
74
73
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
75
74
|
(0, react_1.useEffect)(() => {
|
|
76
75
|
const timeout = setTimeout(() => {
|
|
@@ -2,14 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.baseChordDisplayConfig = void 0;
|
|
4
4
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
-
|
|
6
|
-
* #config BaseChordDisplay
|
|
7
|
-
*/
|
|
8
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
function x() { }
|
|
9
6
|
const baseChordDisplayConfig = (0, configuration_1.ConfigurationSchema)('BaseChordDisplay', {
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
7
|
onChordClick: {
|
|
14
8
|
type: 'boolean',
|
|
15
9
|
description: 'callback that should be run when a chord in the track is clicked',
|
|
@@ -17,9 +11,6 @@ const baseChordDisplayConfig = (0, configuration_1.ConfigurationSchema)('BaseCho
|
|
|
17
11
|
contextVariable: ['feature', 'track', 'pluginManager'],
|
|
18
12
|
},
|
|
19
13
|
}, {
|
|
20
|
-
/**
|
|
21
|
-
* #identifier
|
|
22
|
-
*/
|
|
23
14
|
explicitIdentifier: 'displayId',
|
|
24
15
|
});
|
|
25
16
|
exports.baseChordDisplayConfig = baseChordDisplayConfig;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as BaseChordDisplayComponent } from './components/BaseChordDisplay';
|
|
2
|
-
export { BaseChordDisplayModel } from './
|
|
3
|
-
export { baseChordDisplayConfig } from './
|
|
2
|
+
export { BaseChordDisplayModel } from './model';
|
|
3
|
+
export { baseChordDisplayConfig } from './configSchema';
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.baseChordDisplayConfig = exports.BaseChordDisplayModel = exports.BaseChordDisplayComponent = void 0;
|
|
7
7
|
var BaseChordDisplay_1 = require("./components/BaseChordDisplay");
|
|
8
8
|
Object.defineProperty(exports, "BaseChordDisplayComponent", { enumerable: true, get: function () { return __importDefault(BaseChordDisplay_1).default; } });
|
|
9
|
-
var model_1 = require("./
|
|
9
|
+
var model_1 = require("./model");
|
|
10
10
|
Object.defineProperty(exports, "BaseChordDisplayModel", { enumerable: true, get: function () { return model_1.BaseChordDisplayModel; } });
|
|
11
|
-
var configSchema_1 = require("./
|
|
11
|
+
var configSchema_1 = require("./configSchema");
|
|
12
12
|
Object.defineProperty(exports, "baseChordDisplayConfig", { enumerable: true, get: function () { return configSchema_1.baseChordDisplayConfig; } });
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { ExportSvgOptions } from '../../CircularView/models/model';
|
|
6
|
-
import { ThemeOptions } from '@mui/material';
|
|
2
|
+
import type { ExportSvgOptions } from '../CircularView/model';
|
|
3
|
+
import type { AnyReactComponentType, Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { ThemeOptions } from '@mui/material';
|
|
7
5
|
export declare const BaseChordDisplayModel: import("mobx-state-tree").IModelType<{
|
|
8
6
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
9
7
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -54,9 +52,7 @@ export declare const BaseChordDisplayModel: import("mobx-state-tree").IModelType
|
|
|
54
52
|
rendererTypeName: string;
|
|
55
53
|
error: unknown;
|
|
56
54
|
message: string | undefined;
|
|
57
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree"
|
|
58
|
-
* #getter
|
|
59
|
-
*/).IModelType<{
|
|
55
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
60
56
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
61
57
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
62
58
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -88,63 +84,26 @@ export declare const BaseChordDisplayModel: import("mobx-state-tree").IModelType
|
|
|
88
84
|
renderingComponent: undefined | AnyReactComponentType;
|
|
89
85
|
refNameMap: Record<string, string> | undefined;
|
|
90
86
|
} & {
|
|
91
|
-
/**
|
|
92
|
-
* #action
|
|
93
|
-
*/
|
|
94
87
|
onChordClick(feature: Feature): void;
|
|
95
88
|
} & {
|
|
96
|
-
|
|
97
|
-
* #getter
|
|
98
|
-
*/
|
|
99
|
-
readonly blockDefinitions: import("../../CircularView/models/slices").Slice[];
|
|
100
|
-
/**
|
|
101
|
-
* #method
|
|
102
|
-
*/
|
|
89
|
+
readonly blockDefinitions: import("../CircularView/slices").Slice[];
|
|
103
90
|
renderProps(): any;
|
|
104
|
-
|
|
105
|
-
* #getter
|
|
106
|
-
* the pluggable element type object for this display's renderer
|
|
107
|
-
*/
|
|
108
|
-
readonly rendererType: RendererType | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* #method
|
|
111
|
-
*/
|
|
112
|
-
isCompatibleWithRenderer(renderer: RendererType): renderer is CircularChordRendererType;
|
|
113
|
-
/**
|
|
114
|
-
* #getter
|
|
115
|
-
* returns a string feature ID if the globally-selected object
|
|
116
|
-
* is probably a feature
|
|
117
|
-
*/
|
|
91
|
+
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType | undefined;
|
|
118
92
|
readonly selectedFeatureId: string | undefined;
|
|
119
93
|
} & {
|
|
120
|
-
/**
|
|
121
|
-
* #action
|
|
122
|
-
*/
|
|
123
94
|
renderStarted(): void;
|
|
124
|
-
/**
|
|
125
|
-
* #action
|
|
126
|
-
*/
|
|
127
95
|
renderSuccess({ message, data, reactElement, html, renderingComponent, }: {
|
|
128
|
-
message
|
|
129
|
-
data
|
|
130
|
-
html
|
|
131
|
-
reactElement
|
|
132
|
-
renderingComponent
|
|
96
|
+
message?: string;
|
|
97
|
+
data?: any;
|
|
98
|
+
html?: string;
|
|
99
|
+
reactElement?: React.ReactElement;
|
|
100
|
+
renderingComponent?: AnyReactComponentType;
|
|
133
101
|
}): void;
|
|
134
|
-
/**
|
|
135
|
-
* #action
|
|
136
|
-
*/
|
|
137
102
|
renderError(error: unknown): void;
|
|
138
|
-
/**
|
|
139
|
-
* #action
|
|
140
|
-
*/
|
|
141
103
|
setRefNameMap(refNameMap: Record<string, string>): void;
|
|
142
104
|
} & {
|
|
143
105
|
afterAttach(): void;
|
|
144
106
|
} & {
|
|
145
|
-
/**
|
|
146
|
-
* #method
|
|
147
|
-
*/
|
|
148
107
|
renderSvg(opts: ExportSvgOptions & {
|
|
149
108
|
theme?: ThemeOptions;
|
|
150
109
|
}): Promise<React.JSX.Element>;
|
|
@@ -5,41 +5,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BaseChordDisplayModel = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const clone_1 = __importDefault(require("clone"));
|
|
9
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
10
|
-
// jbrowse
|
|
11
8
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
12
9
|
const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
|
|
13
|
-
const CircularChordRendererType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/renderers/CircularChordRendererType"));
|
|
14
10
|
const util_1 = require("@jbrowse/core/util");
|
|
15
11
|
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
16
|
-
|
|
17
|
-
const renderReaction_1 = require("./renderReaction");
|
|
12
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
18
13
|
const configSchema_1 = require("./configSchema");
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* extends
|
|
22
|
-
* - [BaseDisplay](../basedisplay)
|
|
23
|
-
*/
|
|
24
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
14
|
+
const renderReaction_1 = require("./renderReaction");
|
|
15
|
+
function x() { }
|
|
25
16
|
exports.BaseChordDisplayModel = mobx_state_tree_1.types
|
|
26
17
|
.compose('BaseChordDisplay', models_1.BaseDisplay, mobx_state_tree_1.types.model({
|
|
27
|
-
/**
|
|
28
|
-
* #property
|
|
29
|
-
*/
|
|
30
18
|
bezierRadiusRatio: 0.1,
|
|
31
|
-
/**
|
|
32
|
-
* #property
|
|
33
|
-
*/
|
|
34
19
|
assemblyName: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
35
|
-
/**
|
|
36
|
-
* #property
|
|
37
|
-
*/
|
|
38
20
|
configuration: (0, configuration_1.ConfigurationReference)(configSchema_1.baseChordDisplayConfig),
|
|
39
21
|
}))
|
|
40
22
|
.volatile(() => ({
|
|
41
|
-
// NOTE: all this volatile stuff has to be filled in at once
|
|
42
|
-
// so that it stays consistent
|
|
43
23
|
filled: false,
|
|
44
24
|
reactElement: undefined,
|
|
45
25
|
data: undefined,
|
|
@@ -52,42 +32,32 @@ exports.BaseChordDisplayModel = mobx_state_tree_1.types
|
|
|
52
32
|
const { pluginManager } = (0, util_1.getEnv)(self);
|
|
53
33
|
const track = self;
|
|
54
34
|
return {
|
|
55
|
-
/**
|
|
56
|
-
* #action
|
|
57
|
-
*/
|
|
58
35
|
onChordClick(feature) {
|
|
59
36
|
(0, configuration_1.getConf)(self, 'onChordClick', { feature, track, pluginManager });
|
|
60
37
|
},
|
|
61
38
|
};
|
|
62
39
|
})
|
|
63
40
|
.views(self => ({
|
|
64
|
-
/**
|
|
65
|
-
* #getter
|
|
66
|
-
*/
|
|
67
41
|
get blockDefinitions() {
|
|
68
42
|
const view = (0, util_1.getContainingView)(self);
|
|
69
43
|
const origSlices = view.staticSlices;
|
|
70
44
|
if (!self.refNameMap) {
|
|
71
45
|
return origSlices;
|
|
72
46
|
}
|
|
73
|
-
const slices = (
|
|
74
|
-
|
|
47
|
+
const slices = structuredClone(origSlices);
|
|
48
|
+
for (const slice of slices) {
|
|
75
49
|
const regions = slice.region.elided
|
|
76
50
|
? slice.region.regions
|
|
77
51
|
: [slice.region];
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const renamed = (_a = self.refNameMap) === null || _a === void 0 ? void 0 : _a[region.refName];
|
|
52
|
+
for (const region of regions) {
|
|
53
|
+
const renamed = self.refNameMap[region.refName];
|
|
81
54
|
if (renamed && region.refName !== renamed) {
|
|
82
55
|
region.refName = renamed;
|
|
83
56
|
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
86
59
|
return slices;
|
|
87
60
|
},
|
|
88
|
-
/**
|
|
89
|
-
* #method
|
|
90
|
-
*/
|
|
91
61
|
renderProps() {
|
|
92
62
|
const view = (0, util_1.getContainingView)(self);
|
|
93
63
|
return {
|
|
@@ -99,41 +69,18 @@ exports.BaseChordDisplayModel = mobx_state_tree_1.types
|
|
|
99
69
|
onChordClick: self.onChordClick,
|
|
100
70
|
};
|
|
101
71
|
},
|
|
102
|
-
/**
|
|
103
|
-
* #getter
|
|
104
|
-
* the pluggable element type object for this display's renderer
|
|
105
|
-
*/
|
|
106
72
|
get rendererType() {
|
|
107
73
|
return (0, util_1.getEnv)(self).pluginManager.getRendererType(self.rendererTypeName);
|
|
108
74
|
},
|
|
109
|
-
/**
|
|
110
|
-
* #method
|
|
111
|
-
*/
|
|
112
|
-
isCompatibleWithRenderer(renderer) {
|
|
113
|
-
return !!(renderer instanceof CircularChordRendererType_1.default);
|
|
114
|
-
},
|
|
115
|
-
/**
|
|
116
|
-
* #getter
|
|
117
|
-
* returns a string feature ID if the globally-selected object
|
|
118
|
-
* is probably a feature
|
|
119
|
-
*/
|
|
120
75
|
get selectedFeatureId() {
|
|
121
76
|
if (!(0, mobx_state_tree_1.isAlive)(self)) {
|
|
122
77
|
return undefined;
|
|
123
78
|
}
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
// does it quack like a feature?
|
|
127
|
-
if ((0, util_1.isFeature)(selection)) {
|
|
128
|
-
return selection.id();
|
|
129
|
-
}
|
|
130
|
-
return undefined;
|
|
79
|
+
const { selection } = (0, util_1.getSession)(self);
|
|
80
|
+
return (0, util_1.isFeature)(selection) ? selection.id() : undefined;
|
|
131
81
|
},
|
|
132
82
|
}))
|
|
133
83
|
.actions(self => ({
|
|
134
|
-
/**
|
|
135
|
-
* #action
|
|
136
|
-
*/
|
|
137
84
|
renderStarted() {
|
|
138
85
|
self.filled = false;
|
|
139
86
|
self.message = '';
|
|
@@ -143,9 +90,6 @@ exports.BaseChordDisplayModel = mobx_state_tree_1.types
|
|
|
143
90
|
self.error = undefined;
|
|
144
91
|
self.renderingComponent = undefined;
|
|
145
92
|
},
|
|
146
|
-
/**
|
|
147
|
-
* #action
|
|
148
|
-
*/
|
|
149
93
|
renderSuccess({ message, data, reactElement, html, renderingComponent, }) {
|
|
150
94
|
if (message) {
|
|
151
95
|
self.filled = false;
|
|
@@ -166,12 +110,8 @@ exports.BaseChordDisplayModel = mobx_state_tree_1.types
|
|
|
166
110
|
self.renderingComponent = renderingComponent;
|
|
167
111
|
}
|
|
168
112
|
},
|
|
169
|
-
/**
|
|
170
|
-
* #action
|
|
171
|
-
*/
|
|
172
113
|
renderError(error) {
|
|
173
114
|
console.error(error);
|
|
174
|
-
// the rendering failed for some reason
|
|
175
115
|
self.filled = false;
|
|
176
116
|
self.message = '';
|
|
177
117
|
self.reactElement = undefined;
|
|
@@ -180,33 +120,36 @@ exports.BaseChordDisplayModel = mobx_state_tree_1.types
|
|
|
180
120
|
self.error = error;
|
|
181
121
|
self.renderingComponent = undefined;
|
|
182
122
|
},
|
|
183
|
-
/**
|
|
184
|
-
* #action
|
|
185
|
-
*/
|
|
186
123
|
setRefNameMap(refNameMap) {
|
|
187
124
|
self.refNameMap = refNameMap;
|
|
188
125
|
},
|
|
189
126
|
}))
|
|
190
127
|
.actions(self => ({
|
|
191
128
|
afterAttach() {
|
|
192
|
-
(0, util_1.makeAbortableReaction)(self, renderReaction_1.renderReactionData,
|
|
193
|
-
// @ts-expect-error
|
|
194
|
-
renderReaction_1.renderReactionEffect, {
|
|
129
|
+
(0, util_1.makeAbortableReaction)(self, renderReaction_1.renderReactionData, renderReaction_1.renderReactionEffect, {
|
|
195
130
|
name: `${self.type} ${self.id} rendering`,
|
|
196
|
-
// delay: self.renderDelay || 300,
|
|
197
131
|
fireImmediately: true,
|
|
198
132
|
}, self.renderStarted, self.renderSuccess, self.renderError);
|
|
199
|
-
(0, util_1.makeAbortableReaction)(self, () =>
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
133
|
+
(0, util_1.makeAbortableReaction)(self, () => {
|
|
134
|
+
return {
|
|
135
|
+
assemblyNames: (0, tracks_1.getTrackAssemblyNames)(self.parentTrack),
|
|
136
|
+
adapter: (0, configuration_1.getConf)((0, mobx_state_tree_1.getParent)(self, 2), 'adapter'),
|
|
137
|
+
assemblyManager: (0, util_1.getSession)(self).assemblyManager,
|
|
138
|
+
};
|
|
139
|
+
}, async (args, stopToken) => {
|
|
140
|
+
return args
|
|
141
|
+
? args.assemblyManager.getRefNameMapForAdapter(args.adapter, args.assemblyNames[0], {
|
|
142
|
+
stopToken,
|
|
143
|
+
sessionId: (0, tracks_1.getRpcSessionId)(self),
|
|
144
|
+
})
|
|
145
|
+
: undefined;
|
|
205
146
|
}, {
|
|
206
147
|
name: `${self.type} ${self.id} getting refNames`,
|
|
207
148
|
fireImmediately: true,
|
|
208
149
|
}, () => { }, refNameMap => {
|
|
209
|
-
|
|
150
|
+
if (refNameMap) {
|
|
151
|
+
self.setRefNameMap(refNameMap);
|
|
152
|
+
}
|
|
210
153
|
}, error => {
|
|
211
154
|
console.error(error);
|
|
212
155
|
self.setError(error);
|
|
@@ -214,16 +157,13 @@ exports.BaseChordDisplayModel = mobx_state_tree_1.types
|
|
|
214
157
|
},
|
|
215
158
|
}))
|
|
216
159
|
.views(self => ({
|
|
217
|
-
/**
|
|
218
|
-
* #method
|
|
219
|
-
*/
|
|
220
160
|
async renderSvg(opts) {
|
|
221
161
|
const data = (0, renderReaction_1.renderReactionData)(self);
|
|
222
162
|
const rendering = await (0, renderReaction_1.renderReactionEffect)({
|
|
223
163
|
...data,
|
|
224
164
|
exportSVG: opts,
|
|
225
165
|
theme: opts.theme || data.renderProps.theme,
|
|
226
|
-
}
|
|
166
|
+
});
|
|
227
167
|
return react_1.default.createElement(util_1.ReactRendering, { rendering: rendering });
|
|
228
168
|
},
|
|
229
169
|
}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function renderReactionData(self: any): {
|
|
2
|
+
rendererType: any;
|
|
3
|
+
rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
|
|
4
|
+
renderProps: any;
|
|
5
|
+
renderArgs: {
|
|
6
|
+
assemblyName: string;
|
|
7
|
+
adapterConfig: any;
|
|
8
|
+
rendererType: any;
|
|
9
|
+
regions: import("@jbrowse/core/util").Region[] & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>>;
|
|
10
|
+
blockDefinitions: any;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
timeout: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function renderReactionEffect(props?: any, stopToken?: string): Promise<{
|
|
16
|
+
message: any;
|
|
17
|
+
html?: undefined;
|
|
18
|
+
data?: undefined;
|
|
19
|
+
reactElement?: undefined;
|
|
20
|
+
renderingComponent?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
html: any;
|
|
23
|
+
data: any;
|
|
24
|
+
reactElement: any;
|
|
25
|
+
renderingComponent: any;
|
|
26
|
+
message?: undefined;
|
|
27
|
+
}>;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.renderReactionData = renderReactionData;
|
|
7
4
|
exports.renderReactionEffect = renderReactionEffect;
|
|
8
|
-
const clone_1 = __importDefault(require("clone"));
|
|
9
|
-
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
10
5
|
const util_1 = require("@jbrowse/core/util");
|
|
6
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
11
7
|
function renderReactionData(self) {
|
|
12
8
|
const view = (0, util_1.getContainingView)(self);
|
|
13
9
|
const { rendererType } = self;
|
|
@@ -18,16 +14,16 @@ function renderReactionData(self) {
|
|
|
18
14
|
renderProps: self.renderProps(),
|
|
19
15
|
renderArgs: {
|
|
20
16
|
assemblyName: view.displayedRegions[0].assemblyName,
|
|
21
|
-
adapterConfig: (
|
|
17
|
+
adapterConfig: structuredClone(self.adapterConfig),
|
|
22
18
|
rendererType: rendererType.name,
|
|
23
|
-
regions: (
|
|
19
|
+
regions: structuredClone(view.displayedRegions),
|
|
24
20
|
blockDefinitions: self.blockDefinitions,
|
|
25
21
|
sessionId: (0, tracks_1.getRpcSessionId)(self),
|
|
26
22
|
timeout: 1000000,
|
|
27
23
|
},
|
|
28
24
|
};
|
|
29
25
|
}
|
|
30
|
-
async function renderReactionEffect(props,
|
|
26
|
+
async function renderReactionEffect(props, stopToken) {
|
|
31
27
|
var _a;
|
|
32
28
|
if (!props) {
|
|
33
29
|
throw new Error('cannot render with no props');
|
|
@@ -36,18 +32,14 @@ async function renderReactionEffect(props, signal, self) {
|
|
|
36
32
|
if (cannotBeRenderedReason) {
|
|
37
33
|
return { message: cannotBeRenderedReason };
|
|
38
34
|
}
|
|
39
|
-
// don't try to render 0 or NaN radius or no regions
|
|
40
35
|
if (!renderProps.radius || !((_a = renderArgs.regions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
41
36
|
return { message: 'Skipping render' };
|
|
42
37
|
}
|
|
43
|
-
// check renderertype compatibility
|
|
44
|
-
if (!self.isCompatibleWithRenderer(rendererType)) {
|
|
45
|
-
throw new Error(`renderer ${rendererType.name} is not compatible with this display type`);
|
|
46
|
-
}
|
|
47
38
|
const { html, ...data } = await rendererType.renderInClient(rpcManager, {
|
|
48
39
|
...renderArgs,
|
|
49
40
|
...renderProps,
|
|
50
41
|
exportSVG,
|
|
42
|
+
stopToken,
|
|
51
43
|
});
|
|
52
44
|
return {
|
|
53
45
|
html,
|
|
@@ -4,14 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
8
7
|
const ui_1 = require("@jbrowse/core/ui");
|
|
9
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
|
+
const mobx_react_1 = require("mobx-react");
|
|
10
10
|
const mui_1 = require("tss-react/mui");
|
|
11
|
-
// locals
|
|
12
|
-
const Ruler_1 = __importDefault(require("./Ruler"));
|
|
13
11
|
const Controls_1 = __importDefault(require("./Controls"));
|
|
14
12
|
const ImportForm_1 = __importDefault(require("./ImportForm"));
|
|
13
|
+
const Ruler_1 = __importDefault(require("./Ruler"));
|
|
15
14
|
const dragHandleHeight = 3;
|
|
16
15
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
17
16
|
root: {
|
|
@@ -27,21 +27,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
|
-
const mui_1 = require("tss-react/mui");
|
|
30
|
+
const Icons_1 = require("@jbrowse/core/ui/Icons");
|
|
33
31
|
const Menu_1 = __importDefault(require("@jbrowse/core/ui/Menu"));
|
|
34
|
-
|
|
35
|
-
const ZoomOut_1 = __importDefault(require("@mui/icons-material/ZoomOut"));
|
|
36
|
-
const ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
|
|
37
|
-
const RotateLeft_1 = __importDefault(require("@mui/icons-material/RotateLeft"));
|
|
38
|
-
const RotateRight_1 = __importDefault(require("@mui/icons-material/RotateRight"));
|
|
39
|
-
const LockOpen_1 = __importDefault(require("@mui/icons-material/LockOpen"));
|
|
32
|
+
const util_1 = require("@jbrowse/core/util");
|
|
40
33
|
const Lock_1 = __importDefault(require("@mui/icons-material/Lock"));
|
|
41
|
-
const
|
|
34
|
+
const LockOpen_1 = __importDefault(require("@mui/icons-material/LockOpen"));
|
|
42
35
|
const MoreVert_1 = __importDefault(require("@mui/icons-material/MoreVert"));
|
|
43
|
-
const
|
|
44
|
-
const
|
|
36
|
+
const PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
|
|
37
|
+
const RotateLeft_1 = __importDefault(require("@mui/icons-material/RotateLeft"));
|
|
38
|
+
const RotateRight_1 = __importDefault(require("@mui/icons-material/RotateRight"));
|
|
39
|
+
const ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
|
|
40
|
+
const ZoomOut_1 = __importDefault(require("@mui/icons-material/ZoomOut"));
|
|
41
|
+
const material_1 = require("@mui/material");
|
|
42
|
+
const mobx_react_1 = require("mobx-react");
|
|
43
|
+
const mui_1 = require("tss-react/mui");
|
|
45
44
|
const ExportSvgDialog_1 = __importDefault(require("./ExportSvgDialog"));
|
|
46
45
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
47
46
|
controls: {
|
|
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.default = ExportSvgDialog;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const material_1 = require("@mui/material");
|
|
29
28
|
const ui_1 = require("@jbrowse/core/ui");
|
|
30
29
|
const util_1 = require("@jbrowse/core/util");
|
|
30
|
+
const material_1 = require("@mui/material");
|
|
31
31
|
function LoadingMessage() {
|
|
32
32
|
return (react_1.default.createElement("div", null,
|
|
33
33
|
react_1.default.createElement(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }),
|
|
@@ -56,9 +56,7 @@ function ExportSvgDialog({ model, handleClose, }) {
|
|
|
56
56
|
} }),
|
|
57
57
|
session.allThemes ? (react_1.default.createElement(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
|
|
58
58
|
setThemeName(event.target.value);
|
|
59
|
-
} }, Object.entries(session.allThemes()).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key },
|
|
60
|
-
// @ts-expect-error
|
|
61
|
-
val.name || '(Unknown name)'))))) : null,
|
|
59
|
+
} }, Object.entries(session.allThemes()).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key }, val.name || '(Unknown name)'))))) : null,
|
|
62
60
|
offscreenCanvas ? (react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => {
|
|
63
61
|
setRasterizeLayers(val => !val);
|
|
64
62
|
} }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (react_1.default.createElement(material_1.Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
|
|
@@ -24,11 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const react_1 = __importStar(require("react"));
|
|
27
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
28
|
+
const util_1 = require("@jbrowse/core/util");
|
|
27
29
|
const material_1 = require("@mui/material");
|
|
28
|
-
const mui_1 = require("tss-react/mui");
|
|
29
30
|
const mobx_react_1 = require("mobx-react");
|
|
30
|
-
const
|
|
31
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
31
|
+
const mui_1 = require("tss-react/mui");
|
|
32
32
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
33
33
|
importFormContainer: {
|
|
34
34
|
padding: theme.spacing(6),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { CircularViewModel } from '../model';
|
|
3
|
+
import type { Slice } from '../slices';
|
|
4
4
|
declare const Ruler: ({ model, slice, }: {
|
|
5
5
|
model: CircularViewModel;
|
|
6
6
|
slice: Slice;
|