@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
|
@@ -4,10 +4,10 @@ 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 util_1 = require("@jbrowse/core/util");
|
|
9
8
|
const color_1 = require("@jbrowse/core/util/color");
|
|
10
9
|
const styles_1 = require("@mui/material/styles");
|
|
10
|
+
const mobx_react_1 = require("mobx-react");
|
|
11
11
|
const mui_1 = require("tss-react/mui");
|
|
12
12
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
13
13
|
rulerLabel: {
|
|
@@ -18,7 +18,6 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
function sliceArcPath(slice, radiusPx, startBase, endBase) {
|
|
21
|
-
// A rx ry x-axis-rotation large-arc-flag sweep-flag x y
|
|
22
21
|
if (slice.flipped) {
|
|
23
22
|
;
|
|
24
23
|
[startBase, endBase] = [endBase, startBase];
|
|
@@ -48,7 +47,6 @@ const ElisionRulerArc = (0, mobx_react_1.observer)(function ({ model, slice, reg
|
|
|
48
47
|
const endXY = (0, util_1.polarToCartesian)(radiusPx, endRadians);
|
|
49
48
|
const widthPx = (endRadians - startRadians) * radiusPx;
|
|
50
49
|
const largeArc = endRadians - startRadians > Math.PI ? '1' : '0';
|
|
51
|
-
// TODO: draw the elision
|
|
52
50
|
const centerRadians = (endRadians + startRadians) / 2;
|
|
53
51
|
const regionCount = `[${Number(region.regions.length).toLocaleString()}]`;
|
|
54
52
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -72,13 +70,11 @@ const RulerLabel = (0, mobx_react_1.observer)(function ({ view, text, maxWidthPx
|
|
|
72
70
|
return null;
|
|
73
71
|
}
|
|
74
72
|
if (text.length * 6.5 < maxWidthPx) {
|
|
75
|
-
// text is rotated parallel to the ruler arc
|
|
76
73
|
return (react_1.default.createElement("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "middle", dominantBaseline: "baseline", transform: `translate(${textXY}) rotate(${(0, util_1.radToDeg)(radians) + 90})`, ...(0, util_1.getFillProps)(color) },
|
|
77
74
|
text,
|
|
78
75
|
react_1.default.createElement("title", null, title || text)));
|
|
79
76
|
}
|
|
80
77
|
if (maxWidthPx > 4) {
|
|
81
|
-
// text is rotated perpendicular to the ruler arc
|
|
82
78
|
const overallRotation = (0, util_1.radToDeg)(radians + view.offsetRadians - Math.PI / 2);
|
|
83
79
|
if (overallRotation >= 180) {
|
|
84
80
|
return (react_1.default.createElement("text", { x: 0, y: 0, className: classes.rulerLabel, textAnchor: "start", dominantBaseline: "middle", transform: `translate(${textXY}) rotate(${(0, util_1.radToDeg)(radians)})`, fill: color },
|
|
@@ -89,7 +85,6 @@ const RulerLabel = (0, mobx_react_1.observer)(function ({ view, text, maxWidthPx
|
|
|
89
85
|
text,
|
|
90
86
|
react_1.default.createElement("title", null, title || text)));
|
|
91
87
|
}
|
|
92
|
-
// if you get here there is no room for the text at all
|
|
93
88
|
return null;
|
|
94
89
|
});
|
|
95
90
|
const RegionRulerArc = (0, mobx_react_1.observer)(function ({ model, slice, region, }) {
|
|
@@ -112,7 +107,6 @@ const RegionRulerArc = (0, mobx_react_1.observer)(function ({ model, slice, regi
|
|
|
112
107
|
else {
|
|
113
108
|
color = theme.palette.text.primary;
|
|
114
109
|
}
|
|
115
|
-
// TODO: slice flipping
|
|
116
110
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
117
111
|
react_1.default.createElement(RulerLabel, { text: region.refName, view: model, maxWidthPx: widthPx, radians: centerRadians, radiusPx: radiusPx, color: color }),
|
|
118
112
|
react_1.default.createElement("path", { d: sliceArcPath(slice, radiusPx + 1, region.start, region.end), stroke: color, strokeWidth: 2, fill: "none" })));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function CircularViewF(pluginManager: PluginManager): void;
|
|
@@ -29,7 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.default = CircularViewF;
|
|
30
30
|
const react_1 = require("react");
|
|
31
31
|
const ViewType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/ViewType"));
|
|
32
|
-
const model_1 = __importDefault(require("./
|
|
32
|
+
const model_1 = __importDefault(require("./model"));
|
|
33
33
|
function CircularViewF(pluginManager) {
|
|
34
34
|
pluginManager.addViewType(() => new ViewType_1.default({
|
|
35
35
|
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/CircularView')))),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { SliceRegion } from './slices';
|
|
3
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
4
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
5
|
+
import type { MenuItem } from '@jbrowse/core/ui';
|
|
6
|
+
import type { Region as IRegion } from '@jbrowse/core/util/types';
|
|
7
|
+
import type { Region } from '@jbrowse/core/util/types/mst';
|
|
8
|
+
import type { Instance, SnapshotOrInstance } from 'mobx-state-tree';
|
|
8
9
|
export interface ExportSvgOptions {
|
|
9
10
|
rasterizeLayers?: boolean;
|
|
10
11
|
filename?: string;
|
|
@@ -13,11 +14,6 @@ export interface ExportSvgOptions {
|
|
|
13
14
|
}>;
|
|
14
15
|
themeName?: string;
|
|
15
16
|
}
|
|
16
|
-
/**
|
|
17
|
-
* #stateModel CircularView
|
|
18
|
-
* extends
|
|
19
|
-
* - [BaseViewModel](../baseviewmodel)
|
|
20
|
-
*/
|
|
21
17
|
declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
22
18
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
23
19
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -32,16 +28,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
32
28
|
lockedFitToWindow: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
33
29
|
disableImportForm: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
34
30
|
height: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
35
|
-
displayedRegions: import("mobx-state-tree").
|
|
36
|
-
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
37
|
-
start: import("mobx-state-tree").ISimpleType<number>;
|
|
38
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
39
|
-
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
40
|
-
} & {
|
|
41
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
42
|
-
}, {
|
|
43
|
-
setRefName(newRefName: string): void;
|
|
44
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
31
|
+
displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<IRegion[], IRegion[], IRegion[]>, [undefined]>;
|
|
45
32
|
scrollX: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
46
33
|
scrollY: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
47
34
|
minimumRadiusPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
@@ -63,192 +50,56 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
63
50
|
volatileWidth: number | undefined;
|
|
64
51
|
error: unknown;
|
|
65
52
|
} & {
|
|
66
|
-
/**
|
|
67
|
-
* #getter
|
|
68
|
-
*/
|
|
69
53
|
readonly width: number;
|
|
70
|
-
/**
|
|
71
|
-
* #getter
|
|
72
|
-
*/
|
|
73
54
|
readonly visibleSection: {
|
|
74
55
|
rho: [number, number];
|
|
75
56
|
theta: [number, number];
|
|
76
57
|
};
|
|
77
|
-
/**
|
|
78
|
-
* #getter
|
|
79
|
-
*/
|
|
80
58
|
readonly circumferencePx: number;
|
|
81
|
-
/**
|
|
82
|
-
* #getter
|
|
83
|
-
*/
|
|
84
59
|
readonly radiusPx: number;
|
|
85
|
-
/**
|
|
86
|
-
* #getter
|
|
87
|
-
*/
|
|
88
60
|
readonly bpPerRadian: number;
|
|
89
|
-
/**
|
|
90
|
-
* #getter
|
|
91
|
-
*/
|
|
92
61
|
readonly pxPerRadian: number;
|
|
93
|
-
/**
|
|
94
|
-
* #getter
|
|
95
|
-
*/
|
|
96
62
|
readonly centerXY: [number, number];
|
|
97
|
-
/**
|
|
98
|
-
* #getter
|
|
99
|
-
*/
|
|
100
63
|
readonly totalBp: number;
|
|
101
|
-
/**
|
|
102
|
-
* #getter
|
|
103
|
-
*/
|
|
104
64
|
readonly maximumRadiusPx: number;
|
|
105
|
-
/**
|
|
106
|
-
* #getter
|
|
107
|
-
*/
|
|
108
65
|
readonly maxBpPerPx: number;
|
|
109
|
-
/**
|
|
110
|
-
* #getter
|
|
111
|
-
*/
|
|
112
66
|
readonly minBpPerPx: number;
|
|
113
|
-
/**
|
|
114
|
-
* #getter
|
|
115
|
-
*/
|
|
116
67
|
readonly atMaxBpPerPx: boolean;
|
|
117
|
-
/**
|
|
118
|
-
* #getter
|
|
119
|
-
*/
|
|
120
68
|
readonly atMinBpPerPx: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* #getter
|
|
123
|
-
*/
|
|
124
69
|
readonly tooSmallToLock: boolean;
|
|
125
|
-
/**
|
|
126
|
-
* #getter
|
|
127
|
-
*/
|
|
128
70
|
readonly figureDimensions: [number, number];
|
|
129
|
-
/**
|
|
130
|
-
* #getter
|
|
131
|
-
*/
|
|
132
71
|
readonly figureWidth: number;
|
|
133
|
-
/**
|
|
134
|
-
* #getter
|
|
135
|
-
*/
|
|
136
72
|
readonly figureHeight: number;
|
|
137
|
-
/**
|
|
138
|
-
* #getter
|
|
139
|
-
* this is displayedRegions, post-processed to elide regions that are too
|
|
140
|
-
* small to see reasonably
|
|
141
|
-
*/
|
|
142
73
|
readonly elidedRegions: SliceRegion[];
|
|
143
|
-
/**
|
|
144
|
-
* #getter
|
|
145
|
-
*/
|
|
146
74
|
readonly assemblyNames: string[];
|
|
147
|
-
/**
|
|
148
|
-
* #getter
|
|
149
|
-
*/
|
|
150
75
|
readonly initialized: boolean;
|
|
151
76
|
} & {
|
|
152
|
-
/**
|
|
153
|
-
* #getter
|
|
154
|
-
*/
|
|
155
77
|
readonly staticSlices: import("./slices").Slice[];
|
|
156
78
|
} & {
|
|
157
|
-
/**
|
|
158
|
-
* #getter
|
|
159
|
-
*/
|
|
160
79
|
readonly visibleStaticSlices: import("./slices").Slice[];
|
|
161
80
|
} & {
|
|
162
|
-
/**
|
|
163
|
-
* #action
|
|
164
|
-
*/
|
|
165
81
|
setWidth(newWidth: number): number;
|
|
166
|
-
/**
|
|
167
|
-
* #action
|
|
168
|
-
*/
|
|
169
82
|
setHeight(newHeight: number): number;
|
|
170
|
-
/**
|
|
171
|
-
* #action
|
|
172
|
-
*/
|
|
173
83
|
resizeHeight(distance: number): number;
|
|
174
|
-
/**
|
|
175
|
-
* #action
|
|
176
|
-
*/
|
|
177
84
|
resizeWidth(distance: number): number;
|
|
178
|
-
/**
|
|
179
|
-
* #action
|
|
180
|
-
*/
|
|
181
85
|
rotateClockwiseButton(): void;
|
|
182
|
-
/**
|
|
183
|
-
* #action
|
|
184
|
-
*/
|
|
185
86
|
rotateCounterClockwiseButton(): void;
|
|
186
|
-
/**
|
|
187
|
-
* #action
|
|
188
|
-
*/
|
|
189
87
|
rotateClockwise(distance?: number): void;
|
|
190
|
-
/**
|
|
191
|
-
* #action
|
|
192
|
-
*/
|
|
193
88
|
rotateCounterClockwise(distance?: number): void;
|
|
194
|
-
/**
|
|
195
|
-
* #action
|
|
196
|
-
*/
|
|
197
89
|
zoomInButton(): void;
|
|
198
|
-
/**
|
|
199
|
-
* #action
|
|
200
|
-
*/
|
|
201
90
|
zoomOutButton(): void;
|
|
202
|
-
/**
|
|
203
|
-
* #action
|
|
204
|
-
*/
|
|
205
91
|
setBpPerPx(newVal: number): void;
|
|
206
|
-
/**
|
|
207
|
-
* #action
|
|
208
|
-
*/
|
|
209
92
|
setModelViewWhenAdjust(secondCondition: boolean): void;
|
|
210
|
-
/**
|
|
211
|
-
* #action
|
|
212
|
-
*/
|
|
213
93
|
setDisplayedRegions(regions: SnapshotOrInstance<typeof Region>[]): void;
|
|
214
|
-
/**
|
|
215
|
-
* #action
|
|
216
|
-
*/
|
|
217
94
|
activateTrackSelector(): import("@jbrowse/core/util").Widget;
|
|
218
|
-
/**
|
|
219
|
-
* #action
|
|
220
|
-
*/
|
|
221
95
|
toggleTrack(trackId: string): boolean;
|
|
222
|
-
/**
|
|
223
|
-
* #action
|
|
224
|
-
*/
|
|
225
96
|
setError(error: unknown): void;
|
|
226
|
-
/**
|
|
227
|
-
* #action
|
|
228
|
-
*/
|
|
229
97
|
showTrack(trackId: string, initialSnapshot?: {}): void;
|
|
230
|
-
/**
|
|
231
|
-
* #action
|
|
232
|
-
*/
|
|
233
98
|
addTrackConf(configuration: AnyConfigurationModel, initialSnapshot?: {}): void;
|
|
234
|
-
/**
|
|
235
|
-
* #action
|
|
236
|
-
*/
|
|
237
99
|
hideTrack(trackId: string): number;
|
|
238
|
-
/**
|
|
239
|
-
* #action
|
|
240
|
-
*/
|
|
241
100
|
toggleFitToWindowLock(): boolean;
|
|
242
|
-
/**
|
|
243
|
-
* #action
|
|
244
|
-
* creates an svg export and save using FileSaver
|
|
245
|
-
*/
|
|
246
101
|
exportSvg(opts?: ExportSvgOptions): Promise<void>;
|
|
247
102
|
} & {
|
|
248
|
-
/**
|
|
249
|
-
* #method
|
|
250
|
-
* return the view menu items
|
|
251
|
-
*/
|
|
252
103
|
menuItems(): MenuItem[];
|
|
253
104
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
254
105
|
export type CircularViewStateModel = ReturnType<typeof stateModelFactory>;
|