@jbrowse/plugin-linear-comparative-view 2.13.0 → 2.14.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 (63) hide show
  1. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +9 -3
  2. package/dist/LGVSyntenyDisplay/components/util.js +4 -3
  3. package/dist/LGVSyntenyDisplay/model.d.ts +4 -3
  4. package/dist/LaunchLinearSyntenyView.js +7 -3
  5. package/dist/LinearComparativeDisplay/configSchemaF.js +0 -1
  6. package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +3 -3
  7. package/dist/LinearComparativeDisplay/stateModelFactory.js +2 -2
  8. package/dist/LinearComparativeView/components/Header.js +6 -2
  9. package/dist/LinearComparativeView/components/Rubberband.js +9 -9
  10. package/dist/LinearComparativeView/model.d.ts +15 -18
  11. package/dist/LinearComparativeView/model.js +17 -23
  12. package/dist/LinearReadVsRef/LinearReadVsRef.js +6 -4
  13. package/dist/LinearSyntenyDisplay/afterAttach.js +2 -2
  14. package/dist/LinearSyntenyDisplay/components/Component.js +6 -2
  15. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +29 -15
  16. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +4 -1
  17. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -6
  18. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
  19. package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -1
  20. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  21. package/dist/LinearSyntenyDisplay/drawSynteny.js +16 -8
  22. package/dist/LinearSyntenyDisplay/model.d.ts +9 -5
  23. package/dist/LinearSyntenyView/components/ExportSvgDialog.js +16 -6
  24. package/dist/LinearSyntenyView/components/ImportForm/ImportCustomTrack.js +14 -4
  25. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.js +3 -1
  26. package/dist/LinearSyntenyView/components/ImportForm/index.js +15 -5
  27. package/dist/LinearSyntenyView/model.d.ts +12 -13
  28. package/dist/LinearSyntenyView/model.js +3 -1
  29. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +9 -7
  30. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -1
  31. package/dist/util.js +4 -3
  32. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +9 -3
  33. package/esm/LGVSyntenyDisplay/components/util.js +4 -3
  34. package/esm/LGVSyntenyDisplay/model.d.ts +4 -3
  35. package/esm/LaunchLinearSyntenyView.js +7 -3
  36. package/esm/LinearComparativeDisplay/configSchemaF.js +0 -1
  37. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +3 -3
  38. package/esm/LinearComparativeDisplay/stateModelFactory.js +2 -2
  39. package/esm/LinearComparativeView/components/Header.js +6 -2
  40. package/esm/LinearComparativeView/components/Rubberband.js +9 -9
  41. package/esm/LinearComparativeView/model.d.ts +15 -18
  42. package/esm/LinearComparativeView/model.js +18 -24
  43. package/esm/LinearReadVsRef/LinearReadVsRef.js +6 -4
  44. package/esm/LinearSyntenyDisplay/afterAttach.js +2 -2
  45. package/esm/LinearSyntenyDisplay/components/Component.js +6 -2
  46. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +29 -15
  47. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +4 -1
  48. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -6
  49. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
  50. package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -1
  51. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  52. package/esm/LinearSyntenyDisplay/drawSynteny.js +16 -8
  53. package/esm/LinearSyntenyDisplay/model.d.ts +9 -5
  54. package/esm/LinearSyntenyView/components/ExportSvgDialog.js +16 -6
  55. package/esm/LinearSyntenyView/components/ImportForm/ImportCustomTrack.js +14 -4
  56. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.js +3 -1
  57. package/esm/LinearSyntenyView/components/ImportForm/index.js +15 -5
  58. package/esm/LinearSyntenyView/model.d.ts +12 -13
  59. package/esm/LinearSyntenyView/model.js +3 -1
  60. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +9 -7
  61. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -1
  62. package/esm/util.js +4 -3
  63. package/package.json +3 -3
@@ -93,7 +93,7 @@ export function drawRef(model, ctx1, ctx3) {
93
93
  // cx1/cx2 are the current x positions on top and bottom rows
94
94
  let cx1 = k1;
95
95
  let cx2 = s1 === -1 ? x22 : x21;
96
- if ((cigar === null || cigar === void 0 ? void 0 : cigar.length) && drawCIGAR) {
96
+ if (cigar.length && drawCIGAR) {
97
97
  // continuingFlag skips drawing commands on very small CIGAR features
98
98
  let continuingFlag = false;
99
99
  // px1/px2 are the previous x positions on the top and bottom rows
@@ -117,6 +117,7 @@ export function drawRef(model, ctx1, ctx3) {
117
117
  else if (op === 'D' || op === 'N') {
118
118
  cx1 += d1 * rev1;
119
119
  }
120
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
120
121
  else if (op === 'I') {
121
122
  cx2 += d2 * rev2;
122
123
  }
@@ -134,12 +135,12 @@ export function drawRef(model, ctx1, ctx3) {
134
135
  continuingFlag = true;
135
136
  }
136
137
  else {
137
- continuingFlag = false;
138
- // allow rendering the dominant color when using continuing
139
- // flag if the last element of continuing was a large
140
- // feature, else just use match
138
+ // allow rendering the dominant color when using continuing flag
139
+ // if the last element of continuing was a large feature, else
140
+ // just use match
141
141
  ctx1.fillStyle =
142
142
  colorMap[(continuingFlag && d1 > 1) || d2 > 1 ? op : 'M'];
143
+ continuingFlag = false;
143
144
  draw(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
144
145
  if (ctx3) {
145
146
  ctx3.fillStyle = makeColor(idx);
@@ -167,7 +168,9 @@ export function drawRef(model, ctx1, ctx3) {
167
168
  ctx2.fillStyle = makeColor(idx);
168
169
  // too many click map false positives with colored stroked lines
169
170
  drawMatchSimple({
170
- cb: ctx => ctx.fill(),
171
+ cb: ctx => {
172
+ ctx.fill();
173
+ },
171
174
  feature,
172
175
  ctx: ctx2,
173
176
  drawCurves,
@@ -178,6 +181,7 @@ export function drawRef(model, ctx1, ctx3) {
178
181
  height,
179
182
  });
180
183
  }
184
+ return undefined;
181
185
  }
182
186
  export function drawMouseoverSynteny(model) {
183
187
  var _a;
@@ -199,7 +203,9 @@ export function drawMouseoverSynteny(model) {
199
203
  if (feature1) {
200
204
  ctx.fillStyle = 'rgb(0,0,0,0.1)';
201
205
  drawMatchSimple({
202
- cb: ctx => ctx.fill(),
206
+ cb: ctx => {
207
+ ctx.fill();
208
+ },
203
209
  feature: feature1,
204
210
  ctx,
205
211
  oobLimit,
@@ -213,7 +219,9 @@ export function drawMouseoverSynteny(model) {
213
219
  if (feature2) {
214
220
  ctx.strokeStyle = 'rgb(0, 0, 0, 0.9)';
215
221
  drawMatchSimple({
216
- cb: ctx => ctx.stroke(),
222
+ cb: ctx => {
223
+ ctx.stroke();
224
+ },
217
225
  feature: feature2,
218
226
  ctx,
219
227
  oobLimit,
@@ -57,7 +57,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
57
57
  error: unknown;
58
58
  message: string | undefined;
59
59
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
60
- onHorizontalScroll?: Function;
60
+ onHorizontalScroll?: () => void;
61
61
  blockState?: Record<string, any>;
62
62
  }>;
63
63
  readonly DisplayBlurb: import("react").FC<{
@@ -77,7 +77,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
77
77
  rendererTypeName: string;
78
78
  error: unknown;
79
79
  message: string | undefined;
80
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
80
+ }, import("mobx-state-tree" /**
81
+ * #action
82
+ */)._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
81
83
  }> | null;
82
84
  readonly adapterConfig: any;
83
85
  readonly parentTrack: any;
@@ -138,7 +140,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
138
140
  error: unknown;
139
141
  message: string | undefined;
140
142
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
141
- onHorizontalScroll?: Function;
143
+ onHorizontalScroll?: () => void;
142
144
  blockState?: Record<string, any>;
143
145
  }>;
144
146
  readonly DisplayBlurb: import("react").FC<{
@@ -158,7 +160,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
158
160
  rendererTypeName: string;
159
161
  error: unknown;
160
162
  message: string | undefined;
161
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
163
+ }, import("mobx-state-tree" /**
164
+ * #action
165
+ */)._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
162
166
  }> | null;
163
167
  readonly adapterConfig: any;
164
168
  readonly parentTrack: any;
@@ -208,7 +212,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
208
212
  error: unknown;
209
213
  message: string | undefined;
210
214
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
211
- onHorizontalScroll?: Function;
215
+ onHorizontalScroll?: () => void;
212
216
  blockState?: Record<string, any>;
213
217
  }>;
214
218
  readonly DisplayBlurb: import("react").FC<{
@@ -8,7 +8,7 @@ function LoadingMessage() {
8
8
  React.createElement(Typography, { display: "inline" }, "Creating SVG")));
9
9
  }
10
10
  function useSvgLocal(key, val) {
11
- return useLocalStorage('svg-' + key, val);
11
+ return useLocalStorage(`svg-${key}`, val);
12
12
  }
13
13
  function TextField2({ children, ...rest }) {
14
14
  return (React.createElement("div", null,
@@ -26,19 +26,29 @@ export default function ExportSvgDialog({ model, handleClose, }) {
26
26
  return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Export SVG" },
27
27
  React.createElement(DialogContent, null,
28
28
  error ? (React.createElement(ErrorMessage, { error: error })) : loading ? (React.createElement(LoadingMessage, null)) : null,
29
- React.createElement(TextField2, { helperText: "filename", value: filename, onChange: event => setFilename(event.target.value) }),
30
- React.createElement(TextField2, { select: true, label: "Track label positioning", variant: "outlined", value: trackLabels, style: { width: 150 }, onChange: event => setTrackLabels(event.target.value) },
29
+ React.createElement(TextField2, { helperText: "filename", value: filename, onChange: event => {
30
+ setFilename(event.target.value);
31
+ } }),
32
+ React.createElement(TextField2, { select: true, label: "Track label positioning", variant: "outlined", value: trackLabels, style: { width: 150 }, onChange: event => {
33
+ setTrackLabels(event.target.value);
34
+ } },
31
35
  React.createElement(MenuItem, { value: "offset" }, "Offset"),
32
36
  React.createElement(MenuItem, { value: "overlay" }, "Overlay"),
33
37
  React.createElement(MenuItem, { value: "left" }, "Left"),
34
38
  React.createElement(MenuItem, { value: "none" }, "None")),
35
39
  React.createElement("br", null),
36
- session.allThemes ? (React.createElement(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => setThemeName(event.target.value) }, Object.entries(session.allThemes()).map(([key, val]) => (React.createElement(MenuItem, { key: key, value: key },
40
+ session.allThemes ? (React.createElement(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
41
+ setThemeName(event.target.value);
42
+ } }, Object.entries(session.allThemes()).map(([key, val]) => (React.createElement(MenuItem, { key: key, value: key },
37
43
  // @ts-expect-error
38
44
  val.name || '(Unknown name)'))))) : null,
39
- offscreenCanvas ? (React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: rasterizeLayers, onChange: () => setRasterizeLayers(val => !val) }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (React.createElement(Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
45
+ offscreenCanvas ? (React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: rasterizeLayers, onChange: () => {
46
+ setRasterizeLayers(val => !val);
47
+ } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (React.createElement(Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
40
48
  React.createElement(DialogActions, null,
41
- React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel"),
49
+ React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
50
+ handleClose();
51
+ } }, "Cancel"),
42
52
  React.createElement(Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
43
53
  setLoading(true);
44
54
  setError(undefined);
@@ -105,7 +105,9 @@ const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
105
105
  return (React.createElement(Paper, { style: { padding: 12 } },
106
106
  error ? React.createElement(ErrorMessage, { error: error }) : null,
107
107
  React.createElement(Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view in the dotplot. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
108
- React.createElement(RadioGroup, { value: radioOption, onChange: event => setValue(event.target.value) },
108
+ React.createElement(RadioGroup, { value: radioOption, onChange: event => {
109
+ setValue(event.target.value);
110
+ } },
109
111
  React.createElement(Grid, { container: true, justifyContent: "center" },
110
112
  React.createElement(Grid, { item: true },
111
113
  React.createElement(FormControlLabel, { value: ".paf", control: React.createElement(Radio, null), label: ".paf" })),
@@ -129,10 +131,18 @@ const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
129
131
  React.createElement("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)" }, "(more info)")),
130
132
  React.createElement("div", { style: { display: 'flex' } },
131
133
  React.createElement("div", null,
132
- React.createElement(FileSelector, { name: ".anchors file", description: "", location: fileLocation, setLocation: loc => setFileLocation(loc) })),
134
+ React.createElement(FileSelector, { name: ".anchors file", description: "", location: fileLocation, setLocation: loc => {
135
+ setFileLocation(loc);
136
+ } })),
133
137
  React.createElement("div", null,
134
- React.createElement(FileSelector, { name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => setBed1Location(loc) })),
138
+ React.createElement(FileSelector, { name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => {
139
+ setBed1Location(loc);
140
+ } })),
135
141
  React.createElement("div", null,
136
- React.createElement(FileSelector, { name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => setBed2Location(loc) }))))) : (React.createElement(FileSelector, { name: value ? value + ' location' : '', description: "", location: fileLocation, setLocation: loc => setFileLocation(loc) }))))));
142
+ React.createElement(FileSelector, { name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
143
+ setBed2Location(loc);
144
+ } }))))) : (React.createElement(FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
145
+ setFileLocation(loc);
146
+ } }))))));
137
147
  });
138
148
  export default OpenTrack;
@@ -32,6 +32,8 @@ const Selector = observer(({ model, assembly1, assembly2, setShowTrackId, }) =>
32
32
  }, [value, setShowTrackId]);
33
33
  return (React.createElement(Paper, { style: { padding: 12 } },
34
34
  React.createElement(Typography, { paragraph: true }, "Select a track from the select box below, the track will be shown when you hit \"Launch\"."),
35
- filteredTracks.length ? (React.createElement(Select, { value: value, onChange: event => setValue(event.target.value) }, filteredTracks.map(track => (React.createElement(MenuItem, { key: track.trackId, value: track.trackId }, getTrackName(track, session)))))) : (React.createElement(ErrorMessage, { error: `No synteny tracks found for ${assembly1},${assembly2}` }))));
35
+ filteredTracks.length ? (React.createElement(Select, { value: value, onChange: event => {
36
+ setValue(event.target.value);
37
+ } }, filteredTracks.map(track => (React.createElement(MenuItem, { key: track.trackId, value: track.trackId }, getTrackName(track, session)))))) : (React.createElement(ErrorMessage, { error: `No synteny tracks found for ${assembly1},${assembly2}` }))));
36
38
  });
37
39
  export default Selector;
@@ -27,7 +27,9 @@ function TrackSelector({ setSessionTrackData, setShowTrackId, sessionTrackData,
27
27
  return (React.createElement(React.Fragment, null,
28
28
  React.createElement(FormControl, null,
29
29
  React.createElement(FormLabel, { id: "group-label" }, "(Optional) Select or add a synteny track"),
30
- React.createElement(RadioGroup, { row: true, value: choice, onChange: event => setChoice(event.target.value), "aria-labelledby": "group-label" },
30
+ React.createElement(RadioGroup, { row: true, value: choice, onChange: event => {
31
+ setChoice(event.target.value);
32
+ }, "aria-labelledby": "group-label" },
31
33
  React.createElement(FormControlLabel, { value: "none", control: React.createElement(Radio, null), label: "None" }),
32
34
  React.createElement(FormControlLabel, { value: "tracklist", control: React.createElement(Radio, null), label: "Existing track" }),
33
35
  React.createElement(FormControlLabel, { value: "custom", control: React.createElement(Radio, null), label: "New track" }))),
@@ -64,8 +66,12 @@ const LinearSyntenyViewImportForm = observer(function ({ model, }) {
64
66
  displayedRegions: asm.regions,
65
67
  };
66
68
  })));
67
- model.views.forEach(view => view.setWidth(model.width));
68
- model.views.forEach(view => view.showAllRegions());
69
+ model.views.forEach(view => {
70
+ view.setWidth(model.width);
71
+ });
72
+ model.views.forEach(view => {
73
+ view.showAllRegions();
74
+ });
69
75
  if (sessionTrackData) {
70
76
  session.addTrackConf(sessionTrackData);
71
77
  model.toggleTrack(sessionTrackData.trackId);
@@ -89,9 +95,13 @@ const LinearSyntenyViewImportForm = observer(function ({ model, }) {
89
95
  React.createElement("p", { style: { textAlign: 'center' } }, "Select assemblies for linear synteny view"),
90
96
  React.createElement(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center" },
91
97
  React.createElement(Grid, { item: true },
92
- React.createElement(AssemblySelector, { selected: assembly1, onChange: val => setAssembly1(val), session: session })),
98
+ React.createElement(AssemblySelector, { selected: assembly1, onChange: val => {
99
+ setAssembly1(val);
100
+ }, session: session })),
93
101
  React.createElement(Grid, { item: true },
94
- React.createElement(AssemblySelector, { selected: assembly2, onChange: val => setAssembly2(val), session: session })),
102
+ React.createElement(AssemblySelector, { selected: assembly2, onChange: val => {
103
+ setAssembly2(val);
104
+ }, session: session })),
95
105
  React.createElement(Grid, { item: true },
96
106
  React.createElement(FormControl, null,
97
107
  React.createElement(Button, { onClick: onOpenClick, variant: "contained", color: "primary" }, "Launch"))))),
@@ -54,8 +54,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
54
54
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
55
55
  trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
56
56
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
57
- highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>>>, [undefined]>;
57
+ highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
58
58
  colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
59
+ showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
59
60
  }, {
60
61
  width: number;
61
62
  } & {
@@ -69,7 +70,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
69
70
  minimumBlockWidth: number;
70
71
  draggingTrackId: undefined | string;
71
72
  volatileError: unknown;
72
- afterDisplayedRegionsSetCallbacks: Function[];
73
+ afterDisplayedRegionsSetCallbacks: (() => void)[];
73
74
  scaleFactor: number;
74
75
  trackRefs: Record<string, HTMLDivElement>;
75
76
  coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
@@ -77,12 +78,12 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
77
78
  leftOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset;
78
79
  rightOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset;
79
80
  } & {
80
- scaleBarDisplayPrefix(): "";
81
81
  readonly trackLabelsSetting: any;
82
82
  readonly width: number;
83
83
  readonly interRegionPaddingWidth: number;
84
84
  readonly assemblyNames: string[];
85
85
  } & {
86
+ scaleBarDisplayPrefix(): string | undefined;
86
87
  MiniControlsComponent(): React.FC<any>;
87
88
  HeaderComponent(): React.FC<any>;
88
89
  readonly assemblyErrors: string;
@@ -97,7 +98,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
97
98
  readonly totalBp: number;
98
99
  readonly maxBpPerPx: number;
99
100
  readonly minBpPerPx: number;
100
- readonly error: {};
101
+ readonly error: unknown;
101
102
  readonly maxOffset: number;
102
103
  readonly minOffset: number;
103
104
  readonly displayedRegionsTotalPx: number;
@@ -112,6 +113,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
112
113
  rewriteOnClicks(trackType: string, viewMenuActions: import("@jbrowse/core/ui").MenuItem[]): void;
113
114
  readonly trackTypeActions: Map<string, import("@jbrowse/core/ui").MenuItem[]>;
114
115
  } & {
116
+ setShowTrackOutlines(arg: boolean): void;
115
117
  setColorByCDS(flag: boolean): void;
116
118
  setShowCytobands(flag: boolean): void;
117
119
  setWidth(newWidth: number): void;
@@ -120,9 +122,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
120
122
  setHideHeaderOverview(b: boolean): void;
121
123
  setHideNoTracksActive(b: boolean): void;
122
124
  setShowGridlines(b: boolean): void;
123
- addToHighlights(highlight: Required<import("@jbrowse/core/util").ParsedLocString>): void;
124
- setHighlight(highlight: Required<import("@jbrowse/core/util").ParsedLocString>[] | undefined): void;
125
- removeHighlight(highlight: Required<import("@jbrowse/core/util").ParsedLocString>): void;
125
+ addToHighlights(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
126
+ setHighlight(highlight?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType[]): void;
127
+ removeHighlight(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
126
128
  scrollTo(offsetPx: number): number;
127
129
  zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
128
130
  setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): void;
@@ -137,7 +139,6 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
137
139
  moveTrackToTop(id: string): void;
138
140
  moveTrackToBottom(id: string): void;
139
141
  moveTrack(movingId: string, targetId: string): void;
140
- closeView(): void;
141
142
  toggleTrack(trackId: string): boolean;
142
143
  setTrackLabels(setting: "overlapping" | "offset" | "hidden"): void;
143
144
  setShowCenterLine(b: boolean): void;
@@ -157,7 +158,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
157
158
  variant?: string;
158
159
  isLeftEndOfDisplayedRegion?: boolean;
159
160
  }[];
160
- afterDisplayedRegionsSet(cb: Function): void;
161
+ afterDisplayedRegionsSet(cb: () => void): void;
161
162
  horizontalScroll(distance: number): number;
162
163
  center(): void;
163
164
  showAllRegions(): void;
@@ -231,8 +232,6 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
231
232
  } | undefined;
232
233
  } & {
233
234
  afterCreate(): void;
234
- } & {
235
- scaleBarDisplayPrefix(): string;
236
235
  }, import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
237
236
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
238
237
  displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -252,8 +251,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
252
251
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
253
252
  trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
254
253
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
255
- highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>>>, [undefined]>;
254
+ highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
256
255
  colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
256
+ showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
257
257
  }>>, import("mobx-state-tree")._NotCustomized>>;
258
258
  viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
259
259
  } & {
@@ -281,7 +281,6 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
281
281
  setWidth(newWidth: number): void;
282
282
  setViews(views: import("mobx-state-tree").SnapshotIn<import("@jbrowse/plugin-linear-genome-view").LinearGenomeViewModel>[]): void;
283
283
  removeView(view: import("@jbrowse/plugin-linear-genome-view").LinearGenomeViewModel): void;
284
- closeView(): void;
285
284
  setMiddleComparativeHeight(n: number): number;
286
285
  activateTrackSelector(): import("@jbrowse/core/util").Widget | undefined;
287
286
  toggleTrack(trackId: string): boolean;
@@ -51,7 +51,9 @@ export default function stateModelFactory(pluginManager) {
51
51
  */
52
52
  showAllRegions() {
53
53
  transaction(() => {
54
- self.views.forEach(view => view.showAllRegionsInAssembly());
54
+ self.views.forEach(view => {
55
+ view.showAllRegionsInAssembly();
56
+ });
55
57
  });
56
58
  },
57
59
  }))
@@ -19,7 +19,6 @@ export async function renderToSvg(model, opts) {
19
19
  const { width, views, middleComparativeHeight: synH, tracks } = model;
20
20
  const shift = 50;
21
21
  const offset = headerHeight + rulerHeight;
22
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
22
  const { createRootFn } = getRoot(model);
24
23
  const heights = views.map(v => totalHeight(v.tracks, textHeight, trackLabels) + offset);
25
24
  const totalHeightSvg = sum(heights) + synH + 100;
@@ -37,11 +36,14 @@ export async function renderToSvg(model, opts) {
37
36
  const renderings = await Promise.all(tracks.map(async (track) => {
38
37
  const d = track.displays[0];
39
38
  await when(() => (d.ready !== undefined ? d.ready : true));
40
- const r = await renderToAbstractCanvas(width, synH, { exportSVG: opts }, ctx => drawRef(d, ctx));
39
+ const r = await renderToAbstractCanvas(width, synH, { exportSVG: opts }, ctx => {
40
+ drawRef(d, ctx);
41
+ return undefined;
42
+ });
41
43
  if ('imageData' in r) {
42
44
  throw new Error('found a canvas in svg export, probably a bug');
43
45
  }
44
- else if ('canvasRecordedData' in r) {
46
+ if ('canvasRecordedData' in r) {
45
47
  return {
46
48
  html: await getSerializedSvg({
47
49
  ...r,
@@ -50,9 +52,7 @@ export async function renderToSvg(model, opts) {
50
52
  }),
51
53
  };
52
54
  }
53
- else {
54
- return r;
55
- }
55
+ return r;
56
56
  }));
57
57
  const trackLabelMaxLen = max(views.flatMap(view => view.tracks.map(t => measureText(getTrackName(t.configuration, session), fontSize))), 0) + 40;
58
58
  const trackLabelOffset = trackLabels === 'left' ? trackLabelMaxLen : 0;
@@ -71,7 +71,9 @@ export async function renderToSvg(model, opts) {
71
71
  React.createElement("defs", null,
72
72
  React.createElement("clipPath", { id: 'synclip' },
73
73
  React.createElement("rect", { x: 0, y: 0, width: width, height: synH }))),
74
- React.createElement("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize + heights[0]})`, clipPath: `url(#synclip)` }, renderings.map((r, i) => (React.createElement(ReactRendering, { key: i, rendering: r })))),
74
+ React.createElement("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize + heights[0]})`, clipPath: 'url(#synclip)' }, renderings.map((r, i) => (
75
+ /* biome-ignore lint/suspicious/noArrayIndexKey: */
76
+ React.createElement(ReactRendering, { key: i, rendering: r })))),
75
77
  React.createElement("g", { transform: `translate(${shift} ${fontSize + heights[0] + synH})` },
76
78
  React.createElement("g", { transform: `translate(${trackLabelOffset})` },
77
79
  React.createElement("text", { x: 0, fontSize: fontSize, ...getFillProps(theme.palette.text.primary) }, views[1].assemblyNames.join(', ')),
@@ -16,7 +16,9 @@ function Formatter({ value }) {
16
16
  setCopied(false);
17
17
  }, 700);
18
18
  } }, copied ? 'Copied to clipboard' : 'Copy'),
19
- React.createElement("button", { type: "button", onClick: () => setShow(val => !val) }, show ? 'Show less' : 'Show more'),
19
+ React.createElement("button", { type: "button", onClick: () => {
20
+ setShow(val => !val);
21
+ } }, show ? 'Show less' : 'Show more'),
20
22
  React.createElement("div", null, show ? display : `${display.slice(0, 100)}...`)));
21
23
  }
22
24
  return React.createElement("div", null, display);
package/esm/util.js CHANGED
@@ -8,10 +8,11 @@ function heightFromSpecificLevel(views, trackConfigId, level) {
8
8
  .slice(0, level)
9
9
  .map(v => v.height + 7)
10
10
  .reduce((a, b) => a + b, 0);
11
+ const v = views[level];
11
12
  return (heightUpUntilThisPoint +
12
- views[level].headerHeight +
13
- views[level].scaleBarHeight +
14
- getTrackPos(views[level], trackConfigId) +
13
+ v.headerHeight +
14
+ v.scaleBarHeight +
15
+ getTrackPos(v, trackConfigId) +
15
16
  1);
16
17
  }
17
18
  export function getTrackPos(view, trackConfigId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-comparative-view",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "JBrowse 2 linear comparative view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "scripts": {
26
26
  "build": "npm-run-all build:*",
27
- "test": "cd ../..; jest plugins/linear-comparative-view",
27
+ "test": "cd ../..; jest --passWithNoTests plugins/linear-comparative-view",
28
28
  "prepublishOnly": "yarn test",
29
29
  "prepack": "yarn build && yarn useDist",
30
30
  "postpack": "yarn useSrc",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "efe02fb9616e20e929cceeed46eb96420c1b6923"
64
+ "gitHead": "9fb8231d932db40adf0a283081765431756c66ff"
65
65
  }