@jbrowse/plugin-breakpoint-split-view 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.
Files changed (75) hide show
  1. package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +5 -1
  2. package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +4 -3
  3. package/dist/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
  4. package/dist/BreakpointAlignmentsFeatureDetail/index.js +1 -1
  5. package/dist/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
  6. package/dist/BreakpointSplitView/BreakpointSplitView.js +41 -90
  7. package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +1 -1
  8. package/dist/BreakpointSplitView/components/AlignmentConnections.js +2 -11
  9. package/dist/BreakpointSplitView/components/Breakends.d.ts +1 -1
  10. package/dist/BreakpointSplitView/components/Breakends.js +4 -7
  11. package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +1 -1
  12. package/dist/BreakpointSplitView/components/BreakpointSplitView.js +1 -1
  13. package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +1 -1
  14. package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +2 -9
  15. package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +1 -1
  16. package/dist/BreakpointSplitView/components/ExportSvgDialog.js +2 -4
  17. package/dist/BreakpointSplitView/components/Overlay.d.ts +1 -1
  18. package/dist/BreakpointSplitView/components/Overlay.js +1 -3
  19. package/dist/BreakpointSplitView/components/PairedFeatures.d.ts +1 -1
  20. package/dist/BreakpointSplitView/components/PairedFeatures.js +2 -5
  21. package/dist/BreakpointSplitView/components/Translocations.d.ts +1 -1
  22. package/dist/BreakpointSplitView/components/Translocations.js +5 -12
  23. package/dist/BreakpointSplitView/components/getOrientationColor.js +0 -8
  24. package/dist/BreakpointSplitView/components/util.d.ts +1 -1
  25. package/dist/BreakpointSplitView/components/util.js +12 -12
  26. package/dist/BreakpointSplitView/index.d.ts +1 -1
  27. package/dist/BreakpointSplitView/index.js +2 -3
  28. package/dist/BreakpointSplitView/model.d.ts +6 -64
  29. package/dist/BreakpointSplitView/model.js +6 -91
  30. package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +1 -1
  31. package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +1 -1
  32. package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +4 -7
  33. package/dist/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
  34. package/dist/BreakpointSplitView/svgcomponents/util.js +0 -1
  35. package/dist/BreakpointSplitView/util.d.ts +2 -2
  36. package/dist/BreakpointSplitView/util.js +0 -8
  37. package/dist/index.d.ts +1 -1
  38. package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +5 -1
  39. package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +4 -3
  40. package/esm/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
  41. package/esm/BreakpointAlignmentsFeatureDetail/index.js +1 -1
  42. package/esm/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
  43. package/esm/BreakpointSplitView/BreakpointSplitView.js +41 -90
  44. package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +1 -1
  45. package/esm/BreakpointSplitView/components/AlignmentConnections.js +3 -12
  46. package/esm/BreakpointSplitView/components/Breakends.d.ts +1 -1
  47. package/esm/BreakpointSplitView/components/Breakends.js +6 -9
  48. package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +1 -1
  49. package/esm/BreakpointSplitView/components/BreakpointSplitView.js +1 -1
  50. package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +1 -1
  51. package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +2 -9
  52. package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +1 -1
  53. package/esm/BreakpointSplitView/components/ExportSvgDialog.js +2 -4
  54. package/esm/BreakpointSplitView/components/Overlay.d.ts +1 -1
  55. package/esm/BreakpointSplitView/components/Overlay.js +1 -3
  56. package/esm/BreakpointSplitView/components/PairedFeatures.d.ts +1 -1
  57. package/esm/BreakpointSplitView/components/PairedFeatures.js +4 -7
  58. package/esm/BreakpointSplitView/components/Translocations.d.ts +1 -1
  59. package/esm/BreakpointSplitView/components/Translocations.js +7 -14
  60. package/esm/BreakpointSplitView/components/getOrientationColor.js +0 -8
  61. package/esm/BreakpointSplitView/components/util.d.ts +1 -1
  62. package/esm/BreakpointSplitView/components/util.js +12 -12
  63. package/esm/BreakpointSplitView/index.d.ts +1 -1
  64. package/esm/BreakpointSplitView/index.js +2 -3
  65. package/esm/BreakpointSplitView/model.d.ts +6 -64
  66. package/esm/BreakpointSplitView/model.js +6 -91
  67. package/esm/BreakpointSplitView/svgcomponents/SVGBackground.js +1 -1
  68. package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +1 -1
  69. package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +4 -7
  70. package/esm/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
  71. package/esm/BreakpointSplitView/svgcomponents/util.js +0 -1
  72. package/esm/BreakpointSplitView/util.d.ts +2 -2
  73. package/esm/BreakpointSplitView/util.js +1 -9
  74. package/esm/index.d.ts +1 -1
  75. package/package.json +3 -3
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
+ import type { SimpleFeatureSerialized } from '@jbrowse/core/util';
2
3
  declare const BreakpointAlignmentsFeatureDetail: ({ model, }: {
3
4
  model: {
4
- featureData: Record<string, unknown>;
5
+ featureData: {
6
+ feature1: SimpleFeatureSerialized;
7
+ feature2: SimpleFeatureSerialized;
8
+ };
5
9
  };
6
10
  }) => React.JSX.Element;
7
11
  export default BreakpointAlignmentsFeatureDetail;
@@ -4,12 +4,13 @@ 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 BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
7
8
  const material_1 = require("@mui/material");
8
9
  const mobx_react_1 = require("mobx-react");
9
- const BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
10
10
  const BreakpointAlignmentsFeatureDetail = (0, mobx_react_1.observer)(function ({ model, }) {
11
- const { feature1, feature2 } = JSON.parse(JSON.stringify(model.featureData));
12
- return (react_1.default.createElement(material_1.Paper, { "data-testid": "alignment-side-drawer" },
11
+ const { featureData } = model;
12
+ const { feature1, feature2 } = structuredClone(featureData);
13
+ return (react_1.default.createElement(material_1.Paper, null,
13
14
  react_1.default.createElement(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 1", feature: feature1 }),
14
15
  react_1.default.createElement(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 2", feature: feature2 }),
15
16
  react_1.default.createElement(BaseFeatureDetail_1.BaseAttributes, { title: "Feature 1 attributes", feature: feature1 }),
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function BreakpointAlignmentsFeatureDetailF(pluginManager: PluginManager): void;
@@ -26,9 +26,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.default = BreakpointAlignmentsFeatureDetailF;
27
27
  const react_1 = require("react");
28
28
  const configuration_1 = require("@jbrowse/core/configuration");
29
+ const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
29
30
  const mst_1 = require("@jbrowse/core/util/types/mst");
30
31
  const mobx_state_tree_1 = require("mobx-state-tree");
31
- const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
32
32
  const configSchema = (0, configuration_1.ConfigurationSchema)('BreakpointAlignmentsWidget', {});
33
33
  const stateModel = mobx_state_tree_1.types
34
34
  .model('BreakpointAlignmentsWidget', {
@@ -1,52 +1,34 @@
1
- import { Feature, Region } from '@jbrowse/core/util';
2
1
  import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
3
- import { IStateTreeNode } from 'mobx-state-tree';
4
- import { Assembly } from '@jbrowse/core/assemblyManager/assembly';
2
+ import { type AbstractSessionModel, type Feature } from '@jbrowse/core/util';
3
+ import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
5
4
  export default class BreakpointSplitViewType extends ViewType {
6
5
  getBreakendCoveringRegions({ feature, assembly, }: {
7
6
  feature: Feature;
8
7
  assembly: Assembly;
9
8
  }): {
10
9
  pos: number;
11
- refName: string | undefined;
12
- mateRefName: string | undefined;
13
- matePos: number;
10
+ refName: string;
11
+ mateRefName: string;
12
+ matePos: any;
14
13
  };
15
- singleLevelSnapshotFromBreakendFeature(feature: Feature, view: {
16
- displayedRegions: Region[];
17
- } & IStateTreeNode): {
18
- type: string;
19
- views: {
20
- type: string;
21
- displayedRegions: {
22
- start: number;
23
- end: number;
24
- refName: string;
25
- assemblyName: string;
26
- }[];
27
- hideHeader: boolean;
28
- bpPerPx: number;
29
- offsetPx: number;
30
- }[];
31
- displayName: string;
32
- featureData: unknown;
33
- };
34
- snapshotFromBreakendFeature(feature: Feature, view: {
35
- displayedRegions: Region[];
36
- } & IStateTreeNode): {
37
- type: string;
38
- views: {
14
+ singleLevelSnapshotFromBreakendFeature({ feature, session, assemblyName, }: {
15
+ feature: Feature;
16
+ session: AbstractSessionModel;
17
+ assemblyName: string;
18
+ }): {
19
+ coverage: {
20
+ pos: number;
21
+ refName: string;
22
+ mateRefName: string;
23
+ matePos: any;
24
+ };
25
+ snap: {
39
26
  type: string;
40
- displayedRegions: {
41
- start: number;
42
- end: number;
43
- refName: string;
44
- assemblyName: string;
27
+ views: {
28
+ type: string;
29
+ displayedRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[];
45
30
  }[];
46
- hideHeader: boolean;
47
- bpPerPx: number;
48
- offsetPx: number;
49
- }[];
50
- displayName: string;
31
+ displayName: string;
32
+ };
51
33
  };
52
34
  }
@@ -3,9 +3,9 @@ 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
- const util_1 = require("@jbrowse/core/util");
7
- const ViewType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/ViewType"));
8
6
  const vcf_1 = require("@gmod/vcf");
7
+ const ViewType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/ViewType"));
8
+ const util_1 = require("@jbrowse/core/util");
9
9
  class BreakpointSplitViewType extends ViewType_1.default {
10
10
  getBreakendCoveringRegions({ feature, assembly, }) {
11
11
  var _a;
@@ -13,81 +13,44 @@ class BreakpointSplitViewType extends ViewType_1.default {
13
13
  const bnd = alt ? (0, vcf_1.parseBreakend)(alt) : undefined;
14
14
  const startPos = feature.get('start');
15
15
  const refName = feature.get('refName');
16
- let endPos;
17
- let mateRefName;
18
- // a VCF breakend feature
16
+ const f = (ref) => assembly.getCanonicalRefName(ref) || ref;
19
17
  if (alt === '<TRA>') {
20
18
  const INFO = feature.get('INFO');
21
- endPos = INFO.END[0] - 1;
22
- mateRefName = INFO.CHR2[0];
19
+ return {
20
+ pos: startPos,
21
+ refName: f(refName),
22
+ mateRefName: f(INFO.CHR2[0]),
23
+ matePos: INFO.END[0] - 1,
24
+ };
23
25
  }
24
26
  else if (bnd === null || bnd === void 0 ? void 0 : bnd.MatePosition) {
25
27
  const matePosition = bnd.MatePosition.split(':');
26
- endPos = +matePosition[1] - 1;
27
- mateRefName = matePosition[0];
28
+ return {
29
+ pos: startPos,
30
+ refName: f(refName),
31
+ mateRefName: f(matePosition[0]),
32
+ matePos: +matePosition[1] - 1,
33
+ };
28
34
  }
29
35
  else if (feature.get('mate')) {
30
- // a generic 'mate' feature
31
36
  const mate = feature.get('mate');
32
- mateRefName = mate.refName;
33
- endPos = mate.start;
37
+ return {
38
+ pos: startPos,
39
+ refName: f(refName),
40
+ mateRefName: f(mate.refName),
41
+ matePos: mate.start,
42
+ };
34
43
  }
35
44
  else {
36
- endPos = startPos + 1;
37
- }
38
- if (!mateRefName) {
39
- throw new Error(`unable to resolve mate refName ${mateRefName} in reference genome`);
45
+ return {
46
+ pos: startPos,
47
+ refName: f(refName),
48
+ mateRefName: f(refName),
49
+ matePos: feature.get('end'),
50
+ };
40
51
  }
41
- return {
42
- pos: startPos,
43
- refName: assembly.getCanonicalRefName(refName),
44
- mateRefName: assembly.getCanonicalRefName(mateRefName),
45
- matePos: endPos,
46
- };
47
- }
48
- singleLevelSnapshotFromBreakendFeature(feature, view) {
49
- const session = (0, util_1.getSession)(view);
50
- const bpPerPx = 10;
51
- const { assemblyName } = view.displayedRegions[0];
52
- const { assemblyManager } = session;
53
- const assembly = assemblyManager.get(assemblyName);
54
- if (!assembly) {
55
- throw new Error(`assembly ${assemblyName} not found`);
56
- }
57
- if (!assembly.regions) {
58
- throw new Error(`assembly ${assemblyName} regions not loaded`);
59
- }
60
- const { refName, pos: startPos, mateRefName, matePos: endPos, } = this.getBreakendCoveringRegions({
61
- feature,
62
- assembly,
63
- });
64
- const topRegion = assembly.regions.find(f => f.refName === refName);
65
- const bottomRegion = assembly.regions.find(f => f.refName === mateRefName);
66
- const topMarkedRegion = [{ ...topRegion }, { ...topRegion }];
67
- const bottomMarkedRegion = [{ ...bottomRegion }, { ...bottomRegion }];
68
- topMarkedRegion[0].end = startPos;
69
- topMarkedRegion[1].start = startPos;
70
- bottomMarkedRegion[0].end = endPos;
71
- bottomMarkedRegion[1].start = endPos;
72
- return {
73
- type: 'BreakpointSplitView',
74
- views: [
75
- {
76
- type: 'LinearGenomeView',
77
- displayedRegions: topMarkedRegion,
78
- hideHeader: true,
79
- bpPerPx,
80
- offsetPx: (topRegion.start + feature.get('start')) / bpPerPx,
81
- },
82
- ],
83
- displayName: `${feature.get('name') || feature.get('id') || 'breakend'} split detail`,
84
- featureData: undefined,
85
- };
86
52
  }
87
- snapshotFromBreakendFeature(feature, view) {
88
- const session = (0, util_1.getSession)(view);
89
- const bpPerPx = 10;
90
- const { assemblyName } = view.displayedRegions[0];
53
+ singleLevelSnapshotFromBreakendFeature({ feature, session, assemblyName, }) {
91
54
  const { assemblyManager } = session;
92
55
  const assembly = assemblyManager.get(assemblyName);
93
56
  if (!assembly) {
@@ -96,37 +59,25 @@ class BreakpointSplitViewType extends ViewType_1.default {
96
59
  if (!assembly.regions) {
97
60
  throw new Error(`assembly ${assemblyName} regions not loaded`);
98
61
  }
99
- const { refName, pos: startPos, mateRefName, matePos: endPos, } = this.getBreakendCoveringRegions({
62
+ const coverage = this.getBreakendCoveringRegions({
100
63
  feature,
101
64
  assembly,
102
65
  });
66
+ const { refName, mateRefName } = coverage;
103
67
  const topRegion = assembly.regions.find(f => f.refName === refName);
104
68
  const bottomRegion = assembly.regions.find(f => f.refName === mateRefName);
105
- const topMarkedRegion = [{ ...topRegion }, { ...topRegion }];
106
- const bottomMarkedRegion = [{ ...bottomRegion }, { ...bottomRegion }];
107
- topMarkedRegion[0].end = startPos;
108
- topMarkedRegion[1].start = startPos;
109
- bottomMarkedRegion[0].end = endPos;
110
- bottomMarkedRegion[1].start = endPos;
111
69
  return {
112
- type: 'BreakpointSplitView',
113
- views: [
114
- {
115
- type: 'LinearGenomeView',
116
- displayedRegions: topMarkedRegion,
117
- hideHeader: true,
118
- bpPerPx,
119
- offsetPx: (topRegion.start + feature.get('start')) / bpPerPx,
120
- },
121
- {
122
- type: 'LinearGenomeView',
123
- displayedRegions: bottomMarkedRegion,
124
- hideHeader: true,
125
- bpPerPx,
126
- offsetPx: (bottomRegion.start + endPos) / bpPerPx,
127
- },
128
- ],
129
- displayName: `${feature.get('name') || feature.get('id') || 'breakend'} split detail`,
70
+ coverage,
71
+ snap: {
72
+ type: 'BreakpointSplitView',
73
+ views: [
74
+ {
75
+ type: 'LinearGenomeView',
76
+ displayedRegions: (0, util_1.gatherOverlaps)([topRegion, bottomRegion]),
77
+ },
78
+ ],
79
+ displayName: `${feature.get('name') || feature.get('id') || 'breakend'} split detail`,
80
+ },
130
81
  };
131
82
  }
132
83
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BreakpointViewModel } from '../model';
2
+ import type { BreakpointViewModel } from '../model';
3
3
  declare const AlignmentConnections: ({ model, trackId, parentRef, getTrackYPosOverride, }: {
4
4
  model: BreakpointViewModel;
5
5
  trackId: string;
@@ -24,11 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const react_1 = __importStar(require("react"));
27
+ const util_1 = require("@jbrowse/core/util");
28
+ const material_1 = require("@mui/material");
27
29
  const mobx_react_1 = require("mobx-react");
28
30
  const mobx_state_tree_1 = require("mobx-state-tree");
29
- const material_1 = require("@mui/material");
30
- const util_1 = require("@jbrowse/core/util");
31
- // locals
32
31
  const util_2 = require("./util");
33
32
  const util_3 = require("../util");
34
33
  const getOrientationColor_1 = require("./getOrientationColor");
@@ -63,8 +62,6 @@ const AlignmentConnections = (0, mobx_react_1.observer)(function ({ model, track
63
62
  }
64
63
  return assembly ? (react_1.default.createElement("g", { fill: "none", "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId }, layoutMatches.map(chunk => {
65
64
  const ret = [];
66
- // we follow a path in the list of chunks, not from top to bottom, just in series
67
- // following x1,y1 -> x2,y2
68
65
  for (let i = 0; i < chunk.length - 1; i++) {
69
66
  const { layout: c1, feature: f1, level: level1 } = chunk[i];
70
67
  const { layout: c2, feature: f2, level: level2 } = chunk[i + 1];
@@ -72,7 +69,6 @@ const AlignmentConnections = (0, mobx_react_1.observer)(function ({ model, track
72
69
  console.warn('received null layout for a overlay feature');
73
70
  return null;
74
71
  }
75
- // disable rendering connections in a single row
76
72
  if (!showIntraviewLinks && level1 === level2) {
77
73
  return null;
78
74
  }
@@ -121,24 +117,19 @@ const AlignmentConnections = (0, mobx_react_1.observer)(function ({ model, track
121
117
  : 0;
122
118
  const pf1 = hasPaired ? -1 : 1;
123
119
  const y0 = (0, util_3.heightFromSpecificLevel)(views, trackId, level1, getTrackYPosOverride);
124
- // possible todo: use totalCurveHeight to possibly make alternative
125
- // squiggle if the S is too small
126
120
  const path = [
127
121
  'M',
128
122
  x1,
129
123
  y1,
130
124
  'C',
131
- // first bezier x,y
132
125
  x1 + 200 * f1.get('strand') * rf1,
133
126
  abnormalSpecialRenderFlag
134
127
  ? Math.min(y0 - yOffset + trackHeight, y1 + trackHeight)
135
128
  : y1,
136
- // second bezier x,y
137
129
  x2 - 200 * f2.get('strand') * rf2 * pf1,
138
130
  abnormalSpecialRenderFlag
139
131
  ? Math.min(y0 - yOffset + trackHeight, y2 + trackHeight)
140
132
  : y2,
141
- // third bezier x,y
142
133
  x2,
143
134
  y2,
144
135
  ].join(' ');
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BreakpointViewModel } from '../model';
2
+ import type { BreakpointViewModel } from '../model';
3
3
  declare const Breakends: ({ model, trackId, parentRef: ref, getTrackYPosOverride, }: {
4
4
  model: BreakpointViewModel;
5
5
  trackId: string;
@@ -27,7 +27,6 @@ const react_1 = __importStar(require("react"));
27
27
  const util_1 = require("@jbrowse/core/util");
28
28
  const mobx_react_1 = require("mobx-react");
29
29
  const mobx_state_tree_1 = require("mobx-state-tree");
30
- // locals
31
30
  const util_2 = require("./util");
32
31
  const util_3 = require("../util");
33
32
  const [LEFT] = [0, 1, 2, 3];
@@ -51,8 +50,6 @@ const Breakends = (0, mobx_react_1.observer)(function ({ model, trackId, parentR
51
50
  }
52
51
  return (react_1.default.createElement("g", { stroke: "green", strokeWidth: 5, fill: "none", "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId }, layoutMatches.map(chunk => {
53
52
  const ret = [];
54
- // we follow a path in the list of chunks, not from top to bottom, just
55
- // in series following x1,y1 -> x2,y2
56
53
  for (let i = 0; i < chunk.length - 1; i += 1) {
57
54
  const { layout: c1, feature: f1, level: level1 } = chunk[i];
58
55
  const { layout: c2, feature: f2, level: level2 } = chunk[i + 1];
@@ -82,19 +79,19 @@ const Breakends = (0, mobx_react_1.observer)(function ({ model, trackId, parentR
82
79
  }
83
80
  else {
84
81
  const path = [
85
- 'M', // move to
82
+ 'M',
86
83
  x1 -
87
84
  20 *
88
85
  (relevantAlt.Join === 'left' ? -1 : 1) *
89
86
  (reversed1 ? -1 : 1),
90
87
  y1,
91
- 'L', // line to
88
+ 'L',
92
89
  x1,
93
90
  y1,
94
- 'L', // line to
91
+ 'L',
95
92
  x2,
96
93
  y2,
97
- 'L', // line to
94
+ 'L',
98
95
  x2 -
99
96
  20 *
100
97
  (relevantAlt.MateDirection === 'left' ? 1 : -1) *
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BreakpointViewModel } from '../model';
2
+ import type { BreakpointViewModel } from '../model';
3
3
  declare const BreakpointSplitView: ({ model, }: {
4
4
  model: BreakpointViewModel;
5
5
  }) => React.JSX.Element;
@@ -4,8 +4,8 @@ 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");
8
+ const mobx_react_1 = require("mobx-react");
9
9
  const mui_1 = require("tss-react/mui");
10
10
  const BreakpointSplitViewOverlay_1 = __importDefault(require("./BreakpointSplitViewOverlay"));
11
11
  const useStyles = (0, mui_1.makeStyles)()(theme => ({
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BreakpointViewModel } from '../model';
2
+ import type { BreakpointViewModel } from '../model';
3
3
  declare const BreakpointSplitViewOverlay: ({ model, }: {
4
4
  model: BreakpointViewModel;
5
5
  }) => React.JSX.Element;
@@ -27,9 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const react_1 = __importStar(require("react"));
30
+ const mobx_react_1 = require("mobx-react");
30
31
  const mui_1 = require("tss-react/mui");
31
32
  const Overlay_1 = __importDefault(require("./Overlay"));
32
- const mobx_react_1 = require("mobx-react");
33
33
  const useStyles = (0, mui_1.makeStyles)()({
34
34
  overlay: {
35
35
  display: 'flex',
@@ -50,13 +50,6 @@ const BreakpointSplitViewOverlay = (0, mobx_react_1.observer)(function ({ model,
50
50
  width: '100%',
51
51
  zIndex: 10,
52
52
  pointerEvents: interactToggled ? undefined : 'none',
53
- } }, matchedTracks.map(track => (
54
- // note: we must pass ref down, because:
55
- // - the child component needs to getBoundingClientRect on the this
56
- // components SVG, and...
57
- // - we cannot rely on using getBoundingClientRect in this component
58
- // to make sure this works because if it gets shifted around by
59
- // another element, this will not re-render necessarily
60
- react_1.default.createElement(Overlay_1.default, { parentRef: ref, key: track.configuration.trackId, model: model, trackId: track.configuration.trackId }))))));
53
+ } }, matchedTracks.map(track => (react_1.default.createElement(Overlay_1.default, { parentRef: ref, key: track.configuration.trackId, model: model, trackId: track.configuration.trackId }))))));
61
54
  });
62
55
  exports.default = BreakpointSplitViewOverlay;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ExportSvgOptions } from '../model';
2
+ import type { ExportSvgOptions } from '../model';
3
3
  export default function ExportSvgDialog({ model, handleClose, }: {
4
4
  model: {
5
5
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.default = ExportSvgDialog;
27
27
  const react_1 = __importStar(require("react"));
28
- const material_1 = require("@mui/material");
29
28
  const ui_1 = require("@jbrowse/core/ui");
30
29
  const util_1 = require("@jbrowse/core/util");
30
+ const material_1 = require("@mui/material");
31
31
  function LoadingMessage() {
32
32
  return (react_1.default.createElement("div", null,
33
33
  react_1.default.createElement(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }),
@@ -65,9 +65,7 @@ function ExportSvgDialog({ model, handleClose, }) {
65
65
  react_1.default.createElement("br", null),
66
66
  session.allThemes ? (react_1.default.createElement(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
67
67
  setThemeName(event.target.value);
68
- } }, Object.entries(session.allThemes()).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key },
69
- // @ts-expect-error
70
- val.name || '(Unknown name)'))))) : null,
68
+ } }, Object.entries(session.allThemes()).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key }, val.name || '(Unknown name)'))))) : null,
71
69
  offscreenCanvas ? (react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => {
72
70
  setRasterizeLayers(val => !val);
73
71
  } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (react_1.default.createElement(material_1.Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BreakpointViewModel } from '../model';
2
+ import type { BreakpointViewModel } from '../model';
3
3
  declare const Overlay: (props: {
4
4
  parentRef: React.RefObject<SVGSVGElement>;
5
5
  model: BreakpointViewModel;
@@ -7,17 +7,15 @@ const react_1 = __importDefault(require("react"));
7
7
  const mobx_react_1 = require("mobx-react");
8
8
  const AlignmentConnections_1 = __importDefault(require("./AlignmentConnections"));
9
9
  const Breakends_1 = __importDefault(require("./Breakends"));
10
- const Translocations_1 = __importDefault(require("./Translocations"));
11
10
  const PairedFeatures_1 = __importDefault(require("./PairedFeatures"));
11
+ const Translocations_1 = __importDefault(require("./Translocations"));
12
12
  const Overlay = (0, mobx_react_1.observer)(function (props) {
13
13
  var _a, _b;
14
14
  const { model, trackId } = props;
15
15
  const tracks = model.getMatchedTracks(trackId);
16
- // curvy line type arcs
17
16
  if (((_a = tracks[0]) === null || _a === void 0 ? void 0 : _a.type) === 'AlignmentsTrack') {
18
17
  return react_1.default.createElement(AlignmentConnections_1.default, { ...props });
19
18
  }
20
- // translocation type arcs
21
19
  else if (((_b = tracks[0]) === null || _b === void 0 ? void 0 : _b.type) === 'VariantTrack') {
22
20
  return model.hasTranslocations(trackId) ? (react_1.default.createElement(Translocations_1.default, { ...props })) : model.hasPairedFeatures(trackId) ? (react_1.default.createElement(PairedFeatures_1.default, { ...props })) : (react_1.default.createElement(Breakends_1.default, { ...props }));
23
21
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BreakpointViewModel } from '../model';
2
+ import type { BreakpointViewModel } from '../model';
3
3
  declare const PairedFeatures: ({ model, trackId, parentRef: ref, getTrackYPosOverride, }: {
4
4
  model: BreakpointViewModel;
5
5
  trackId: string;
@@ -27,7 +27,6 @@ const react_1 = __importStar(require("react"));
27
27
  const util_1 = require("@jbrowse/core/util");
28
28
  const mobx_react_1 = require("mobx-react");
29
29
  const mobx_state_tree_1 = require("mobx-state-tree");
30
- // locals
31
30
  const util_2 = require("./util");
32
31
  const util_3 = require("../util");
33
32
  const [LEFT] = [0, 1, 2, 3];
@@ -51,8 +50,6 @@ const PairedFeatures = (0, mobx_react_1.observer)(function ({ model, trackId, pa
51
50
  }
52
51
  return (react_1.default.createElement("g", { stroke: "green", strokeWidth: 5, fill: "none", "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId }, layoutMatches.map(chunk => {
53
52
  const ret = [];
54
- // we follow a path in the list of chunks, not from top to bottom, just
55
- // in series following x1,y1 -> x2,y2
56
53
  for (let i = 0; i < chunk.length - 1; i += 1) {
57
54
  const { layout: c1, feature: f1, level: level1 } = chunk[i];
58
55
  const { layout: c2, feature: f2, level: level2 } = chunk[i + 1];
@@ -75,10 +72,10 @@ const PairedFeatures = (0, mobx_react_1.observer)(function ({ model, trackId, pa
75
72
  const y2 = (0, util_3.yPos)(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
76
73
  yoff;
77
74
  const path = [
78
- 'M', // move to
75
+ 'M',
79
76
  x1,
80
77
  y1,
81
- 'L', // line to
78
+ 'L',
82
79
  x2,
83
80
  y2,
84
81
  ].join(' ');
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BreakpointViewModel } from '../model';
2
+ import type { BreakpointViewModel } from '../model';
3
3
  declare const Translocations: ({ model, trackId, parentRef: ref, getTrackYPosOverride, }: {
4
4
  model: BreakpointViewModel;
5
5
  trackId: string;
@@ -27,7 +27,6 @@ const react_1 = __importStar(require("react"));
27
27
  const util_1 = require("@jbrowse/core/util");
28
28
  const mobx_react_1 = require("mobx-react");
29
29
  const mobx_state_tree_1 = require("mobx-state-tree");
30
- // locals
31
30
  const util_2 = require("./util");
32
31
  const util_3 = require("../util");
33
32
  const [LEFT] = [0, 1, 2, 3];
@@ -60,17 +59,11 @@ const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, pa
60
59
  const rect = ref.current.getBoundingClientRect();
61
60
  yOffset = rect.top;
62
61
  }
63
- // we hardcode the TRA to go to the "other view" and if there is none, we
64
- // just return null here note: would need to do processing of the INFO
65
- // CHR2/END and see which view could contain those coordinates to really do
66
- // it properly
67
62
  if (views.length < 2) {
68
63
  return null;
69
64
  }
70
65
  return (react_1.default.createElement("g", { fill: "none", stroke: "green", strokeWidth: 5, "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId }, layoutMatches.map(chunk => {
71
66
  var _a, _b;
72
- // we follow a path in the list of chunks, not from top to bottom,
73
- // just in series following x1,y1 -> x2,y2
74
67
  const ret = [];
75
68
  for (const { layout: c1, feature: f1, level: level1 } of chunk) {
76
69
  const level2 = level1 === 0 ? 1 : 0;
@@ -81,7 +74,7 @@ const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, pa
81
74
  const info = f1.get('INFO');
82
75
  const chr2 = info.CHR2[0];
83
76
  const end2 = info.END[0];
84
- const res = (_b = (_a = info.STRANDS) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.split(''); // not all files have STRANDS
77
+ const res = (_b = (_a = info.STRANDS) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.split('');
85
78
  const [myDirection, mateDirection] = res !== null && res !== void 0 ? res : ['.', '.'];
86
79
  const r = (0, util_3.getPxFromCoordinate)(views[level2], chr2, end2);
87
80
  if (r) {
@@ -96,16 +89,16 @@ const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, pa
96
89
  const y2 = (0, util_3.yPos)(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
97
90
  yOffset;
98
91
  const path = [
99
- 'M', // move to
92
+ 'M',
100
93
  x1 - 20 * str(myDirection) * (reversed1 ? -1 : 1),
101
94
  y1,
102
- 'L', // line to
95
+ 'L',
103
96
  x1,
104
97
  y1,
105
- 'L', // line to as const
98
+ 'L',
106
99
  x2,
107
100
  y2,
108
- 'L', // line to
101
+ 'L',
109
102
  x2 - 20 * str(mateDirection) * (reversed2 ? -1 : 1),
110
103
  y2,
111
104
  ].join(' ');