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