@jbrowse/plugin-linear-comparative-view 2.15.4 → 2.16.1

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 (121) hide show
  1. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +2 -1
  2. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +4 -2
  3. package/dist/LGVSyntenyDisplay/components/util.d.ts +4 -1
  4. package/dist/LGVSyntenyDisplay/components/util.js +7 -15
  5. package/dist/LGVSyntenyDisplay/model.d.ts +26 -14
  6. package/dist/LGVSyntenyDisplay/model.js +23 -1
  7. package/dist/LaunchLinearSyntenyView.js +41 -11
  8. package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +42 -14
  9. package/dist/LinearComparativeDisplay/stateModelFactory.js +20 -10
  10. package/dist/LinearComparativeView/components/Header.d.ts +2 -3
  11. package/dist/LinearComparativeView/components/Header.js +72 -62
  12. package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +6 -0
  13. package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +34 -0
  14. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +6 -0
  15. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +61 -0
  16. package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +2 -4
  17. package/dist/LinearComparativeView/components/LinearComparativeView.js +3 -67
  18. package/dist/LinearComparativeView/components/Rubberband.js +1 -1
  19. package/dist/LinearComparativeView/index.js +3 -0
  20. package/dist/LinearComparativeView/model.d.ts +265 -12
  21. package/dist/LinearComparativeView/model.js +45 -75
  22. package/dist/LinearSyntenyDisplay/afterAttach.js +5 -4
  23. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +47 -32
  24. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +10 -6
  25. package/dist/LinearSyntenyDisplay/components/util.d.ts +7 -2
  26. package/dist/LinearSyntenyDisplay/components/util.js +12 -14
  27. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  28. package/dist/LinearSyntenyDisplay/drawSynteny.js +29 -25
  29. package/dist/LinearSyntenyDisplay/index.js +1 -1
  30. package/dist/LinearSyntenyDisplay/model.d.ts +48 -10
  31. package/dist/LinearSyntenyDisplay/model.js +38 -15
  32. package/dist/LinearSyntenyView/components/ImportForm/{ImportCustomTrack.d.ts → AddCustomTrack.d.ts} +2 -3
  33. package/dist/LinearSyntenyView/components/ImportForm/{ImportCustomTrack.js → AddCustomTrack.js} +3 -3
  34. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +195 -0
  35. package/dist/LinearSyntenyView/components/ImportForm/Spacer.d.ts +2 -0
  36. package/dist/LinearSyntenyView/components/ImportForm/Spacer.js +10 -0
  37. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +10 -0
  38. package/dist/LinearSyntenyView/components/ImportForm/{ImportSyntenyTrackSelector.js → TrackSelector.js} +15 -20
  39. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +14 -0
  40. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +52 -0
  41. package/dist/LinearSyntenyView/components/LinearSyntenyView.js +3 -3
  42. package/dist/LinearSyntenyView/index.js +1 -1
  43. package/dist/LinearSyntenyView/model.d.ts +267 -9
  44. package/dist/LinearSyntenyView/model.js +2 -2
  45. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +12 -0
  46. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +19 -0
  47. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -3
  48. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +36 -27
  49. package/dist/LinearSyntenyViewHelper/index.d.ts +2 -0
  50. package/dist/LinearSyntenyViewHelper/index.js +25 -0
  51. package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +30 -0
  52. package/dist/LinearSyntenyViewHelper/stateModelFactory.js +105 -0
  53. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +14 -0
  54. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +100 -0
  55. package/dist/SyntenyFeatureDetail/index.d.ts +2 -0
  56. package/dist/SyntenyFeatureDetail/index.js +56 -0
  57. package/dist/index.js +4 -0
  58. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +2 -1
  59. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +4 -2
  60. package/esm/LGVSyntenyDisplay/components/util.d.ts +4 -1
  61. package/esm/LGVSyntenyDisplay/components/util.js +8 -16
  62. package/esm/LGVSyntenyDisplay/model.d.ts +26 -14
  63. package/esm/LGVSyntenyDisplay/model.js +25 -3
  64. package/esm/LaunchLinearSyntenyView.js +41 -11
  65. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +42 -14
  66. package/esm/LinearComparativeDisplay/stateModelFactory.js +21 -11
  67. package/esm/LinearComparativeView/components/Header.d.ts +2 -3
  68. package/esm/LinearComparativeView/components/Header.js +73 -63
  69. package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +6 -0
  70. package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +29 -0
  71. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +6 -0
  72. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +56 -0
  73. package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +2 -4
  74. package/esm/LinearComparativeView/components/LinearComparativeView.js +3 -67
  75. package/esm/LinearComparativeView/components/Rubberband.js +1 -1
  76. package/esm/LinearComparativeView/index.js +3 -0
  77. package/esm/LinearComparativeView/model.d.ts +265 -12
  78. package/esm/LinearComparativeView/model.js +47 -77
  79. package/esm/LinearSyntenyDisplay/afterAttach.js +5 -4
  80. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +48 -33
  81. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +10 -6
  82. package/esm/LinearSyntenyDisplay/components/util.d.ts +7 -2
  83. package/esm/LinearSyntenyDisplay/components/util.js +12 -14
  84. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  85. package/esm/LinearSyntenyDisplay/drawSynteny.js +29 -25
  86. package/esm/LinearSyntenyDisplay/index.js +1 -1
  87. package/esm/LinearSyntenyDisplay/model.d.ts +48 -10
  88. package/esm/LinearSyntenyDisplay/model.js +38 -15
  89. package/esm/LinearSyntenyView/components/ImportForm/{ImportCustomTrack.d.ts → AddCustomTrack.d.ts} +2 -3
  90. package/esm/LinearSyntenyView/components/ImportForm/{ImportCustomTrack.js → AddCustomTrack.js} +3 -3
  91. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +167 -0
  92. package/esm/LinearSyntenyView/components/ImportForm/Spacer.d.ts +2 -0
  93. package/esm/LinearSyntenyView/components/ImportForm/Spacer.js +4 -0
  94. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +10 -0
  95. package/esm/LinearSyntenyView/components/ImportForm/{ImportSyntenyTrackSelector.js → TrackSelector.js} +15 -20
  96. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +14 -0
  97. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +23 -0
  98. package/esm/LinearSyntenyView/components/LinearSyntenyView.js +3 -3
  99. package/esm/LinearSyntenyView/index.js +1 -1
  100. package/esm/LinearSyntenyView/model.d.ts +267 -9
  101. package/esm/LinearSyntenyView/model.js +2 -2
  102. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +12 -0
  103. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +13 -0
  104. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -3
  105. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +38 -29
  106. package/esm/LinearSyntenyViewHelper/index.d.ts +2 -0
  107. package/esm/LinearSyntenyViewHelper/index.js +19 -0
  108. package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +30 -0
  109. package/esm/LinearSyntenyViewHelper/stateModelFactory.js +102 -0
  110. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +14 -0
  111. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +72 -0
  112. package/esm/SyntenyFeatureDetail/index.d.ts +2 -0
  113. package/esm/SyntenyFeatureDetail/index.js +27 -0
  114. package/esm/index.js +4 -0
  115. package/package.json +3 -3
  116. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +0 -9
  117. package/dist/LinearSyntenyView/components/ImportForm/index.js +0 -138
  118. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +0 -9
  119. package/esm/LinearSyntenyView/components/ImportForm/index.js +0 -110
  120. /package/dist/LinearSyntenyView/components/ImportForm/{index.d.ts → LinearSyntenyImportForm.d.ts} +0 -0
  121. /package/esm/LinearSyntenyView/components/ImportForm/{index.d.ts → LinearSyntenyImportForm.d.ts} +0 -0
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Feature } from '@jbrowse/core/util';
3
- export default function LaunchSyntenyViewDialog({ model, feature, handleClose, }: {
3
+ export default function LaunchSyntenyViewDialog({ model, feature, trackId, handleClose, }: {
4
4
  model: unknown;
5
5
  feature: Feature;
6
+ trackId: string;
6
7
  handleClose: () => void;
7
8
  }): React.JSX.Element;
@@ -28,15 +28,16 @@ const react_1 = __importStar(require("react"));
28
28
  const ui_1 = require("@jbrowse/core/ui");
29
29
  const util_1 = require("@jbrowse/core/util");
30
30
  const material_1 = require("@mui/material");
31
- const util_2 = require("./util");
32
31
  const mui_1 = require("tss-react/mui");
32
+ // locals
33
+ const util_2 = require("./util");
33
34
  const useStyles = (0, mui_1.makeStyles)()({
34
35
  padding: {
35
36
  margin: 10,
36
37
  border: '1px solid #ccc',
37
38
  },
38
39
  });
39
- function LaunchSyntenyViewDialog({ model, feature, handleClose, }) {
40
+ function LaunchSyntenyViewDialog({ model, feature, trackId, handleClose, }) {
40
41
  const { classes } = useStyles();
41
42
  const inverted = feature.get('strand') === -1;
42
43
  const [horizontallyFlip, setHorizontallyFlip] = (0, react_1.useState)(inverted);
@@ -59,6 +60,7 @@ function LaunchSyntenyViewDialog({ model, feature, handleClose, }) {
59
60
  feature,
60
61
  windowSize: +windowSize,
61
62
  horizontallyFlip,
63
+ trackId,
62
64
  model,
63
65
  });
64
66
  }
@@ -1,8 +1,11 @@
1
1
  import { Feature } from '@jbrowse/core/util';
2
2
  import { IAnyStateTreeNode } from 'mobx-state-tree';
3
- export declare function navToSynteny({ feature, windowSize: ws, model, horizontallyFlip, }: {
3
+ import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
4
+ export declare function navToSynteny({ feature, windowSize: ws, model, trackId, view, horizontallyFlip, }: {
4
5
  windowSize: number;
6
+ trackId: string;
5
7
  horizontallyFlip: boolean;
6
8
  feature: Feature;
9
+ view?: LinearGenomeViewModel;
7
10
  model: IAnyStateTreeNode;
8
11
  }): Promise<void>;
@@ -30,18 +30,13 @@ function findPosInCigar(cigar, startX) {
30
30
  }
31
31
  return [featX, mateX];
32
32
  }
33
- async function navToSynteny({ feature, windowSize: ws, model, horizontallyFlip, }) {
33
+ async function navToSynteny({ feature, windowSize: ws, model, trackId, view, horizontallyFlip, }) {
34
34
  const session = (0, util_1.getSession)(model);
35
- const track = (0, util_1.getContainingTrack)(model);
36
- const view = (0, util_1.getContainingView)(model);
37
- const reg = view.dynamicBlocks.contentBlocks[0];
38
- if (!reg) {
39
- throw new Error('no visible region');
40
- }
35
+ const reg = view === null || view === void 0 ? void 0 : view.dynamicBlocks.contentBlocks[0];
41
36
  const cigar = feature.get('CIGAR');
42
37
  const strand = feature.get('strand');
43
- const regStart = reg.start;
44
- const regEnd = reg.end;
38
+ const featRef = feature.get('refName');
39
+ const featAsm = feature.get('assemblyName');
45
40
  const featStart = feature.get('start');
46
41
  const featEnd = feature.get('end');
47
42
  const mate = feature.get('mate');
@@ -49,13 +44,13 @@ async function navToSynteny({ feature, windowSize: ws, model, horizontallyFlip,
49
44
  const mateEnd = mate.end;
50
45
  const mateAsm = mate.assemblyName;
51
46
  const mateRef = mate.refName;
52
- const featAsm = reg.assemblyName;
53
- const featRef = reg.refName;
54
47
  let rMateStart;
55
48
  let rMateEnd;
56
49
  let rFeatStart;
57
50
  let rFeatEnd;
58
- if (cigar) {
51
+ if (reg && cigar) {
52
+ const regStart = reg.start;
53
+ const regEnd = reg.end;
59
54
  const p = parseCigar(cigar);
60
55
  const [fStartX, mStartX] = findPosInCigar(p, regStart - featStart);
61
56
  const [fEndX, mEndX] = findPosInCigar(p, regEnd - featStart);
@@ -72,17 +67,14 @@ async function navToSynteny({ feature, windowSize: ws, model, horizontallyFlip,
72
67
  rMateStart = mateStart;
73
68
  rMateEnd = mateEnd;
74
69
  }
75
- const trackId = track.configuration.trackId;
76
70
  const view2 = session.addView('LinearSyntenyView', {
77
71
  type: 'LinearSyntenyView',
78
72
  views: [
79
73
  {
80
- id: `${Math.random()}`,
81
74
  type: 'LinearGenomeView',
82
75
  hideHeader: true,
83
76
  },
84
77
  {
85
- id: `${Math.random()}`,
86
78
  type: 'LinearGenomeView',
87
79
  hideHeader: true,
88
80
  },
@@ -1,4 +1,5 @@
1
1
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
2
+ import { Feature } from '@jbrowse/core/util';
2
3
  /**
3
4
  * #stateModel LGVSyntenyDisplay
4
5
  * displays location of "synteny" feature in a plain LGV, allowing linking out
@@ -10,7 +11,14 @@ import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
10
11
  declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
11
12
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
12
13
  type: import("mobx-state-tree").ISimpleType<string>;
13
- rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
14
+ rpcDriverName: import("mobx-state-tree" /**
15
+ * #stateModel LGVSyntenyDisplay
16
+ * displays location of "synteny" feature in a plain LGV, allowing linking out
17
+ * to external synteny views
18
+ *
19
+ * extends
20
+ * - [SharedLinearPileupDisplayMixin](../sharedlinearpileupdisplaymixin)
21
+ */).IMaybe<import("mobx-state-tree").ISimpleType<string>>;
14
22
  } & {
15
23
  heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
16
24
  } & {
@@ -38,7 +46,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
38
46
  renderInProgress: AbortController | undefined;
39
47
  filled: boolean;
40
48
  reactElement: React.ReactElement | undefined;
41
- features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
49
+ features: Map<string, Feature> | undefined;
42
50
  layout: any;
43
51
  status: string;
44
52
  error: unknown;
@@ -63,7 +71,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
63
71
  setMessage(messageText: string): void;
64
72
  setRendered(props: {
65
73
  reactElement: React.ReactElement;
66
- features: Map<string, import("@jbrowse/core/util").Feature>;
74
+ features: Map<string, Feature>;
67
75
  layout: any;
68
76
  maxHeightReached: boolean;
69
77
  renderProps: any;
@@ -223,7 +231,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
223
231
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
224
232
  } & {
225
233
  featureIdUnderMouse: undefined | string;
226
- contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
234
+ contextMenuFeature: undefined | Feature;
227
235
  } & {
228
236
  readonly DisplayMessageComponent: import("react").FC<any> | undefined;
229
237
  readonly blockType: "dynamicBlocks" | "staticBlocks";
@@ -233,19 +241,19 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
233
241
  readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
234
242
  readonly selectedFeatureId: string | undefined;
235
243
  } & {
236
- readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
237
- readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
244
+ readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
245
+ readonly featureUnderMouse: Feature | undefined;
238
246
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
239
247
  getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
240
248
  searchFeatureByID(id: string): [number, number, number, number] | undefined;
241
249
  } & {
242
250
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
243
251
  deleteBlock(key: string): void;
244
- selectFeature(feature: import("@jbrowse/core/util").Feature): void;
245
- navToFeature(feature: import("@jbrowse/core/util").Feature): void;
252
+ selectFeature(feature: Feature): void;
253
+ navToFeature(feature: Feature): void;
246
254
  clearFeatureSelection(): void;
247
255
  setFeatureIdUnderMouse(feature?: string): void;
248
- setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature): void;
256
+ setContextMenuFeature(feature?: Feature): void;
249
257
  } & {
250
258
  reload(): Promise<void>;
251
259
  } & {
@@ -257,7 +265,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
257
265
  afterAttach(): void;
258
266
  } & {
259
267
  colorTagMap: import("mobx").ObservableMap<string, string>;
260
- featureUnderMouseVolatile: undefined | import("@jbrowse/core/util").Feature;
268
+ featureUnderMouseVolatile: undefined | Feature;
261
269
  tagsReady: boolean;
262
270
  } & {
263
271
  readonly autorunReady: boolean;
@@ -272,9 +280,9 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
272
280
  extra?: import("@jbrowse/plugin-alignments/src/shared/color").ExtraColorBy;
273
281
  }): void;
274
282
  updateColorTagMap(uniqueTag: string[]): void;
275
- setFeatureUnderMouse(feat?: import("@jbrowse/core/util").Feature): void;
276
- selectFeature(feature: import("@jbrowse/core/util").Feature): void;
277
- copyFeatureToClipboard(feature: import("@jbrowse/core/util").Feature): void;
283
+ setFeatureUnderMouse(feat?: Feature): void;
284
+ selectFeature(feature: Feature): void;
285
+ copyFeatureToClipboard(feature: Feature): void;
278
286
  setConfig(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
279
287
  setFilterBy(filter: import("@jbrowse/plugin-alignments/src/shared").IFilter): void;
280
288
  setJexlFilters(filters: string[]): void;
@@ -293,7 +301,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
293
301
  } & {
294
302
  readonly maxHeight: any;
295
303
  readonly featureHeightSetting: any;
296
- readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
304
+ readonly featureUnderMouse: Feature | undefined;
297
305
  renderReady(): boolean;
298
306
  readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
299
307
  } & {
@@ -352,6 +360,10 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
352
360
  }[];
353
361
  })[];
354
362
  } & {
363
+ /**
364
+ * #action
365
+ */
366
+ selectFeature(feature: Feature): void;
355
367
  afterCreate(): void;
356
368
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
357
369
  export default stateModelFactory;
@@ -62,12 +62,13 @@ function stateModelFactory(schema) {
62
62
  ...(feature
63
63
  ? [
64
64
  {
65
- label: 'Open synteny view for this position',
65
+ label: 'Launch synteny view for this position',
66
66
  onClick: () => {
67
67
  (0, util_1.getSession)(self).queueDialog(handleClose => [
68
68
  LaunchSyntenyViewDialog,
69
69
  {
70
70
  model: self,
71
+ trackId: (0, configuration_1.getConf)((0, util_1.getContainingTrack)(self), 'trackId'),
71
72
  handleClose,
72
73
  feature,
73
74
  },
@@ -98,6 +99,27 @@ function stateModelFactory(schema) {
98
99
  };
99
100
  })
100
101
  .actions(self => ({
102
+ /**
103
+ * #action
104
+ */
105
+ selectFeature(feature) {
106
+ const session = (0, util_1.getSession)(self);
107
+ if ((0, util_1.isSessionModelWithWidgets)(session)) {
108
+ const r2 = (0, util_1.getContainingView)(self);
109
+ let r3 = r2;
110
+ try {
111
+ r3 = (0, util_1.getContainingView)(r3);
112
+ }
113
+ catch (e) { }
114
+ const featureWidget = session.addWidget('SyntenyFeatureWidget', 'syntenyFeature', {
115
+ featureData: feature.toJSON(),
116
+ view: r3,
117
+ track: (0, util_1.getContainingTrack)(self),
118
+ });
119
+ session.showWidget(featureWidget);
120
+ }
121
+ session.setSelection(feature);
122
+ },
101
123
  afterCreate() {
102
124
  // use color by stand to help indicate inversions better on first load,
103
125
  // otherwise use selected orientation
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = LaunchLinearSyntenyView;
4
+ const util_1 = require("@jbrowse/core/util");
4
5
  const mobx_1 = require("mobx");
6
+ function makeMultiDimArray(str) {
7
+ return Array.isArray(str[0]) ? str : [str];
8
+ }
5
9
  function LaunchLinearSyntenyView(pluginManager) {
6
10
  pluginManager.addToExtensionPoint('LaunchView-LinearSyntenyView',
7
11
  // @ts-expect-error
@@ -24,7 +28,7 @@ function LaunchLinearSyntenyView(pluginManager) {
24
28
  };
25
29
  })));
26
30
  await Promise.all(model.views.map(view => (0, mobx_1.when)(() => view.initialized)));
27
- const idsNotFound = [];
31
+ let idsNotFound = [];
28
32
  await Promise.all(views.map(async (data, idx) => {
29
33
  const view = model.views[idx];
30
34
  const { assembly, loc, tracks = [] } = data;
@@ -33,14 +37,23 @@ function LaunchLinearSyntenyView(pluginManager) {
33
37
  throw new Error(`Assembly ${data.assembly} failed to load`);
34
38
  }
35
39
  await view.navToSearchString({ input: loc, assembly: asm });
36
- tracks.forEach(track => {
37
- tryTrack(view, track, idsNotFound);
38
- });
40
+ idsNotFound = [
41
+ ...idsNotFound,
42
+ ...tracks.map(trackId => tryTrackLGV({
43
+ model: view,
44
+ trackId,
45
+ })),
46
+ ];
39
47
  }));
40
- tracks.forEach(track => {
41
- tryTrack(model, track, idsNotFound);
42
- });
43
- if (idsNotFound.length) {
48
+ idsNotFound = [
49
+ ...idsNotFound,
50
+ ...makeMultiDimArray(tracks).flatMap((trackSet, level) => trackSet.map(trackId => tryTrackSynteny({
51
+ model,
52
+ trackId,
53
+ level,
54
+ }))),
55
+ ];
56
+ if (idsNotFound.filter(util_1.notEmpty).length) {
44
57
  throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
45
58
  }
46
59
  }
@@ -50,16 +63,33 @@ function LaunchLinearSyntenyView(pluginManager) {
50
63
  }
51
64
  });
52
65
  }
53
- function tryTrack(model, trackId, idsNotFound) {
66
+ function tryTrackLGV({ model, trackId, }) {
54
67
  try {
55
68
  model.showTrack(trackId);
56
69
  }
57
70
  catch (e) {
58
- if (/Could not resolve identifier/.exec(`${e}`)) {
59
- idsNotFound.push(trackId);
71
+ if (/Could not resolve identifier/.exec(`${e}`) ||
72
+ /track not found/.exec(`${e}`)) {
73
+ return trackId;
74
+ }
75
+ else {
76
+ throw e;
77
+ }
78
+ }
79
+ return undefined;
80
+ }
81
+ function tryTrackSynteny({ model, trackId, level, }) {
82
+ try {
83
+ model.showTrack(trackId, level);
84
+ }
85
+ catch (e) {
86
+ if (/Could not resolve identifier/.exec(`${e}`) ||
87
+ /track not found/.exec(`${e}`)) {
88
+ return trackId;
60
89
  }
61
90
  else {
62
91
  throw e;
63
92
  }
64
93
  }
94
+ return undefined;
65
95
  }
@@ -11,9 +11,14 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
11
11
  type: import("mobx-state-tree").ISimpleType<string>;
12
12
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
13
13
  } & {
14
+ /**
15
+ * #property
16
+ */
14
17
  type: import("mobx-state-tree").ISimpleType<"LinearComparativeDisplay">;
18
+ /**
19
+ * #property
20
+ */
15
21
  configuration: AnyConfigurationSchemaType;
16
- height: import("mobx-state-tree").IType<number | undefined, number, number>;
17
22
  }, {
18
23
  rendererTypeName: string;
19
24
  error: unknown;
@@ -24,9 +29,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
24
29
  id: string;
25
30
  type: string;
26
31
  rpcDriverName: string | undefined;
27
- } & import("mobx-state-tree/dist/internal" /**
28
- * #property
29
- */).NonEmptyObject & {
32
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
30
33
  rendererTypeName: string;
31
34
  error: unknown;
32
35
  message: string | undefined;
@@ -40,7 +43,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
40
43
  message: string | undefined;
41
44
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
42
45
  onHorizontalScroll?: () => void;
43
- blockState?: Record<string, any>;
46
+ blockState? /**
47
+ * #action
48
+ * controlled by a reaction
49
+ */: Record<string, any>;
44
50
  }>;
45
51
  readonly DisplayBlurb: React.FC<{
46
52
  model: {
@@ -52,7 +58,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
52
58
  error: unknown;
53
59
  message: string | undefined;
54
60
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
55
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
61
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree" /**
62
+ * #action
63
+ * controlled by a reaction
64
+ */).ISimpleType<string>, [undefined]>;
56
65
  type: import("mobx-state-tree").ISimpleType<string>;
57
66
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
58
67
  }, {
@@ -79,6 +88,14 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
79
88
  features: Feature[] | undefined;
80
89
  message: string | undefined;
81
90
  } & {
91
+ /**
92
+ * #getter
93
+ */
94
+ readonly level: number;
95
+ /**
96
+ * #getter
97
+ */
98
+ readonly height: number;
82
99
  /**
83
100
  * #getter
84
101
  */
@@ -99,7 +116,6 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
99
116
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>);
100
117
  } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>);
101
118
  } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
102
- height: number;
103
119
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
104
120
  rendererTypeName: string;
105
121
  error: unknown;
@@ -110,9 +126,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
110
126
  id: string;
111
127
  type: string;
112
128
  rpcDriverName: string | undefined;
113
- } & import("mobx-state-tree/dist/internal" /**
114
- * #property
115
- */).NonEmptyObject & {
129
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
116
130
  rendererTypeName: string;
117
131
  error: unknown;
118
132
  message: string | undefined;
@@ -126,7 +140,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
126
140
  message: string | undefined;
127
141
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
128
142
  onHorizontalScroll?: () => void;
129
- blockState?: Record<string, any>;
143
+ blockState? /**
144
+ * #action
145
+ * controlled by a reaction
146
+ */: Record<string, any>;
130
147
  }>;
131
148
  readonly DisplayBlurb: React.FC<{
132
149
  model: {
@@ -138,7 +155,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
138
155
  error: unknown;
139
156
  message: string | undefined;
140
157
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
141
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
158
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree" /**
159
+ * #action
160
+ * controlled by a reaction
161
+ */).ISimpleType<string>, [undefined]>;
142
162
  type: import("mobx-state-tree").ISimpleType<string>;
143
163
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
144
164
  }, {
@@ -169,9 +189,14 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
169
189
  type: import("mobx-state-tree").ISimpleType<string>;
170
190
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
171
191
  } & {
192
+ /**
193
+ * #property
194
+ */
172
195
  type: import("mobx-state-tree").ISimpleType<"LinearComparativeDisplay">;
196
+ /**
197
+ * #property
198
+ */
173
199
  configuration: AnyConfigurationSchemaType;
174
- height: import("mobx-state-tree").IType<number | undefined, number, number>;
175
200
  }, {
176
201
  rendererTypeName: string;
177
202
  error: unknown;
@@ -196,7 +221,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
196
221
  message: string | undefined;
197
222
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
198
223
  onHorizontalScroll?: () => void;
199
- blockState?: Record<string, any>;
224
+ blockState? /**
225
+ * #action
226
+ * controlled by a reaction
227
+ */: Record<string, any>;
200
228
  }>;
201
229
  readonly DisplayBlurb: React.FC<{
202
230
  model: {
@@ -21,10 +21,6 @@ function stateModelFactory(configSchema) {
21
21
  * #property
22
22
  */
23
23
  configuration: (0, configuration_1.ConfigurationReference)(configSchema),
24
- /**
25
- * #property
26
- */
27
- height: 100,
28
24
  }))
29
25
  .volatile(( /* self */) => ({
30
26
  renderInProgress: undefined,
@@ -32,6 +28,18 @@ function stateModelFactory(configSchema) {
32
28
  message: undefined,
33
29
  }))
34
30
  .views(self => ({
31
+ /**
32
+ * #getter
33
+ */
34
+ get level() {
35
+ return (0, mobx_state_tree_1.getParent)(self, 4).level;
36
+ },
37
+ /**
38
+ * #getter
39
+ */
40
+ get height() {
41
+ return (0, mobx_state_tree_1.getParent)(self, 4).height;
42
+ },
35
43
  /**
36
44
  * #getter
37
45
  */
@@ -133,10 +141,11 @@ function stateModelFactory(configSchema) {
133
141
  function renderBlockData(self) {
134
142
  const { rpcManager } = (0, util_1.getSession)(self);
135
143
  const display = self;
136
- // Alternative to readConfObject(config) is below used because renderProps is
137
- // something under our control. Compare to serverSideRenderedBlock
144
+ // Alternative to readConfObject(config) is below used because
145
+ // renderProps is something under our control. Compare to
146
+ // serverSideRenderedBlock
138
147
  (0, configuration_1.readConfObject)(self.configuration);
139
- const { adapterConfig } = self;
148
+ const { level, adapterConfig } = self;
140
149
  const parent = (0, util_1.getContainingView)(self);
141
150
  const sessionId = (0, tracks_1.getRpcSessionId)(self);
142
151
  (0, mobx_state_tree_1.getSnapshot)(parent);
@@ -145,6 +154,7 @@ function renderBlockData(self) {
145
154
  rpcManager,
146
155
  renderProps: {
147
156
  ...display.renderProps(),
157
+ level,
148
158
  view: parent,
149
159
  adapterConfig,
150
160
  sessionId,
@@ -159,10 +169,10 @@ async function renderBlockEffect(props) {
159
169
  return;
160
170
  }
161
171
  const { rpcManager, renderProps } = props;
162
- const { adapterConfig } = renderProps;
163
- const view0 = renderProps.view.views[0];
172
+ const { adapterConfig, level } = renderProps;
173
+ const view = renderProps.view.views[level];
164
174
  const features = (await rpcManager.call('getFeats', 'CoreGetFeatures', {
165
- regions: view0.staticBlocks.contentBlocks,
175
+ regions: view.staticBlocks.contentBlocks,
166
176
  sessionId: 'getFeats',
167
177
  adapterConfig,
168
178
  }));
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { LinearComparativeViewModel } from '../model';
3
- type LCV = LinearComparativeViewModel;
4
- declare const Header: ({ model }: {
5
- model: LCV;
3
+ declare const Header: ({ model, }: {
4
+ model: LinearComparativeViewModel;
6
5
  }) => React.JSX.Element;
7
6
  export default Header;