@jbrowse/plugin-arc 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/ArcRenderer/ArcRendering.d.ts +2 -2
- package/dist/ArcRenderer/ArcRendering.js +0 -2
- package/dist/ArcRenderer/configSchema.d.ts +0 -18
- package/dist/ArcRenderer/configSchema.js +1 -22
- package/dist/ArcRenderer/index.d.ts +1 -1
- package/dist/ArcRenderer/index.js +1 -1
- package/dist/ArcTooltip.js +1 -1
- package/dist/LinearArcDisplay/configSchema.d.ts +1 -7
- package/dist/LinearArcDisplay/configSchema.js +1 -10
- package/dist/LinearArcDisplay/index.d.ts +1 -1
- package/dist/LinearArcDisplay/model.d.ts +12 -81
- package/dist/LinearArcDisplay/model.js +2 -40
- package/dist/LinearPairedArcDisplay/afterAttach.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/afterAttach.js +1 -1
- package/dist/LinearPairedArcDisplay/components/Arcs.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/components/Arcs.js +2 -2
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.js +4 -5
- package/dist/LinearPairedArcDisplay/components/ReactComponent.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/components/ReactComponent.js +1 -1
- package/dist/LinearPairedArcDisplay/components/util.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/components/util.js +0 -6
- package/dist/LinearPairedArcDisplay/configSchema.d.ts +0 -6
- package/dist/LinearPairedArcDisplay/configSchema.js +0 -9
- package/dist/LinearPairedArcDisplay/fetchChains.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/fetchChains.js +1 -2
- package/dist/LinearPairedArcDisplay/index.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/index.js +1 -1
- package/dist/LinearPairedArcDisplay/model.d.ts +8 -52
- package/dist/LinearPairedArcDisplay/model.js +2 -41
- package/dist/LinearPairedArcDisplay/renderSvg.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/util.d.ts +4 -4
- package/dist/LinearPairedArcDisplay/util.js +3 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/esm/ArcRenderer/ArcRendering.d.ts +2 -2
- package/esm/ArcRenderer/ArcRendering.js +2 -4
- package/esm/ArcRenderer/configSchema.d.ts +0 -18
- package/esm/ArcRenderer/configSchema.js +1 -22
- package/esm/ArcRenderer/index.d.ts +1 -1
- package/esm/ArcRenderer/index.js +1 -1
- package/esm/ArcTooltip.js +1 -1
- package/esm/LinearArcDisplay/configSchema.d.ts +1 -7
- package/esm/LinearArcDisplay/configSchema.js +1 -10
- package/esm/LinearArcDisplay/index.d.ts +1 -1
- package/esm/LinearArcDisplay/model.d.ts +12 -81
- package/esm/LinearArcDisplay/model.js +3 -41
- package/esm/LinearPairedArcDisplay/afterAttach.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/afterAttach.js +1 -1
- package/esm/LinearPairedArcDisplay/components/Arcs.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/Arcs.js +3 -3
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.js +4 -5
- package/esm/LinearPairedArcDisplay/components/ReactComponent.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/ReactComponent.js +1 -1
- package/esm/LinearPairedArcDisplay/components/util.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/util.js +0 -6
- package/esm/LinearPairedArcDisplay/configSchema.d.ts +0 -6
- package/esm/LinearPairedArcDisplay/configSchema.js +0 -9
- package/esm/LinearPairedArcDisplay/fetchChains.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/fetchChains.js +1 -2
- package/esm/LinearPairedArcDisplay/index.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/index.js +1 -1
- package/esm/LinearPairedArcDisplay/model.d.ts +8 -52
- package/esm/LinearPairedArcDisplay/model.js +3 -42
- package/esm/LinearPairedArcDisplay/renderSvg.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/util.d.ts +4 -4
- package/esm/LinearPairedArcDisplay/util.js +3 -14
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -3
- package/package.json +2 -2
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchChains = fetchChains;
|
|
4
4
|
const util_1 = require("@jbrowse/core/util");
|
|
5
5
|
async function fetchChains(self) {
|
|
6
|
-
// @ts-expect-error
|
|
7
6
|
const { rpcSessionId: sessionId } = (0, util_1.getContainingTrack)(self);
|
|
8
7
|
const { rpcManager } = (0, util_1.getSession)(self);
|
|
9
8
|
const view = (0, util_1.getContainingView)(self);
|
|
10
|
-
if (!view.initialized || self.error || self.
|
|
9
|
+
if (!view.initialized || self.error || !self.statsReadyAndRegionNotTooLarge) {
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
12
|
self.setLoading(true);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function LinearPairedArcDisplayF(pluginManager: PluginManager): void;
|
|
@@ -24,10 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.default = LinearPairedArcDisplayF;
|
|
27
|
+
const react_1 = require("react");
|
|
27
28
|
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
28
29
|
const configSchema_1 = require("./configSchema");
|
|
29
30
|
const model_1 = require("./model");
|
|
30
|
-
const react_1 = require("react");
|
|
31
31
|
function LinearPairedArcDisplayF(pluginManager) {
|
|
32
32
|
pluginManager.addDisplayType(() => {
|
|
33
33
|
const configSchema = (0, configSchema_1.configSchemaFactory)();
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
/**
|
|
6
|
-
* #stateModel LinearPairedArcDisplay
|
|
7
|
-
* this is a non-block-based track type, and can connect arcs across multiple
|
|
8
|
-
* displayedRegions
|
|
9
|
-
*
|
|
10
|
-
* extends
|
|
11
|
-
* - [BaseDisplay](../basedisplay)
|
|
12
|
-
* - [TrackHeightMixin](../trackheightmixin)
|
|
13
|
-
* - [FeatureDensityMixin](../featuredensitymixin)
|
|
14
|
-
*/
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { Instance } from 'mobx-state-tree';
|
|
15
5
|
export declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
16
6
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
17
7
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -22,17 +12,8 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
22
12
|
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
23
13
|
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
24
14
|
} & {
|
|
25
|
-
/**
|
|
26
|
-
* #property
|
|
27
|
-
*/
|
|
28
15
|
type: import("mobx-state-tree").ISimpleType<"LinearPairedArcDisplay">;
|
|
29
|
-
/**
|
|
30
|
-
* #property
|
|
31
|
-
*/
|
|
32
16
|
configuration: AnyConfigurationSchemaType;
|
|
33
|
-
/**
|
|
34
|
-
* #property
|
|
35
|
-
*/
|
|
36
17
|
displayMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
37
18
|
}, {
|
|
38
19
|
rendererTypeName: string;
|
|
@@ -49,22 +30,14 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
49
30
|
error: unknown;
|
|
50
31
|
message: string | undefined;
|
|
51
32
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
52
|
-
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree"
|
|
53
|
-
* #property
|
|
54
|
-
*/).ISimpleType<string>, [undefined]>;
|
|
33
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
55
34
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
56
|
-
rpcDriverName: import("mobx-state-tree").IMaybe<import(
|
|
57
|
-
/**
|
|
58
|
-
* #getter
|
|
59
|
-
*/
|
|
60
|
-
"mobx-state-tree").ISimpleType<string>>;
|
|
35
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
61
36
|
}, {
|
|
62
37
|
rendererTypeName: string;
|
|
63
38
|
error: unknown;
|
|
64
39
|
message: string | undefined;
|
|
65
|
-
}, import("mobx-state-tree"
|
|
66
|
-
* #action
|
|
67
|
-
*/)._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
40
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
68
41
|
onHorizontalScroll?: () => void;
|
|
69
42
|
blockState?: Record<string, any>;
|
|
70
43
|
}>;
|
|
@@ -131,6 +104,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
131
104
|
readonly regionTooLarge: boolean;
|
|
132
105
|
readonly regionTooLargeReason: string;
|
|
133
106
|
} & {
|
|
107
|
+
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
134
108
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
135
109
|
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): React.JSX.Element | null;
|
|
136
110
|
} & {
|
|
@@ -139,32 +113,14 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
139
113
|
loading: boolean;
|
|
140
114
|
drawn: boolean;
|
|
141
115
|
} & {
|
|
142
|
-
/**
|
|
143
|
-
* #getter
|
|
144
|
-
*/
|
|
145
116
|
readonly displayModeSetting: any;
|
|
146
117
|
} & {
|
|
147
|
-
/**
|
|
148
|
-
* #action
|
|
149
|
-
*/
|
|
150
118
|
selectFeature(feature: Feature): void;
|
|
151
|
-
/**
|
|
152
|
-
* #action
|
|
153
|
-
*/
|
|
154
119
|
setLoading(flag: boolean): void;
|
|
155
|
-
/**
|
|
156
|
-
* #action
|
|
157
|
-
*/
|
|
158
120
|
setFeatures(f: Feature[]): void;
|
|
159
|
-
/**
|
|
160
|
-
* #action
|
|
161
|
-
*/
|
|
162
121
|
setDisplayMode(flag: string): void;
|
|
163
122
|
} & {
|
|
164
123
|
afterAttach(): void;
|
|
165
|
-
/**
|
|
166
|
-
* #action
|
|
167
|
-
*/
|
|
168
124
|
renderSvg(opts: {
|
|
169
125
|
rasterizeLayers?: boolean;
|
|
170
126
|
}): Promise<React.ReactNode>;
|
|
@@ -25,34 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.stateModelFactory = stateModelFactory;
|
|
27
27
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
28
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
29
|
-
const util_1 = require("@jbrowse/core/util");
|
|
30
28
|
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
29
|
+
const util_1 = require("@jbrowse/core/util");
|
|
31
30
|
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
32
|
-
|
|
33
|
-
* #stateModel LinearPairedArcDisplay
|
|
34
|
-
* this is a non-block-based track type, and can connect arcs across multiple
|
|
35
|
-
* displayedRegions
|
|
36
|
-
*
|
|
37
|
-
* extends
|
|
38
|
-
* - [BaseDisplay](../basedisplay)
|
|
39
|
-
* - [TrackHeightMixin](../trackheightmixin)
|
|
40
|
-
* - [FeatureDensityMixin](../featuredensitymixin)
|
|
41
|
-
*/
|
|
31
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
32
|
function stateModelFactory(configSchema) {
|
|
43
33
|
return mobx_state_tree_1.types
|
|
44
34
|
.compose('LinearPairedArcDisplay', pluggableElementTypes_1.BaseDisplay, (0, plugin_linear_genome_view_1.TrackHeightMixin)(), (0, plugin_linear_genome_view_1.FeatureDensityMixin)(), mobx_state_tree_1.types.model({
|
|
45
|
-
/**
|
|
46
|
-
* #property
|
|
47
|
-
*/
|
|
48
35
|
type: mobx_state_tree_1.types.literal('LinearPairedArcDisplay'),
|
|
49
|
-
/**
|
|
50
|
-
* #property
|
|
51
|
-
*/
|
|
52
36
|
configuration: (0, configuration_1.ConfigurationReference)(configSchema),
|
|
53
|
-
/**
|
|
54
|
-
* #property
|
|
55
|
-
*/
|
|
56
37
|
displayMode: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
57
38
|
}))
|
|
58
39
|
.volatile(() => ({
|
|
@@ -62,18 +43,12 @@ function stateModelFactory(configSchema) {
|
|
|
62
43
|
drawn: true,
|
|
63
44
|
}))
|
|
64
45
|
.views(self => ({
|
|
65
|
-
/**
|
|
66
|
-
* #getter
|
|
67
|
-
*/
|
|
68
46
|
get displayModeSetting() {
|
|
69
47
|
var _a;
|
|
70
48
|
return (_a = self.displayMode) !== null && _a !== void 0 ? _a : (0, configuration_1.getConf)(self, ['renderer', 'displayMode']);
|
|
71
49
|
},
|
|
72
50
|
}))
|
|
73
51
|
.actions(self => ({
|
|
74
|
-
/**
|
|
75
|
-
* #action
|
|
76
|
-
*/
|
|
77
52
|
selectFeature(feature) {
|
|
78
53
|
const session = (0, util_1.getSession)(self);
|
|
79
54
|
if ((0, util_1.isSessionModelWithWidgets)(session)) {
|
|
@@ -88,28 +63,18 @@ function stateModelFactory(configSchema) {
|
|
|
88
63
|
session.setSelection(feature);
|
|
89
64
|
}
|
|
90
65
|
},
|
|
91
|
-
/**
|
|
92
|
-
* #action
|
|
93
|
-
*/
|
|
94
66
|
setLoading(flag) {
|
|
95
67
|
self.loading = flag;
|
|
96
68
|
},
|
|
97
|
-
/**
|
|
98
|
-
* #action
|
|
99
|
-
*/
|
|
100
69
|
setFeatures(f) {
|
|
101
70
|
self.features = f;
|
|
102
71
|
},
|
|
103
|
-
/**
|
|
104
|
-
* #action
|
|
105
|
-
*/
|
|
106
72
|
setDisplayMode(flag) {
|
|
107
73
|
self.displayMode = flag;
|
|
108
74
|
},
|
|
109
75
|
}))
|
|
110
76
|
.actions(self => ({
|
|
111
77
|
afterAttach() {
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
113
78
|
;
|
|
114
79
|
(async () => {
|
|
115
80
|
try {
|
|
@@ -122,12 +87,8 @@ function stateModelFactory(configSchema) {
|
|
|
122
87
|
}
|
|
123
88
|
})();
|
|
124
89
|
},
|
|
125
|
-
/**
|
|
126
|
-
* #action
|
|
127
|
-
*/
|
|
128
90
|
async renderSvg(opts) {
|
|
129
91
|
const { renderArcSvg } = await Promise.resolve().then(() => __importStar(require('./renderSvg')));
|
|
130
|
-
// @ts-expect-error
|
|
131
92
|
return renderArcSvg(self, opts);
|
|
132
93
|
},
|
|
133
94
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { LinearArcDisplayModel } from './model';
|
|
2
|
+
import type { LinearArcDisplayModel } from './model';
|
|
3
3
|
export declare function renderArcSvg(model: LinearArcDisplayModel, _opts: {
|
|
4
4
|
rasterizeLayers?: boolean;
|
|
5
5
|
}): Promise<React.JSX.Element>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { AugmentedRegion, Feature } from '@jbrowse/core/util';
|
|
3
|
+
import type { IAutorunOptions } from 'mobx';
|
|
4
|
+
import type { IAnyStateTreeNode } from 'mobx-state-tree';
|
|
5
5
|
export declare function getTag(feature: Feature, tag: string): any;
|
|
6
6
|
export declare function getTagAlt(feature: Feature, tag: string, alt: string): any;
|
|
7
7
|
export declare const orientationTypes: {
|
|
@@ -8,23 +8,17 @@ exports.fetchSequence = fetchSequence;
|
|
|
8
8
|
exports.shouldFetchReferenceSequence = shouldFetchReferenceSequence;
|
|
9
9
|
exports.createAutorun = createAutorun;
|
|
10
10
|
exports.randomColor = randomColor;
|
|
11
|
-
const operators_1 = require("rxjs/operators");
|
|
12
|
-
const rxjs_1 = require("rxjs");
|
|
13
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
14
11
|
const mobx_1 = require("mobx");
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
13
|
+
const rxjs_1 = require("rxjs");
|
|
14
|
+
const operators_1 = require("rxjs/operators");
|
|
17
15
|
function getTag(feature, tag) {
|
|
18
16
|
return feature.get('tags')[tag];
|
|
19
17
|
}
|
|
20
|
-
// use fallback alt tag, used in situations where upper case/lower case tags
|
|
21
|
-
// exist e.g. Mm/MM for base modifications
|
|
22
18
|
function getTagAlt(feature, tag, alt) {
|
|
23
19
|
var _a;
|
|
24
20
|
return (_a = getTag(feature, tag)) !== null && _a !== void 0 ? _a : getTag(feature, alt);
|
|
25
21
|
}
|
|
26
|
-
// orientation definitions from igv.js, see also
|
|
27
|
-
// https://software.broadinstitute.org/software/igv/interpreting_pair_orientations
|
|
28
22
|
exports.orientationTypes = {
|
|
29
23
|
fr: {
|
|
30
24
|
F1R2: 'LR',
|
|
@@ -82,8 +76,6 @@ function getColorWGBS(strand, base) {
|
|
|
82
76
|
}
|
|
83
77
|
return '#888';
|
|
84
78
|
}
|
|
85
|
-
// fetches region sequence augmenting by +/- 1bp for CpG on either side of
|
|
86
|
-
// requested region
|
|
87
79
|
async function fetchSequence(region, adapter) {
|
|
88
80
|
var _a;
|
|
89
81
|
const { start, end, originalRefName, refName } = region;
|
|
@@ -97,12 +89,9 @@ async function fetchSequence(region, adapter) {
|
|
|
97
89
|
.pipe((0, operators_1.toArray)()));
|
|
98
90
|
return (_a = feats[0]) === null || _a === void 0 ? void 0 : _a.get('seq');
|
|
99
91
|
}
|
|
100
|
-
// has to check underlying C-G (aka CpG) on the reference sequence
|
|
101
92
|
function shouldFetchReferenceSequence(type) {
|
|
102
93
|
return type === 'methylation';
|
|
103
94
|
}
|
|
104
|
-
// adapted from IGV
|
|
105
|
-
// https://github.com/igvteam/igv/blob/e803e3af2d8c9ea049961dfd4628146bdde9a574/src/main/java/org/broad/igv/sam/mods/BaseModificationColors.java#L27
|
|
106
95
|
exports.modificationColors = {
|
|
107
96
|
m: 'rgb(255,0,0)',
|
|
108
97
|
h: 'rgb(11, 132, 165)',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class ArcPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
|
|
7
|
+
const colors_1 = require("@jbrowse/core/ui/colors");
|
|
8
|
+
const ArcRenderer_1 = __importDefault(require("./ArcRenderer"));
|
|
7
9
|
const LinearArcDisplay_1 = __importDefault(require("./LinearArcDisplay"));
|
|
8
10
|
const LinearPairedArcDisplay_1 = __importDefault(require("./LinearPairedArcDisplay"));
|
|
9
|
-
const ArcRenderer_1 = __importDefault(require("./ArcRenderer"));
|
|
10
|
-
const colors_1 = require("@jbrowse/core/ui/colors");
|
|
11
11
|
class ArcPlugin extends Plugin_1.default {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
@@ -35,7 +35,7 @@ class ArcPlugin extends Plugin_1.default {
|
|
|
35
35
|
return colors_1.set1[4];
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
return colors_1.set1[6];
|
|
38
|
+
return colors_1.set1[6];
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
-
import { Feature, Region } from '@jbrowse/core/util';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
4
|
declare const ArcRendering: ({ features, config, regions, bpPerPx, height, exportSVG, displayModel, onFeatureClick, }: {
|
|
5
5
|
features: Map<string, Feature>;
|
|
6
6
|
config: AnyConfigurationModel;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { readConfObject
|
|
1
|
+
import React, { Suspense, lazy, useState } from 'react';
|
|
2
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
3
|
import { bpSpanPx, getStrokeProps } from '@jbrowse/core/util';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
// locals
|
|
6
5
|
const ArcTooltip = lazy(() => import('../ArcTooltip'));
|
|
7
6
|
function Arc({ selectedFeatureId, region, bpPerPx, config, height: displayHeight, feature, onFeatureClick, }) {
|
|
8
7
|
const [isMouseOvered, setIsMouseOvered] = useState(false);
|
|
@@ -16,7 +15,6 @@ function Arc({ selectedFeatureId, region, bpPerPx, config, height: displayHeight
|
|
|
16
15
|
const strokeWidth = readConfObject(config, 'thickness', { feature }) || 2;
|
|
17
16
|
const height = Math.min(readConfObject(config, 'height', { feature }) || 100, displayHeight);
|
|
18
17
|
const ref = React.createRef();
|
|
19
|
-
// formula: https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B%C3%A9zier_curves
|
|
20
18
|
const t = 0.5;
|
|
21
19
|
const t1 = 1 - t;
|
|
22
20
|
const textYCoord = 3 * (t1 * t1) * (t * height) + 3 * t1 * (t * t) * height;
|
|
@@ -1,52 +1,34 @@
|
|
|
1
1
|
declare const ArcRenderer: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
color: {
|
|
6
3
|
type: string;
|
|
7
4
|
description: string;
|
|
8
5
|
defaultValue: string;
|
|
9
6
|
contextVariable: string[];
|
|
10
7
|
};
|
|
11
|
-
/**
|
|
12
|
-
* #slot
|
|
13
|
-
*/
|
|
14
8
|
thickness: {
|
|
15
9
|
type: string;
|
|
16
10
|
description: string;
|
|
17
11
|
defaultValue: string;
|
|
18
12
|
contextVariable: string[];
|
|
19
13
|
};
|
|
20
|
-
/**
|
|
21
|
-
* #slot
|
|
22
|
-
*/
|
|
23
14
|
label: {
|
|
24
15
|
type: string;
|
|
25
16
|
description: string;
|
|
26
17
|
defaultValue: string;
|
|
27
18
|
contextVariable: string[];
|
|
28
19
|
};
|
|
29
|
-
/**
|
|
30
|
-
* #slot
|
|
31
|
-
*/
|
|
32
20
|
height: {
|
|
33
21
|
type: string;
|
|
34
22
|
description: string;
|
|
35
23
|
defaultValue: string;
|
|
36
24
|
contextVariable: string[];
|
|
37
25
|
};
|
|
38
|
-
/**
|
|
39
|
-
* #slot
|
|
40
|
-
*/
|
|
41
26
|
caption: {
|
|
42
27
|
type: string;
|
|
43
28
|
description: string;
|
|
44
29
|
defaultValue: string;
|
|
45
30
|
contextVariable: string[];
|
|
46
31
|
};
|
|
47
|
-
/**
|
|
48
|
-
* #slot
|
|
49
|
-
*/
|
|
50
32
|
displayMode: {
|
|
51
33
|
type: string;
|
|
52
34
|
defaultValue: string;
|
|
@@ -1,58 +1,37 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
2
|
import { types } from 'mobx-state-tree';
|
|
3
|
-
|
|
4
|
-
* #config ArcRenderer
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
function x() { }
|
|
7
4
|
const ArcRenderer = ConfigurationSchema('ArcRenderer', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
5
|
color: {
|
|
12
6
|
type: 'color',
|
|
13
7
|
description: 'the color of the arcs',
|
|
14
8
|
defaultValue: 'darkblue',
|
|
15
9
|
contextVariable: ['feature'],
|
|
16
10
|
},
|
|
17
|
-
/**
|
|
18
|
-
* #slot
|
|
19
|
-
*/
|
|
20
11
|
thickness: {
|
|
21
12
|
type: 'number',
|
|
22
13
|
description: 'the thickness of the arcs',
|
|
23
14
|
defaultValue: `jexl:logThickness(feature,'score')`,
|
|
24
15
|
contextVariable: ['feature'],
|
|
25
16
|
},
|
|
26
|
-
/**
|
|
27
|
-
* #slot
|
|
28
|
-
*/
|
|
29
17
|
label: {
|
|
30
18
|
type: 'string',
|
|
31
19
|
description: 'the label to appear at the apex of the arcs',
|
|
32
20
|
defaultValue: `jexl:get(feature,'score')`,
|
|
33
21
|
contextVariable: ['feature'],
|
|
34
22
|
},
|
|
35
|
-
/**
|
|
36
|
-
* #slot
|
|
37
|
-
*/
|
|
38
23
|
height: {
|
|
39
24
|
type: 'number',
|
|
40
25
|
description: 'the height of the arcs',
|
|
41
26
|
defaultValue: `jexl:log10(get(feature,'end')-get(feature,'start'))*50`,
|
|
42
27
|
contextVariable: ['feature'],
|
|
43
28
|
},
|
|
44
|
-
/**
|
|
45
|
-
* #slot
|
|
46
|
-
*/
|
|
47
29
|
caption: {
|
|
48
30
|
type: 'string',
|
|
49
31
|
description: 'the caption to appear when hovering over any point on the arcs',
|
|
50
32
|
defaultValue: `jexl:get(feature,'name')`,
|
|
51
33
|
contextVariable: ['feature'],
|
|
52
34
|
},
|
|
53
|
-
/**
|
|
54
|
-
* #slot
|
|
55
|
-
*/
|
|
56
35
|
displayMode: {
|
|
57
36
|
type: 'enum',
|
|
58
37
|
defaultValue: 'arcs',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function ArcRendererF(pluginManager: PluginManager): void;
|
package/esm/ArcRenderer/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import ArcRenderer from './ArcRenderer';
|
|
1
2
|
import ReactComponent from './ArcRendering';
|
|
2
3
|
import configSchema from './configSchema';
|
|
3
|
-
import ArcRenderer from './ArcRenderer';
|
|
4
4
|
export default function ArcRendererF(pluginManager) {
|
|
5
5
|
pluginManager.addRendererType(() => new ArcRenderer({
|
|
6
6
|
name: 'ArcRenderer',
|
package/esm/ArcTooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Suspense } from 'react';
|
|
2
2
|
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
3
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
5
|
const TooltipContents = React.forwardRef(function TooltipContents2({ message }, ref) {
|
|
6
6
|
return (React.createElement("div", { ref: ref }, React.isValidElement(message) ? (message) : message ? (React.createElement(SanitizedHTML, { html: String(message) })) : null));
|
|
7
7
|
});
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
/**
|
|
3
|
-
* #config LinearArcDisplay
|
|
4
|
-
*/
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
5
2
|
export declare function configSchemaFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
6
|
-
/**
|
|
7
|
-
* #slot
|
|
8
|
-
*/
|
|
9
3
|
renderer: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IAnyModelType, [undefined]>;
|
|
10
4
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
11
5
|
maxFeatureScreenDensity: {
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
2
|
import { baseLinearDisplayConfigSchema } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
-
|
|
5
|
-
* #config LinearArcDisplay
|
|
6
|
-
*/
|
|
3
|
+
import { types } from 'mobx-state-tree';
|
|
7
4
|
export function configSchemaFactory(pluginManager) {
|
|
8
5
|
return ConfigurationSchema('LinearArcDisplay', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
renderer: types.optional(pluginManager.pluggableConfigSchemaType('renderer'), { type: 'ArcRenderer' }),
|
|
13
7
|
}, {
|
|
14
|
-
/**
|
|
15
|
-
* #baseConfiguration
|
|
16
|
-
*/
|
|
17
8
|
baseConfiguration: baseLinearDisplayConfigSchema,
|
|
18
9
|
explicitlyTyped: true,
|
|
19
10
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function LinearArcDisplayF(pluginManager: PluginManager): void;
|