@jbrowse/plugin-breakpoint-split-view 3.6.5 → 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 (99) hide show
  1. package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +1 -1
  2. package/esm/BreakpointAlignmentsFeatureDetail/index.js +2 -2
  3. package/esm/BreakpointGetFeatures/BreakpointGetFeatures.d.ts +51 -0
  4. package/esm/BreakpointGetFeatures/BreakpointGetFeatures.js +57 -0
  5. package/esm/BreakpointGetFeatures/index.d.ts +2 -0
  6. package/esm/BreakpointGetFeatures/index.js +4 -0
  7. package/esm/BreakpointSplitView/BreakpointSplitView.js +33 -47
  8. package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +2 -7
  9. package/esm/BreakpointSplitView/components/AlignmentConnections.js +20 -25
  10. package/esm/BreakpointSplitView/components/Breakends.d.ts +2 -7
  11. package/esm/BreakpointSplitView/components/Breakends.js +28 -59
  12. package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +1 -1
  13. package/esm/BreakpointSplitView/components/BreakpointSplitView.js +19 -5
  14. package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +1 -1
  15. package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +3 -3
  16. package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +1 -1
  17. package/esm/BreakpointSplitView/components/ExportSvgDialog.js +5 -1
  18. package/esm/BreakpointSplitView/components/Header.d.ts +5 -0
  19. package/esm/BreakpointSplitView/components/Header.js +47 -0
  20. package/esm/BreakpointSplitView/components/HeaderSearchBoxes.d.ts +5 -0
  21. package/esm/BreakpointSplitView/components/HeaderSearchBoxes.js +22 -0
  22. package/esm/BreakpointSplitView/components/Overlay.d.ts +1 -1
  23. package/esm/BreakpointSplitView/components/Overlay.js +8 -11
  24. package/esm/BreakpointSplitView/components/PairedFeatures.d.ts +2 -7
  25. package/esm/BreakpointSplitView/components/PairedFeatures.js +22 -47
  26. package/esm/BreakpointSplitView/components/Rubberband.d.ts +6 -0
  27. package/esm/BreakpointSplitView/components/Rubberband.js +27 -0
  28. package/esm/BreakpointSplitView/components/RubberbandSpan.d.ts +15 -0
  29. package/esm/BreakpointSplitView/components/RubberbandSpan.js +30 -0
  30. package/esm/BreakpointSplitView/components/RubberbandTooltip.d.ts +5 -0
  31. package/esm/BreakpointSplitView/components/RubberbandTooltip.js +17 -0
  32. package/esm/BreakpointSplitView/components/Translocations.d.ts +2 -7
  33. package/esm/BreakpointSplitView/components/Translocations.js +23 -58
  34. package/esm/BreakpointSplitView/components/VerticalGuide.d.ts +6 -0
  35. package/esm/BreakpointSplitView/components/VerticalGuide.js +24 -0
  36. package/esm/BreakpointSplitView/components/overlayUtils.d.ts +24 -0
  37. package/esm/BreakpointSplitView/components/overlayUtils.js +47 -0
  38. package/esm/BreakpointSplitView/components/rubberbandUtil.d.ts +4 -0
  39. package/esm/BreakpointSplitView/components/rubberbandUtil.js +3 -0
  40. package/esm/BreakpointSplitView/components/useRangeSelect.d.ts +59 -0
  41. package/esm/BreakpointSplitView/components/useRangeSelect.js +121 -0
  42. package/esm/BreakpointSplitView/components/util.js +1 -2
  43. package/esm/BreakpointSplitView/getClip.js +4 -4
  44. package/esm/BreakpointSplitView/index.js +2 -2
  45. package/esm/BreakpointSplitView/model.d.ts +403 -116
  46. package/esm/BreakpointSplitView/model.js +117 -41
  47. package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -2
  48. package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +8 -8
  49. package/esm/BreakpointSplitView/types.d.ts +8 -0
  50. package/esm/BreakpointSplitView/util.d.ts +1 -1
  51. package/esm/BreakpointSplitView/util.js +8 -17
  52. package/esm/LaunchBreakpointSplitView/index.d.ts +2 -0
  53. package/esm/LaunchBreakpointSplitView/index.js +12 -0
  54. package/esm/index.js +7 -6
  55. package/package.json +28 -34
  56. package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +0 -10
  57. package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +0 -12
  58. package/dist/BreakpointAlignmentsFeatureDetail/index.d.ts +0 -2
  59. package/dist/BreakpointAlignmentsFeatureDetail/index.js +0 -67
  60. package/dist/BreakpointSplitView/BreakpointSplitView.d.ts +0 -34
  61. package/dist/BreakpointSplitView/BreakpointSplitView.js +0 -84
  62. package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +0 -8
  63. package/dist/BreakpointSplitView/components/AlignmentConnections.js +0 -133
  64. package/dist/BreakpointSplitView/components/Breakends.d.ts +0 -8
  65. package/dist/BreakpointSplitView/components/Breakends.js +0 -95
  66. package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +0 -5
  67. package/dist/BreakpointSplitView/components/BreakpointSplitView.js +0 -45
  68. package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +0 -5
  69. package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +0 -33
  70. package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +0 -7
  71. package/dist/BreakpointSplitView/components/ExportSvgDialog.js +0 -57
  72. package/dist/BreakpointSplitView/components/Overlay.d.ts +0 -8
  73. package/dist/BreakpointSplitView/components/Overlay.js +0 -27
  74. package/dist/BreakpointSplitView/components/PairedFeatures.d.ts +0 -8
  75. package/dist/BreakpointSplitView/components/PairedFeatures.js +0 -75
  76. package/dist/BreakpointSplitView/components/Translocations.d.ts +0 -8
  77. package/dist/BreakpointSplitView/components/Translocations.js +0 -99
  78. package/dist/BreakpointSplitView/components/getOrientationColor.d.ts +0 -41
  79. package/dist/BreakpointSplitView/components/getOrientationColor.js +0 -103
  80. package/dist/BreakpointSplitView/components/util.d.ts +0 -8
  81. package/dist/BreakpointSplitView/components/util.js +0 -142
  82. package/dist/BreakpointSplitView/getClip.d.ts +0 -1
  83. package/dist/BreakpointSplitView/getClip.js +0 -10
  84. package/dist/BreakpointSplitView/index.d.ts +0 -2
  85. package/dist/BreakpointSplitView/index.js +0 -52
  86. package/dist/BreakpointSplitView/model.d.ts +0 -342
  87. package/dist/BreakpointSplitView/model.js +0 -244
  88. package/dist/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +0 -5
  89. package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +0 -10
  90. package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +0 -5
  91. package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +0 -41
  92. package/dist/BreakpointSplitView/svgcomponents/util.d.ts +0 -4
  93. package/dist/BreakpointSplitView/svgcomponents/util.js +0 -18
  94. package/dist/BreakpointSplitView/types.d.ts +0 -22
  95. package/dist/BreakpointSplitView/types.js +0 -2
  96. package/dist/BreakpointSplitView/util.d.ts +0 -28
  97. package/dist/BreakpointSplitView/util.js +0 -67
  98. package/dist/index.d.ts +0 -7
  99. package/dist/index.js +0 -20
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTrackNameMaxLen = getTrackNameMaxLen;
4
- exports.getTrackOffsets = getTrackOffsets;
5
- const util_1 = require("@jbrowse/core/util");
6
- const tracks_1 = require("@jbrowse/core/util/tracks");
7
- function getTrackNameMaxLen(views, fontSize, session) {
8
- return (0, util_1.max)(views.flatMap(view => view.tracks.map(t => (0, util_1.measureText)((0, tracks_1.getTrackName)(t.configuration, session), fontSize))), 0);
9
- }
10
- function getTrackOffsets(view, textOffset, extra = 0) {
11
- const offsets = {};
12
- let curr = textOffset;
13
- for (const track of view.tracks) {
14
- offsets[track.configuration.trackId] = curr + extra;
15
- curr += track.displays[0].height + textOffset;
16
- }
17
- return offsets;
18
- }
@@ -1,22 +0,0 @@
1
- export interface ExportSvgOptions {
2
- rasterizeLayers?: boolean;
3
- filename?: string;
4
- Wrapper?: React.FC<{
5
- children: React.ReactNode;
6
- }>;
7
- fontSize?: number;
8
- rulerHeight?: number;
9
- textHeight?: number;
10
- paddingHeight?: number;
11
- headerHeight?: number;
12
- cytobandHeight?: number;
13
- trackLabels?: string;
14
- themeName?: string;
15
- }
16
- export interface Breakend {
17
- MateDirection: string;
18
- Join: string;
19
- Replacement: string;
20
- MatePosition: string;
21
- }
22
- export type LayoutRecord = [number, number, number, number];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,28 +0,0 @@
1
- import type { LayoutRecord } from './types';
2
- import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
- import type { Feature } from '@jbrowse/core/util';
4
- import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
5
- type LGV = LinearGenomeViewModel;
6
- interface Display {
7
- height: number;
8
- scrollTop: number;
9
- SNPCoverageDisplay?: {
10
- height: number;
11
- };
12
- notReady?: () => boolean;
13
- searchFeatureByID?: (str: string) => LayoutRecord;
14
- }
15
- interface Track {
16
- displays: Display[];
17
- configuration: AnyConfigurationModel;
18
- }
19
- export declare function heightFromSpecificLevel(views: LGV[], trackId: string, level: number, getYPosOverride?: (trackId: string, level: number) => number): number;
20
- export declare function getPxFromCoordinate(view: LGV, refName: string, coord: number): number;
21
- export declare function yPos(trackId: string, level: number, views: LGV[], tracks: Track[], c: LayoutRecord, getYPosOverride?: (trackId: string, level: number) => number): number;
22
- export declare const useNextFrame: (variable: unknown) => void;
23
- export declare function intersect<T>(cb: (l: T) => string, a1?: T[], a2?: T[], ...rest: T[][]): T[];
24
- export declare function calc(track: Track, f: Feature): LayoutRecord | undefined;
25
- export declare function getBlockFeatures(model: {
26
- views: LinearGenomeViewModel[];
27
- }, track: Track): Promise<Feature[][][]>;
28
- export {};
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useNextFrame = void 0;
4
- exports.heightFromSpecificLevel = heightFromSpecificLevel;
5
- exports.getPxFromCoordinate = getPxFromCoordinate;
6
- exports.yPos = yPos;
7
- exports.intersect = intersect;
8
- exports.calc = calc;
9
- exports.getBlockFeatures = getBlockFeatures;
10
- const react_1 = require("react");
11
- const configuration_1 = require("@jbrowse/core/configuration");
12
- const util_1 = require("@jbrowse/core/util");
13
- const tracks_1 = require("@jbrowse/core/util/tracks");
14
- const [, TOP, , BOTTOM] = [0, 1, 2, 3];
15
- function cheight(chunk) {
16
- return chunk[BOTTOM] - chunk[TOP];
17
- }
18
- function heightFromSpecificLevel(views, trackId, level, getYPosOverride) {
19
- var _a;
20
- return getYPosOverride
21
- ? getYPosOverride(trackId, level)
22
- : ((_a = views[level].trackRefs[trackId]) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().top) || 0;
23
- }
24
- function getPxFromCoordinate(view, refName, coord) {
25
- var _a;
26
- return (((_a = view.bpToPx({ refName, coord })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - view.offsetPx;
27
- }
28
- function yPos(trackId, level, views, tracks, c, getYPosOverride) {
29
- const display = tracks[level].displays[0];
30
- const min = 0;
31
- const max = display.height;
32
- let offset = 0;
33
- const { SNPCoverageDisplay } = display;
34
- if (SNPCoverageDisplay) {
35
- offset = SNPCoverageDisplay.height;
36
- }
37
- const yPos = getYPosOverride ? 0 : display.scrollTop;
38
- return ((0, util_1.clamp)(c[TOP] - yPos + cheight(c) / 2 + offset, min, max) +
39
- heightFromSpecificLevel(views, trackId, level, getYPosOverride) +
40
- display.scrollTop);
41
- }
42
- const useNextFrame = (variable) => {
43
- const [, setNextFrameState] = (0, react_1.useState)();
44
- (0, react_1.useEffect)(() => {
45
- setNextFrameState(variable);
46
- }, [variable]);
47
- };
48
- exports.useNextFrame = useNextFrame;
49
- function intersect(cb, a1 = [], a2 = [], ...rest) {
50
- const ids = new Set(a2.map(elt => cb(elt)));
51
- const a12 = a1.filter(value => ids.has(cb(value)));
52
- return rest.length === 0 ? a12 : intersect(cb, a12, ...rest);
53
- }
54
- function calc(track, f) {
55
- var _a, _b;
56
- return (_b = (_a = track.displays[0]).searchFeatureByID) === null || _b === void 0 ? void 0 : _b.call(_a, f.id());
57
- }
58
- async function getBlockFeatures(model, track) {
59
- const { views } = model;
60
- const { rpcManager } = (0, util_1.getSession)(model);
61
- const sessionId = (0, tracks_1.getRpcSessionId)(track);
62
- return Promise.all(views.flatMap(async (view) => (await rpcManager.call(sessionId, 'CoreGetFeatures', {
63
- adapterConfig: (0, configuration_1.getConf)(track, ['adapter']),
64
- sessionId,
65
- regions: view.staticBlocks.contentBlocks,
66
- }))));
67
- }
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import Plugin from '@jbrowse/core/Plugin';
2
- import type PluginManager from '@jbrowse/core/PluginManager';
3
- export default class BreakpointSplitViewPlugin extends Plugin {
4
- name: string;
5
- install(pluginManager: PluginManager): void;
6
- configure(): void;
7
- }
package/dist/index.js DELETED
@@ -1,20 +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
- const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
7
- const BreakpointAlignmentsFeatureDetail_1 = __importDefault(require("./BreakpointAlignmentsFeatureDetail"));
8
- const BreakpointSplitView_1 = __importDefault(require("./BreakpointSplitView"));
9
- class BreakpointSplitViewPlugin extends Plugin_1.default {
10
- constructor() {
11
- super(...arguments);
12
- this.name = 'BreakpointSplitViewPlugin';
13
- }
14
- install(pluginManager) {
15
- (0, BreakpointSplitView_1.default)(pluginManager);
16
- (0, BreakpointAlignmentsFeatureDetail_1.default)(pluginManager);
17
- }
18
- configure() { }
19
- }
20
- exports.default = BreakpointSplitViewPlugin;