@jbrowse/plugin-circular-view 3.7.0 → 4.0.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.
Files changed (73) hide show
  1. package/esm/CircularView/components/CircularView.d.ts +2 -2
  2. package/esm/CircularView/components/CircularView.js +21 -15
  3. package/esm/CircularView/components/Controls.d.ts +2 -2
  4. package/esm/CircularView/components/Controls.js +3 -3
  5. package/esm/CircularView/components/ExportSvgDialog.d.ts +1 -1
  6. package/esm/CircularView/components/ImportForm.d.ts +2 -2
  7. package/esm/CircularView/components/ImportForm.js +4 -4
  8. package/esm/CircularView/components/Ruler.d.ts +2 -2
  9. package/esm/CircularView/components/Ruler.js +7 -7
  10. package/esm/CircularView/index.js +2 -2
  11. package/esm/CircularView/model.d.ts +73 -34
  12. package/esm/CircularView/model.js +146 -54
  13. package/esm/CircularView/slices.js +9 -1
  14. package/esm/CircularView/svgcomponents/SVGCircularView.d.ts +1 -1
  15. package/esm/CircularView/svgcomponents/SVGCircularView.js +3 -4
  16. package/esm/LaunchCircularView/index.js +6 -12
  17. package/esm/index.d.ts +1 -2
  18. package/esm/index.js +4 -7
  19. package/package.json +26 -32
  20. package/dist/BaseChordDisplay/components/BaseChordDisplay.d.ts +0 -11
  21. package/dist/BaseChordDisplay/components/BaseChordDisplay.js +0 -21
  22. package/dist/BaseChordDisplay/components/DisplayError.d.ts +0 -9
  23. package/dist/BaseChordDisplay/components/DisplayError.js +0 -9
  24. package/dist/BaseChordDisplay/components/Loading.d.ts +0 -8
  25. package/dist/BaseChordDisplay/components/Loading.js +0 -62
  26. package/dist/BaseChordDisplay/configSchema.d.ts +0 -9
  27. package/dist/BaseChordDisplay/configSchema.js +0 -16
  28. package/dist/BaseChordDisplay/index.d.ts +0 -3
  29. package/dist/BaseChordDisplay/index.js +0 -12
  30. package/dist/BaseChordDisplay/model.d.ts +0 -109
  31. package/dist/BaseChordDisplay/model.js +0 -166
  32. package/dist/BaseChordDisplay/renderReaction.d.ts +0 -27
  33. package/dist/BaseChordDisplay/renderReaction.js +0 -50
  34. package/dist/CircularView/components/CircularView.d.ts +0 -5
  35. package/dist/CircularView/components/CircularView.js +0 -60
  36. package/dist/CircularView/components/Controls.d.ts +0 -5
  37. package/dist/CircularView/components/Controls.js +0 -57
  38. package/dist/CircularView/components/ExportSvgDialog.d.ts +0 -7
  39. package/dist/CircularView/components/ExportSvgDialog.js +0 -53
  40. package/dist/CircularView/components/ImportForm.d.ts +0 -5
  41. package/dist/CircularView/components/ImportForm.js +0 -35
  42. package/dist/CircularView/components/Ruler.d.ts +0 -7
  43. package/dist/CircularView/components/Ruler.js +0 -106
  44. package/dist/CircularView/index.d.ts +0 -2
  45. package/dist/CircularView/index.js +0 -50
  46. package/dist/CircularView/model.d.ts +0 -107
  47. package/dist/CircularView/model.js +0 -376
  48. package/dist/CircularView/slices.d.ts +0 -45
  49. package/dist/CircularView/slices.js +0 -57
  50. package/dist/CircularView/svgcomponents/SVGBackground.d.ts +0 -5
  51. package/dist/CircularView/svgcomponents/SVGBackground.js +0 -10
  52. package/dist/CircularView/svgcomponents/SVGCircularView.d.ts +0 -4
  53. package/dist/CircularView/svgcomponents/SVGCircularView.js +0 -31
  54. package/dist/CircularView/viewportVisibleRegion.d.ts +0 -6
  55. package/dist/CircularView/viewportVisibleRegion.js +0 -153
  56. package/dist/LaunchCircularView/index.d.ts +0 -2
  57. package/dist/LaunchCircularView/index.js +0 -22
  58. package/dist/index.d.ts +0 -9
  59. package/dist/index.js +0 -37
  60. package/esm/BaseChordDisplay/components/BaseChordDisplay.d.ts +0 -11
  61. package/esm/BaseChordDisplay/components/BaseChordDisplay.js +0 -16
  62. package/esm/BaseChordDisplay/components/DisplayError.d.ts +0 -9
  63. package/esm/BaseChordDisplay/components/DisplayError.js +0 -7
  64. package/esm/BaseChordDisplay/components/Loading.d.ts +0 -8
  65. package/esm/BaseChordDisplay/components/Loading.js +0 -60
  66. package/esm/BaseChordDisplay/configSchema.d.ts +0 -9
  67. package/esm/BaseChordDisplay/configSchema.js +0 -13
  68. package/esm/BaseChordDisplay/index.d.ts +0 -3
  69. package/esm/BaseChordDisplay/index.js +0 -3
  70. package/esm/BaseChordDisplay/model.d.ts +0 -109
  71. package/esm/BaseChordDisplay/model.js +0 -163
  72. package/esm/BaseChordDisplay/renderReaction.d.ts +0 -27
  73. package/esm/BaseChordDisplay/renderReaction.js +0 -46
@@ -1,45 +0,0 @@
1
- import type { Region } from '@jbrowse/core/util';
2
- export interface SliceElidedRegion {
3
- elided: true;
4
- widthBp: number;
5
- regions: Region[];
6
- }
7
- export interface SliceNonElidedRegion {
8
- elided: false;
9
- widthBp: number;
10
- start: number;
11
- end: number;
12
- refName: string;
13
- assemblyName: string;
14
- }
15
- export type SliceRegion = SliceNonElidedRegion | SliceElidedRegion;
16
- export declare class Slice {
17
- region: SliceRegion;
18
- offsetRadians: number;
19
- radianWidth: number;
20
- key: string;
21
- startRadians: number;
22
- endRadians: number;
23
- bpPerRadian: number;
24
- flipped: boolean;
25
- constructor(view: {
26
- bpPerRadian: number;
27
- }, region: SliceRegion, offsetRadians: number, radianWidth: number);
28
- bpToXY(bp: number, radiusPx: number): [number, number];
29
- toJSON(): {
30
- [k: string]: any;
31
- };
32
- }
33
- declare function calculateStaticSlices(self: {
34
- elidedRegions: readonly SliceRegion[];
35
- bpPerRadian: number;
36
- spacingPx: number;
37
- pxPerRadian: number;
38
- }): Slice[];
39
- declare function sliceIsVisible(self: {
40
- offsetRadians: number;
41
- visibleSection: {
42
- theta: [number, number];
43
- };
44
- }, slice: Slice): boolean;
45
- export { calculateStaticSlices, sliceIsVisible };
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Slice = void 0;
4
- exports.calculateStaticSlices = calculateStaticSlices;
5
- exports.sliceIsVisible = sliceIsVisible;
6
- const util_1 = require("@jbrowse/core/util");
7
- const viewportVisibleRegion_1 = require("./viewportVisibleRegion");
8
- class Slice {
9
- constructor(view, region, offsetRadians, radianWidth) {
10
- this.region = region;
11
- this.offsetRadians = offsetRadians;
12
- this.radianWidth = radianWidth;
13
- const { bpPerRadian } = view;
14
- this.key =
15
- 'regions' in region
16
- ? JSON.stringify(region.regions)
17
- : (0, util_1.assembleLocString)(region);
18
- this.bpPerRadian = bpPerRadian;
19
- this.flipped = false;
20
- this.startRadians = offsetRadians;
21
- this.endRadians = region.widthBp / this.bpPerRadian + offsetRadians;
22
- Object.freeze(this);
23
- }
24
- bpToXY(bp, radiusPx) {
25
- let offsetBp;
26
- if (this.region.elided) {
27
- offsetBp = this.region.widthBp / 2;
28
- }
29
- else if (this.flipped) {
30
- offsetBp = this.region.end - bp;
31
- }
32
- else {
33
- offsetBp = bp - this.region.start;
34
- }
35
- const totalRadians = offsetBp / this.bpPerRadian + this.offsetRadians;
36
- return (0, util_1.polarToCartesian)(radiusPx, totalRadians);
37
- }
38
- toJSON() {
39
- return Object.fromEntries(Object.entries(this));
40
- }
41
- }
42
- exports.Slice = Slice;
43
- function calculateStaticSlices(self) {
44
- const slices = [];
45
- let currentRadianOffset = 0;
46
- const { bpPerRadian, spacingPx, pxPerRadian } = self;
47
- for (const region of self.elidedRegions) {
48
- const radianWidth = region.widthBp / bpPerRadian + spacingPx / pxPerRadian;
49
- slices.push(new Slice(self, region, currentRadianOffset, radianWidth));
50
- currentRadianOffset += radianWidth;
51
- }
52
- return slices;
53
- }
54
- function sliceIsVisible(self, slice) {
55
- const { theta: [visibleThetaMin, visibleThetaMax], } = self.visibleSection;
56
- return (0, viewportVisibleRegion_1.thetaRangesOverlap)(slice.offsetRadians + self.offsetRadians, slice.radianWidth, visibleThetaMin, visibleThetaMax - visibleThetaMin);
57
- }
@@ -1,5 +0,0 @@
1
- export default function SVGBackground({ width, height, shift, }: {
2
- width: number;
3
- height: number;
4
- shift: number;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = SVGBackground;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const util_1 = require("@jbrowse/core/util");
6
- const material_1 = require("@mui/material");
7
- function SVGBackground({ width, height, shift, }) {
8
- const theme = (0, material_1.useTheme)();
9
- return ((0, jsx_runtime_1.jsx)("rect", { width: width + shift * 2, height: height, fill: (0, util_1.stripAlpha)(theme.palette.background.default) }));
10
- }
@@ -1,4 +0,0 @@
1
- import type { CircularViewModel, ExportSvgOptions } from '../model';
2
- type CGV = CircularViewModel;
3
- export declare function renderToSvg(model: CGV, opts: ExportSvgOptions): Promise<string>;
4
- export {};
@@ -1,31 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.renderToSvg = renderToSvg;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const ui_1 = require("@jbrowse/core/ui");
10
- const util_1 = require("@jbrowse/core/util");
11
- const material_1 = require("@mui/material");
12
- const mobx_1 = require("mobx");
13
- const SVGBackground_1 = __importDefault(require("./SVGBackground"));
14
- const Ruler_1 = __importDefault(require("../components/Ruler"));
15
- async function renderToSvg(model, opts) {
16
- var _a;
17
- await (0, mobx_1.when)(() => model.initialized);
18
- const { themeName = 'default', Wrapper = ({ children }) => children } = opts;
19
- const session = (0, util_1.getSession)(model);
20
- const theme = (_a = session.allThemes) === null || _a === void 0 ? void 0 : _a.call(session)[themeName];
21
- const { width, tracks, height } = model;
22
- const shift = 50;
23
- const displayResults = await Promise.all(tracks.map(async (track) => {
24
- const display = track.displays[0];
25
- await (0, mobx_1.when)(() => (display.ready !== undefined ? display.ready : true));
26
- return { track, result: await display.renderSvg({ ...opts, theme }) };
27
- }));
28
- const { staticSlices, offsetRadians, centerXY } = model;
29
- const deg = (0, util_1.radToDeg)(offsetRadians);
30
- return (0, util_1.renderToStaticMarkup)((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: (0, ui_1.createJBrowseTheme)(theme), children: (0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsxs)("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, width + shift * 2, height].toString(), children: [(0, jsx_runtime_1.jsx)(SVGBackground_1.default, { width: width, height: height, shift: shift }), (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${centerXY}) rotate(${deg})`, children: [staticSlices.map((slice, i) => ((0, jsx_runtime_1.jsx)(Ruler_1.default, { model: model, slice: slice }, i))), displayResults.map(({ result }, i) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: result }, i)))] })] }) }) }));
31
- }
@@ -1,6 +0,0 @@
1
- export declare function cartesianToPolar(x: number, y: number): readonly [number, number];
2
- export declare function thetaRangesOverlap(r1start: number, r1length: number, r2start: number, r2length: number): boolean;
3
- export declare function viewportVisibleSection(viewSides: [number, number, number, number], circleCenter: [number, number], circleRadius: number): {
4
- rho: [number, number];
5
- theta: [number, number];
6
- };
@@ -1,153 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cartesianToPolar = cartesianToPolar;
4
- exports.thetaRangesOverlap = thetaRangesOverlap;
5
- exports.viewportVisibleSection = viewportVisibleSection;
6
- function findCircleIntersectionX(y, cx, cy, r, resultArray) {
7
- const d = Math.abs(y - cy);
8
- if (d > r) {
9
- return;
10
- }
11
- if (d === r) {
12
- resultArray.push([cx, y]);
13
- }
14
- const solution = Math.sqrt(r * r - d * d);
15
- resultArray.push([cx - solution, y], [cx + solution, y]);
16
- }
17
- function findCircleIntersectionY(x, cx, cy, r, resultArray) {
18
- const d = Math.abs(x - cx);
19
- if (d > r) {
20
- return;
21
- }
22
- if (d === r) {
23
- resultArray.push([x, cy]);
24
- }
25
- const solution = Math.sqrt(r * r - d * d);
26
- resultArray.push([x, cy - solution], [x, cy + solution]);
27
- }
28
- function cartesianToTheta(x, y) {
29
- let theta = (Math.atan(y / x) + 2 * Math.PI) % (2 * Math.PI);
30
- if (x < 0) {
31
- if (y <= 0) {
32
- theta += Math.PI;
33
- }
34
- else {
35
- theta -= Math.PI;
36
- }
37
- }
38
- return theta;
39
- }
40
- function cartesianToPolar(x, y) {
41
- const rho = Math.sqrt(x * x + y * y);
42
- if (rho === 0) {
43
- return [0, 0];
44
- }
45
- const theta = cartesianToTheta(x, y);
46
- return [rho, theta];
47
- }
48
- const twoPi = 2 * Math.PI;
49
- function thetaRangesOverlap(r1start, r1length, r2start, r2length) {
50
- if (r1length <= 0 || r2length <= 0) {
51
- return false;
52
- }
53
- if (r1length + 0.0001 >= twoPi || r2length + 0.0001 >= twoPi) {
54
- return true;
55
- }
56
- r1start = (((r1start % twoPi) + twoPi) % twoPi) + twoPi;
57
- r2start = (((r2start % twoPi) + twoPi) % twoPi) + twoPi;
58
- if (r1start < r2start + r2length && r1start + r1length > r2start) {
59
- return true;
60
- }
61
- r2start -= twoPi;
62
- if (r1start < r2start + r2length && r1start + r1length > r2start) {
63
- return true;
64
- }
65
- r2start += twoPi + twoPi;
66
- return r1start < r2start + r2length && r1start + r1length > r2start;
67
- }
68
- function viewportVisibleSection(viewSides, circleCenter, circleRadius) {
69
- let [viewL, viewR, viewT, viewB] = viewSides;
70
- const [cx, cy] = circleCenter;
71
- viewL -= cx;
72
- viewR -= cx;
73
- viewT -= cy;
74
- viewB -= cy;
75
- const centerIsInsideViewport = viewL < 0 && viewR > 0 && viewT < 0 && viewB > 0;
76
- if (centerIsInsideViewport) {
77
- const vertices = [
78
- [viewL, viewT],
79
- [viewR, viewT],
80
- [viewL, viewB],
81
- [viewR, viewB],
82
- ];
83
- let maxRho = Number.NEGATIVE_INFINITY;
84
- for (const [x, y] of vertices) {
85
- const rho = Math.sqrt(x * x + y * y);
86
- if (rho > maxRho) {
87
- maxRho = rho;
88
- }
89
- }
90
- return {
91
- rho: [0, Math.min(circleRadius, maxRho)],
92
- theta: [0, 2 * Math.PI],
93
- };
94
- }
95
- const vertices = [
96
- [viewL, viewT],
97
- [viewR, viewT],
98
- [viewL, viewB],
99
- [viewR, viewB],
100
- ];
101
- findCircleIntersectionY(viewL, 0, 0, circleRadius, vertices);
102
- findCircleIntersectionY(viewR, 0, 0, circleRadius, vertices);
103
- findCircleIntersectionX(viewT, 0, 0, circleRadius, vertices);
104
- findCircleIntersectionX(viewB, 0, 0, circleRadius, vertices);
105
- if (-viewL < circleRadius) {
106
- vertices.push([viewL, 0]);
107
- }
108
- if (viewR < circleRadius) {
109
- vertices.push([viewR, 0]);
110
- }
111
- if (-viewT < circleRadius) {
112
- vertices.push([0, viewT]);
113
- }
114
- if (viewB < circleRadius) {
115
- vertices.push([0, viewB]);
116
- }
117
- const reflect = viewL >= 0 ? -1 : 1;
118
- let rhoMin = Number.POSITIVE_INFINITY;
119
- let rhoMax = Number.NEGATIVE_INFINITY;
120
- let thetaMin = Number.POSITIVE_INFINITY;
121
- let thetaMax = Number.NEGATIVE_INFINITY;
122
- for (const [vx, vy] of vertices) {
123
- if (vx >= viewL && vx <= viewR && vy >= viewT && vy <= viewB) {
124
- const [rho, theta] = cartesianToPolar(vx * reflect, vy * reflect);
125
- if (rho <= circleRadius + 0.001) {
126
- if (theta < thetaMin && rho > 0.0001) {
127
- thetaMin = theta;
128
- }
129
- if (theta > thetaMax && rho > 0.0001) {
130
- thetaMax = theta;
131
- }
132
- if (rho < rhoMin) {
133
- rhoMin = rho;
134
- }
135
- if (rho > rhoMax) {
136
- rhoMax = rho;
137
- }
138
- }
139
- }
140
- }
141
- if (reflect === -1) {
142
- thetaMin += Math.PI;
143
- thetaMax += Math.PI;
144
- }
145
- if (thetaMin > 2 * Math.PI && thetaMax > 2 * Math.PI) {
146
- thetaMin -= 2 * Math.PI;
147
- thetaMax -= 2 * Math.PI;
148
- }
149
- return {
150
- rho: [rhoMin, Math.min(circleRadius, rhoMax)],
151
- theta: [thetaMin, thetaMax],
152
- };
153
- }
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function LaunchCircularViewF(pluginManager: PluginManager): void;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = LaunchCircularViewF;
4
- const mobx_1 = require("mobx");
5
- function LaunchCircularViewF(pluginManager) {
6
- pluginManager.addToExtensionPoint('LaunchView-CircularView', async ({ session, assembly, tracks = [], }) => {
7
- const { assemblyManager } = session;
8
- const view = session.addView('CircularView', {});
9
- await (0, mobx_1.when)(() => view.initialized);
10
- if (!assembly) {
11
- throw new Error('No assembly provided when launching circular genome view');
12
- }
13
- const asm = await assemblyManager.waitForAssembly(assembly);
14
- if (!asm) {
15
- throw new Error(`Assembly "${assembly}" not found when launching circular genome view`);
16
- }
17
- view.setDisplayedRegions(asm.regions || []);
18
- for (const track of tracks) {
19
- view.showTrack(track);
20
- }
21
- });
22
- }
package/dist/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import Plugin from '@jbrowse/core/Plugin';
2
- import type PluginManager from '@jbrowse/core/PluginManager';
3
- export default class CircularViewPlugin extends Plugin {
4
- name: string;
5
- install(pluginManager: PluginManager): void;
6
- configure(pluginManager: PluginManager): void;
7
- }
8
- export { BaseChordDisplayComponent, BaseChordDisplayModel, baseChordDisplayConfig, } from './BaseChordDisplay';
9
- export { type CircularViewModel, type CircularViewStateModel, } from './CircularView/model';
package/dist/index.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.baseChordDisplayConfig = exports.BaseChordDisplayModel = exports.BaseChordDisplayComponent = void 0;
7
- const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
8
- const util_1 = require("@jbrowse/core/util");
9
- const DataUsage_1 = __importDefault(require("@mui/icons-material/DataUsage"));
10
- const CircularView_1 = __importDefault(require("./CircularView"));
11
- const LaunchCircularView_1 = __importDefault(require("./LaunchCircularView"));
12
- class CircularViewPlugin extends Plugin_1.default {
13
- constructor() {
14
- super(...arguments);
15
- this.name = 'CircularViewPlugin';
16
- }
17
- install(pluginManager) {
18
- (0, CircularView_1.default)(pluginManager);
19
- (0, LaunchCircularView_1.default)(pluginManager);
20
- }
21
- configure(pluginManager) {
22
- if ((0, util_1.isAbstractMenuManager)(pluginManager.rootModel)) {
23
- pluginManager.rootModel.appendToSubMenu(['Add'], {
24
- label: 'Circular view',
25
- icon: DataUsage_1.default,
26
- onClick: (session) => {
27
- session.addView('CircularView', {});
28
- },
29
- });
30
- }
31
- }
32
- }
33
- exports.default = CircularViewPlugin;
34
- var BaseChordDisplay_1 = require("./BaseChordDisplay");
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,11 +0,0 @@
1
- declare const BaseChordDisplay: ({ display, }: {
2
- display: {
3
- filled: boolean;
4
- error: unknown;
5
- reactElement: React.ReactElement;
6
- renderProps: {
7
- radius: number;
8
- };
9
- };
10
- }) => import("react/jsx-runtime").JSX.Element;
11
- export default BaseChordDisplay;
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { observer } from 'mobx-react';
3
- import DisplayError from './DisplayError';
4
- import Loading from './Loading';
5
- const BaseChordDisplay = observer(function ({ display, }) {
6
- if (display.error) {
7
- return _jsx(DisplayError, { model: display });
8
- }
9
- else if (!display.filled) {
10
- return _jsx(Loading, { model: display });
11
- }
12
- else {
13
- return display.reactElement;
14
- }
15
- });
16
- export default BaseChordDisplay;
@@ -1,9 +0,0 @@
1
- declare const DisplayError: ({ model, }: {
2
- model: {
3
- renderProps: {
4
- radius: number;
5
- };
6
- error: unknown;
7
- };
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export default DisplayError;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { observer } from 'mobx-react';
3
- const DisplayError = observer(function ({ model, }) {
4
- const { renderProps: { radius }, error, } = model;
5
- return (_jsxs("g", { children: [_jsx("defs", { children: _jsx("pattern", { id: "diagonalHatch", width: "10", height: "10", patternTransform: "rotate(45 0 0)", patternUnits: "userSpaceOnUse", children: _jsx("line", { x1: "0", y1: "0", x2: "0", y2: "10", style: { stroke: 'rgba(255,0,0,0.5)', strokeWidth: 10 } }) }) }), _jsx("circle", { cx: "0", cy: "0", r: radius, fill: "#ffb4b4" }), _jsx("circle", { cx: "0", cy: "0", r: radius, fill: "url(#diagonalHatch)" }), _jsx("text", { x: "0", y: "0", transform: "rotate(90 0 0)", dominantBaseline: "middle", textAnchor: "middle", children: String(error) })] }));
6
- });
7
- export default DisplayError;
@@ -1,8 +0,0 @@
1
- declare const Loading: ({ model: { renderProps: { radius }, }, }: {
2
- model: {
3
- renderProps: {
4
- radius: number;
5
- };
6
- };
7
- }) => import("react/jsx-runtime").JSX.Element | null;
8
- export default Loading;
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { observer } from 'mobx-react';
4
- import { makeStyles } from 'tss-react/mui';
5
- const useStyles = makeStyles()(theme => {
6
- const offset = 2;
7
- const duration = 1.4;
8
- const { primary, secondary, tertiary, quaternary } = theme.palette;
9
- return {
10
- path: {
11
- strokeDasharray: 187,
12
- strokeDashoffset: 50,
13
- animation: `$dash ${duration}s ease-in-out infinite, $colors ${duration * 4}s ease-in-out infinite`,
14
- },
15
- '@keyframes colors': {
16
- '0%': {
17
- stroke: primary.light,
18
- },
19
- '25%': {
20
- stroke: secondary.light,
21
- },
22
- '50%': {
23
- stroke: tertiary.light,
24
- },
25
- '75%': {
26
- stroke: quaternary.light,
27
- },
28
- '100%': {
29
- stroke: primary.light,
30
- },
31
- },
32
- '@keyframes dash': {
33
- '0%': {
34
- strokeDashoffset: offset,
35
- },
36
- '50%': {
37
- strokeDashoffset: offset / 4,
38
- transform: 'rotate(135deg)',
39
- },
40
- '100%': {
41
- strokeDashoffset: offset,
42
- transform: 'rotate(720deg)',
43
- },
44
- },
45
- };
46
- });
47
- const Loading = observer(function ({ model: { renderProps: { radius }, }, }) {
48
- const { classes } = useStyles();
49
- const [shown, setShown] = useState(false);
50
- useEffect(() => {
51
- const timeout = setTimeout(() => {
52
- setShown(true);
53
- }, 400);
54
- return () => {
55
- clearTimeout(timeout);
56
- };
57
- });
58
- return !shown ? null : (_jsxs("g", { children: [_jsx("defs", { children: _jsx("pattern", { id: "diagonalHatch", width: "10", height: "10", patternTransform: "rotate(45 0 0)", patternUnits: "userSpaceOnUse", children: _jsx("line", { x1: "0", y1: "0", x2: "0", y2: "10", style: { stroke: 'rgba(255,255,255,0.5)', strokeWidth: 10 } }) }) }), _jsx("circle", { cx: "0", cy: "0", r: radius, fill: "#f1f1f1" }), _jsx("circle", { cx: "0", cy: "0", r: radius, fill: "url(#diagonalHatch)" }), _jsx("text", { x: "0", y: "0", transform: "rotate(90 0 0)", dominantBaseline: "middle", textAnchor: "middle", children: "Loading\u2026" }), _jsx("circle", { className: classes.path, fill: "none", strokeWidth: "4", strokeLinecap: "round", cx: "0", cy: "0", r: "60" })] }));
59
- });
60
- export default Loading;
@@ -1,9 +0,0 @@
1
- declare const baseChordDisplayConfig: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- onChordClick: {
3
- type: string;
4
- description: string;
5
- defaultValue: boolean;
6
- contextVariable: string[];
7
- };
8
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
9
- export { baseChordDisplayConfig };
@@ -1,13 +0,0 @@
1
- import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- function x() { }
3
- const baseChordDisplayConfig = ConfigurationSchema('BaseChordDisplay', {
4
- onChordClick: {
5
- type: 'boolean',
6
- description: 'callback that should be run when a chord in the track is clicked',
7
- defaultValue: false,
8
- contextVariable: ['feature', 'track', 'pluginManager'],
9
- },
10
- }, {
11
- explicitIdentifier: 'displayId',
12
- });
13
- export { baseChordDisplayConfig };
@@ -1,3 +0,0 @@
1
- export { default as BaseChordDisplayComponent } from './components/BaseChordDisplay';
2
- export { BaseChordDisplayModel } from './model';
3
- export { baseChordDisplayConfig } from './configSchema';
@@ -1,3 +0,0 @@
1
- export { default as BaseChordDisplayComponent } from './components/BaseChordDisplay';
2
- export { BaseChordDisplayModel } from './model';
3
- export { baseChordDisplayConfig } from './configSchema';
@@ -1,109 +0,0 @@
1
- import type { ExportSvgOptions } from '../CircularView/model';
2
- import type { AnyReactComponentType, Feature } from '@jbrowse/core/util';
3
- import type { ThemeOptions } from '@mui/material';
4
- export declare const BaseChordDisplayModel: import("mobx-state-tree").IModelType<{
5
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
6
- type: import("mobx-state-tree").ISimpleType<string>;
7
- rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
8
- } & {
9
- bezierRadiusRatio: import("mobx-state-tree").IType<number | undefined, number, number>;
10
- assemblyName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
11
- configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
12
- onChordClick: {
13
- type: string;
14
- description: string;
15
- defaultValue: boolean;
16
- contextVariable: string[];
17
- };
18
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
19
- }, {
20
- rendererTypeName: string;
21
- error: unknown;
22
- message: string | undefined;
23
- } & {
24
- readonly RenderingComponent: React.FC<{
25
- model: {
26
- id: string;
27
- type: string;
28
- rpcDriverName: string | undefined;
29
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
30
- rendererTypeName: string;
31
- error: unknown;
32
- message: string | undefined;
33
- } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
34
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
35
- type: import("mobx-state-tree").ISimpleType<string>;
36
- rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
37
- }, {
38
- rendererTypeName: string;
39
- error: unknown;
40
- message: string | undefined;
41
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
42
- onHorizontalScroll?: () => void;
43
- blockState?: Record<string, any>;
44
- }>;
45
- readonly DisplayBlurb: React.FC<{
46
- model: {
47
- id: string;
48
- type: string;
49
- rpcDriverName: string | undefined;
50
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
51
- rendererTypeName: string;
52
- error: unknown;
53
- message: string | undefined;
54
- } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
55
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
56
- type: import("mobx-state-tree").ISimpleType<string>;
57
- rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
58
- }, {
59
- rendererTypeName: string;
60
- error: unknown;
61
- message: string | undefined;
62
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
63
- }> | null;
64
- readonly adapterConfig: any;
65
- readonly parentTrack: any;
66
- renderProps(): any;
67
- readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
68
- readonly DisplayMessageComponent: undefined | React.FC<any>;
69
- trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
70
- readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
71
- regionCannotBeRendered(): null;
72
- } & {
73
- setMessage(arg?: string): void;
74
- setError(error?: unknown): void;
75
- setRpcDriverName(rpcDriverName: string): void;
76
- reload(): void;
77
- } & {
78
- filled: boolean;
79
- reactElement: React.ReactElement | undefined;
80
- data: undefined;
81
- html: string | undefined;
82
- message: string;
83
- renderingComponent: undefined | AnyReactComponentType;
84
- refNameMap: Record<string, string> | undefined;
85
- } & {
86
- onChordClick(feature: Feature): void;
87
- } & {
88
- readonly blockDefinitions: import("../CircularView/slices").Slice[];
89
- renderProps(): any;
90
- readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType | undefined;
91
- readonly selectedFeatureId: string | undefined;
92
- } & {
93
- renderStarted(): void;
94
- renderSuccess({ message, data, reactElement, html, renderingComponent, }: {
95
- message?: string;
96
- data?: any;
97
- html?: string;
98
- reactElement?: React.ReactElement;
99
- renderingComponent?: AnyReactComponentType;
100
- }): void;
101
- renderError(error: unknown): void;
102
- setRefNameMap(refNameMap: Record<string, string>): void;
103
- } & {
104
- afterAttach(): void;
105
- } & {
106
- renderSvg(opts: ExportSvgOptions & {
107
- theme?: ThemeOptions;
108
- }): Promise<import("react/jsx-runtime").JSX.Element>;
109
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;