@jbrowse/plugin-linear-genome-view 5.0.0-beta.2 → 5.0.0-beta.20

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 (177) hide show
  1. package/esm/LinearGenomeView/afterAttach.d.ts +22 -5
  2. package/esm/LinearGenomeView/afterAttach.js +129 -106
  3. package/esm/LinearGenomeView/axisConfigSchema.d.ts +18 -0
  4. package/esm/LinearGenomeView/axisConfigSchema.js +22 -0
  5. package/esm/LinearGenomeView/components/CenterLine.js +10 -5
  6. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +2 -3
  7. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +3 -5
  8. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +9 -4
  9. package/esm/LinearGenomeView/components/ExportSvgDialog.js +45 -8
  10. package/esm/LinearGenomeView/components/GetSequenceDialog.js +2 -2
  11. package/esm/LinearGenomeView/components/Header.js +11 -1
  12. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +2 -2
  13. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -3
  14. package/esm/LinearGenomeView/components/HeaderPanControls.js +6 -3
  15. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +4 -1
  16. package/esm/LinearGenomeView/components/HeaderZoomControls.js +6 -35
  17. package/esm/LinearGenomeView/components/Highlight.js +27 -11
  18. package/esm/LinearGenomeView/components/HighlightBand.d.ts +11 -2
  19. package/esm/LinearGenomeView/components/HighlightBand.js +32 -13
  20. package/esm/LinearGenomeView/components/HighlightChip.d.ts +3 -3
  21. package/esm/LinearGenomeView/components/HighlightChip.js +13 -8
  22. package/esm/LinearGenomeView/components/HighlightLabelDialog.d.ts +6 -0
  23. package/esm/LinearGenomeView/components/HighlightLabelDialog.js +18 -0
  24. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +3 -3
  25. package/esm/LinearGenomeView/components/ImportForm.js +7 -9
  26. package/esm/LinearGenomeView/components/LinearGenomeView.js +5 -12
  27. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +13 -14
  28. package/esm/LinearGenomeView/components/MiniControls.js +11 -5
  29. package/esm/LinearGenomeView/components/OverviewHighlight.js +3 -3
  30. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +3 -2
  31. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +6 -5
  32. package/esm/LinearGenomeView/components/OverviewRubberband.js +25 -48
  33. package/esm/LinearGenomeView/components/OverviewScalebar.js +4 -5
  34. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +5 -3
  35. package/esm/LinearGenomeView/components/PaddingBlocks.js +3 -8
  36. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +5 -6
  37. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +3 -2
  38. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +4 -4
  39. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
  40. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +74 -0
  41. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -2
  42. package/esm/LinearGenomeView/components/Rubberband.js +3 -2
  43. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -1
  44. package/esm/LinearGenomeView/components/SVGHighlightBand.js +16 -5
  45. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
  46. package/esm/LinearGenomeView/components/Scalebar.js +8 -5
  47. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +51 -36
  48. package/esm/LinearGenomeView/components/SearchBox.js +10 -16
  49. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +3 -2
  50. package/esm/LinearGenomeView/components/SearchPanelForm.js +4 -2
  51. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +4 -8
  52. package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -4
  53. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -7
  54. package/esm/LinearGenomeView/components/SearchResultsTable.js +25 -53
  55. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +2 -3
  56. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -4
  57. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +3 -2
  58. package/esm/LinearGenomeView/components/StrandCheckboxes.js +4 -2
  59. package/esm/LinearGenomeView/components/TrackContainer.d.ts +2 -3
  60. package/esm/LinearGenomeView/components/TrackContainer.js +63 -10
  61. package/esm/LinearGenomeView/components/TrackLabel.js +14 -4
  62. package/esm/LinearGenomeView/components/TrackLabelButtons.js +2 -2
  63. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +4 -5
  64. package/esm/LinearGenomeView/components/TrackLabelMenu.js +11 -14
  65. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +3 -4
  66. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +23 -10
  67. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +6 -4
  68. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +12 -24
  69. package/esm/LinearGenomeView/components/TracksContainer.js +11 -23
  70. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -2
  71. package/esm/LinearGenomeView/components/VerticalGuide.js +3 -16
  72. package/esm/LinearGenomeView/components/fetchSequence.d.ts +1 -2
  73. package/esm/LinearGenomeView/components/fetchSequence.js +15 -7
  74. package/esm/LinearGenomeView/components/recentLocationsMenu.js +10 -0
  75. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +0 -3
  76. package/esm/LinearGenomeView/components/useRangeSelect.js +26 -61
  77. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +3 -1
  78. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +4 -2
  79. package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -2
  80. package/esm/LinearGenomeView/components/useSideScroll.js +156 -102
  81. package/esm/LinearGenomeView/components/util.d.ts +4 -0
  82. package/esm/LinearGenomeView/components/util.js +4 -2
  83. package/esm/LinearGenomeView/consts.d.ts +2 -0
  84. package/esm/LinearGenomeView/consts.js +3 -1
  85. package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
  86. package/esm/LinearGenomeView/containingLgv.js +23 -0
  87. package/esm/LinearGenomeView/headerFit.d.ts +4 -2
  88. package/esm/LinearGenomeView/headerFit.js +20 -7
  89. package/esm/LinearGenomeView/index.d.ts +2 -7
  90. package/esm/LinearGenomeView/index.js +5 -7
  91. package/esm/LinearGenomeView/keyboardHandler.d.ts +8 -7
  92. package/esm/LinearGenomeView/keyboardHandler.js +61 -23
  93. package/esm/LinearGenomeView/launchKeys.d.ts +1 -1
  94. package/esm/LinearGenomeView/launchKeys.js +11 -6
  95. package/esm/LinearGenomeView/lazyDialogs.d.ts +16 -3
  96. package/esm/LinearGenomeView/lazyDialogs.js +1 -0
  97. package/esm/LinearGenomeView/linkedViewSync.d.ts +3 -11
  98. package/esm/LinearGenomeView/linkedViewSync.js +27 -49
  99. package/esm/LinearGenomeView/menuItems.d.ts +16 -18
  100. package/esm/LinearGenomeView/menuItems.js +264 -164
  101. package/esm/LinearGenomeView/model.d.ts +1192 -560
  102. package/esm/LinearGenomeView/model.js +805 -590
  103. package/esm/LinearGenomeView/rExport/exportLinearView.d.ts +17 -0
  104. package/esm/LinearGenomeView/rExport/exportLinearView.js +117 -0
  105. package/esm/LinearGenomeView/rExport/rScript.d.ts +110 -0
  106. package/esm/LinearGenomeView/rExport/rScript.js +524 -0
  107. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +1 -1
  108. package/esm/LinearGenomeView/sharedScaleContainer.js +2 -12
  109. package/esm/LinearGenomeView/showFiles.d.ts +2 -0
  110. package/esm/LinearGenomeView/showFiles.js +19 -0
  111. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +1 -1
  112. package/esm/LinearGenomeView/showRegionsWithUndo.js +13 -5
  113. package/esm/LinearGenomeView/stickyChrome.d.ts +5 -9
  114. package/esm/LinearGenomeView/stickyChrome.js +5 -9
  115. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +4 -4
  116. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +4 -1
  117. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +8 -21
  118. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +3 -1
  119. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +9 -9
  120. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +3 -1
  121. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +5 -5
  122. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +13 -18
  123. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +2 -5
  124. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +5 -6
  125. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +9 -10
  126. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +3 -3
  127. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +26 -0
  128. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
  129. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +21 -13
  130. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +4 -5
  131. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +7 -6
  132. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +2 -3
  133. package/esm/LinearGenomeView/svgcomponents/SVGView.js +17 -3
  134. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +24 -20
  135. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +42 -29
  136. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +74 -77
  137. package/esm/LinearGenomeView/svgcomponents/util.d.ts +28 -12
  138. package/esm/LinearGenomeView/svgcomponents/util.js +41 -29
  139. package/esm/LinearGenomeView/types.d.ts +13 -10
  140. package/esm/LinearGenomeView/types.js +0 -1
  141. package/esm/LinearGenomeView/util.d.ts +103 -46
  142. package/esm/LinearGenomeView/util.js +222 -170
  143. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +9 -6
  144. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  145. package/esm/MultiLevelRubberband/index.js +2 -0
  146. package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
  147. package/esm/MultiLevelRubberband/menuItems.js +52 -0
  148. package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
  149. package/esm/MultiLevelRubberband/rowLabel.js +27 -0
  150. package/esm/MultiLevelRubberband/types.d.ts +1 -0
  151. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +2 -1
  152. package/esm/MultiLevelRubberband/useRangeSelect.js +45 -59
  153. package/esm/TrackModifiers/index.d.ts +83 -0
  154. package/esm/TrackModifiers/index.js +231 -0
  155. package/esm/displayKitTests/perRegionTestEnv.d.ts +244 -68
  156. package/esm/displayKitTests/perRegionTestEnv.js +30 -26
  157. package/esm/index.d.ts +21 -99
  158. package/esm/index.js +17 -38
  159. package/esm/searchUtils.d.ts +26 -10
  160. package/esm/searchUtils.js +137 -137
  161. package/esm/shared/RubberbandSpan.d.ts +3 -2
  162. package/esm/shared/RubberbandSpan.js +6 -3
  163. package/esm/shared/coordLabels.d.ts +11 -4
  164. package/esm/shared/coordLabels.js +20 -5
  165. package/esm/shared/useWindowDrag.d.ts +18 -0
  166. package/esm/shared/useWindowDrag.js +47 -0
  167. package/package.json +12 -11
  168. package/esm/FeatureTrack/configSchema.d.ts +0 -124
  169. package/esm/FeatureTrack/configSchema.js +0 -54
  170. package/esm/FeatureTrack/index.d.ts +0 -2
  171. package/esm/FeatureTrack/index.js +0 -13
  172. package/esm/LinearGenomeView/initKeys.d.ts +0 -12
  173. package/esm/LinearGenomeView/initKeys.js +0 -68
  174. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +0 -6
  175. package/esm/MultiLevelRubberband/VerticalGuide.js +0 -21
  176. package/esm/lazyPluginExports.d.ts +0 -23
  177. package/esm/lazyPluginExports.js +0 -36
@@ -28,44 +28,49 @@ function makeStateModel(control, gate, configSchema) {
28
28
  .volatile(() => ({
29
29
  /** every `fetchNeeded` call, as the region list it was handed */
30
30
  fetchLog: [],
31
- loadedData: new Map(),
32
31
  /**
33
- * What `regionFetchKey` answers. A volatile, not a `control` knob, and
34
- * that is the point: a real display's key reads view state, so the
35
- * autorun re-runs when it moves. A plain closure value would be memoized
36
- * by the computed and never invalidate.
32
+ * What `zoomFetchArgs` answers. A volatile, not a `control` knob, and
33
+ * that is the point: a real display's args read view state, so the
34
+ * autorun re-runs when they move. A plain closure value would be
35
+ * memoized by the computed and never invalidate.
37
36
  */
38
37
  fetchKey: '',
39
38
  }))
39
+ .views(self => {
40
+ // chained, not replaced: `staleAnswers` forces a false answer for a
41
+ // bounded number of calls, and everything else is the foundation's own
42
+ // store-derived default
43
+ const superRegionHasData = self.regionHasData;
44
+ return {
45
+ regionHasData(displayedRegionIndex) {
46
+ control.cacheValidCalls += 1;
47
+ if (control.staleAnswers > 0) {
48
+ control.staleAnswers -= 1;
49
+ return false;
50
+ }
51
+ return superRegionHasData.call(self, displayedRegionIndex);
52
+ },
53
+ };
54
+ })
40
55
  .views(self => ({
56
+ /** the fetched payloads, off the foundation's store */
57
+ get loadedData() {
58
+ return self.regionPayloads;
59
+ },
41
60
  get gateEnabled() {
42
61
  return gate.gateEnabled ?? false;
43
62
  },
44
63
  get densityTooLarge() {
45
64
  return control.densityTooLarge;
46
65
  },
47
- get regionFetchKey() {
48
- return self.fetchKey;
49
- },
50
- regionHasData(_displayedRegionIndex) {
51
- control.cacheValidCalls += 1;
52
- if (control.staleAnswers > 0) {
53
- control.staleAnswers -= 1;
54
- return false;
55
- }
56
- return true;
66
+ zoomFetchArgs() {
67
+ return { key: self.fetchKey };
57
68
  },
58
69
  }))
59
70
  .actions(self => ({
60
71
  setFetchKey(key) {
61
72
  self.fetchKey = key;
62
73
  },
63
- setLoaded(displayedRegionIndex, value) {
64
- self.loadedData.set(displayedRegionIndex, value);
65
- },
66
- clearDisplaySpecificData() {
67
- self.loadedData.clear();
68
- },
69
74
  }))
70
75
  .actions(self => ({
71
76
  fetchNeeded(needed) {
@@ -90,17 +95,15 @@ function makeStateModel(control, gate, configSchema) {
90
95
  // budget means no measurement at all, which is why `estimateCalls`
91
96
  // stays at zero for an ungated display.
92
97
  if (byteLimit === undefined) {
93
- return { value: 'data' };
98
+ return { value: control.payloadTag };
94
99
  }
95
100
  control.estimateCalls += 1;
96
101
  const bytes = control.estimateBytes;
97
102
  return bytes > byteLimit
98
103
  ? { regionTooLarge: true, bytes }
99
- : { value: 'data', bytes };
100
- },
101
- onResult: (idx, result) => {
102
- self.setLoaded(idx, result.value);
104
+ : { value: control.payloadTag, bytes };
103
105
  },
106
+ onResult: (_idx, result) => result.value,
104
107
  });
105
108
  },
106
109
  }));
@@ -118,6 +121,7 @@ export function createPerRegionTestEnvironment({ measuresBytes = false, gate, es
118
121
  estimateBytes,
119
122
  estimateCalls: 0,
120
123
  densityTooLarge: false,
124
+ payloadTag: 'data',
121
125
  };
122
126
  const optIns = gate ?? { gateEnabled: measuresBytes };
123
127
  const env = createDisplayTestEnvironment({
package/esm/index.d.ts CHANGED
@@ -2,141 +2,63 @@ import Plugin from '@jbrowse/core/Plugin';
2
2
  import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class LinearGenomeViewPlugin extends Plugin {
4
4
  name: string;
5
- exports: {
6
- baseLinearDisplayConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
7
- readonly densityTier: {
8
- readonly type: 'stringEnum';
9
- readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"auto" | "density" | "features">;
10
- readonly defaultValue: 'auto';
11
- readonly description: 'when to draw the features-per-bin density band in place of features: "auto" swaps to it where the region is too large to fetch, "features" never does and keeps the banner, "density" always does. Needs a density source on the adapter (its densityAdapter slot)';
12
- readonly advanced: true;
13
- };
14
- readonly densityTierBpPerPx: {
15
- readonly type: 'number';
16
- readonly defaultValue: 0;
17
- readonly description: 'in "auto" mode, also draw the density band from this many bp per pixel outward, before the region is too large to fetch; 0 leaves the swap to the fetch-size gate alone';
18
- readonly advanced: true;
19
- };
20
- readonly fetchSizeLimit: {
21
- readonly type: 'number';
22
- readonly defaultValue: 1000000;
23
- readonly description: "maximum data to attempt to download for a given track, used if adapter doesn't specify one";
24
- readonly advanced: true;
25
- };
26
- readonly forceLoad: {
27
- readonly type: 'boolean';
28
- readonly defaultValue: false;
29
- readonly description: 'Declarative equivalent of the "Force load" button on the "too much data" banner: when true the display always renders, however large the region or dense the features. Off by default (the gate guards against huge downloads). Set it on a view no one can interact with — an embedded / notebook view, or a screenshot — where the region is known and you want it drawn without a click.';
30
- readonly advanced: true;
31
- };
32
- readonly maxFeatureScreenDensity: {
33
- readonly type: "number";
34
- readonly description: "maximum features per pixel before showing a \"too many features\" message";
35
- readonly defaultValue: 1;
36
- readonly advanced: true;
37
- };
38
- readonly height: {
39
- readonly type: "number";
40
- readonly defaultValue: 100;
41
- readonly description: "default height for the track";
42
- };
43
- readonly mouseover: {
44
- readonly type: "string";
45
- readonly description: "text to display when the cursor hovers over a feature";
46
- readonly defaultValue: "jexl:get(feature,'_mouseOver')||get(feature,'name')||get(feature,'function')||get(feature,'id')";
47
- readonly contextVariable: ["feature"];
48
- };
49
- readonly jexlFilters: {
50
- readonly type: "stringArray";
51
- readonly description: "default set of jexl filters to apply to a track. note: these do not use the jexl prefix because they have a deferred evaluation system";
52
- readonly defaultValue: readonly [];
53
- };
54
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
55
- SearchBox: {
56
- (props: {
57
- model: import("./index.ts").LinearGenomeViewModel;
58
- showHelp?: boolean;
59
- minWidth?: number;
60
- maxWidth?: number;
61
- style?: React.CSSProperties;
62
- }): import("react").JSX.Element;
63
- displayName: string;
64
- };
65
- ZoomControls: {
66
- (props: {
67
- model: import("./index.ts").LinearGenomeViewModel;
68
- }): import("react").JSX.Element;
69
- displayName: string;
70
- };
71
- LinearGenomeView: {
72
- (props: {
73
- model: import("./index.ts").LinearGenomeViewModel;
74
- }): import("react").JSX.Element;
75
- displayName: string;
76
- };
77
- };
78
5
  /**
79
6
  * #config LinearGenomeViewConfigSchema
80
7
  * #category root
8
+ * Sets defaults for every linear genome view, on the root config under
9
+ * `configuration.LinearGenomeViewPlugin`.
81
10
  */
82
11
  configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
83
- /**
84
- * #slot configuration.LinearGenomeViewPlugin.trackLabels
85
- * where a track's name is drawn: `offset` gives it its own line above the
86
- * data, `overlapping` floats it over the top of the data to save vertical
87
- * space, `hidden` omits it. The view menu's "Show..." submenu sets the same
88
- * thing per session, under its "Track labels" heading
89
- */
90
12
  readonly trackLabels: {
91
- readonly type: "string";
92
- readonly defaultValue: "offset";
93
- readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"hidden" | "offset" | "overlapping">;
13
+ type: "string";
14
+ } & {
15
+ model: import("@jbrowse/mobx-state-tree").ISimpleType<"hidden" | "offset" | "overlapping">;
16
+ } & {
17
+ defaultValue: string;
94
18
  };
95
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
19
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
96
20
  install(pluginManager: PluginManager): void;
97
21
  configure(pluginManager: PluginManager): void;
98
22
  }
99
23
  export { DisplayChromeOverlayProvider, DisplayUIProvider, FloatingLegend, TrackControlProvider, plainChromeOverlays, plainTrackControl, useTrackControlMenu, } from '@jbrowse/display-ui';
100
- export type { DisplayBackgroundProgressModel, DisplayChromeOverlays, DisplayErrorBarModel, DisplayLoadingOverlayModel, LegendItem, LegendSection, TooLargeMessageModel, TrackControlComponent, TrackControlIcon, TrackControlMenu, TrackControlOption, TrackControlProps, } from '@jbrowse/display-ui';
101
- export { HighlightBand, HighlightChip, type LinearGenomeViewModel, type LinearGenomeViewStateModel, OverviewHighlightBand, SVGHighlightBand, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.ts';
24
+ export type { BackgroundProgressProps, DisplayChromeOverlays, ErrorBarProps, LegendItem, LegendSection, LoadingProps, RenderErrorProps, TooLargeProps, TrackControlComponent, TrackControlIcon, TrackControlMenu, TrackControlOption, TrackControlProps, } from '@jbrowse/display-ui';
25
+ export { HighlightChip, type LinearGenomeViewModel, type LinearGenomeViewStateModel, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.ts';
102
26
  export { default as SearchBox } from './LinearGenomeView/components/SearchBox.tsx';
103
- export { default as HeaderSearchBoxes } from './LinearGenomeView/components/HeaderSearchBoxes.tsx';
104
27
  export { default as HeaderSearchBoxRow } from './LinearGenomeView/components/HeaderSearchBoxRow.tsx';
105
28
  export { searchBoxMenuItems, useSearchBoxPrefs, } from './LinearGenomeView/components/useSearchBoxPrefs.ts';
106
29
  export type { SearchBoxPrefs } from './LinearGenomeView/components/useSearchBoxPrefs.ts';
107
30
  export { normalizeTrackInit } from '@jbrowse/core/util/tracks';
108
- export { linearGenomeViewPropKeys, partitionLaunchKeys, } from './LinearGenomeView/initKeys.ts';
109
- export { applyInitHighlights } from './LinearGenomeView/afterAttach.ts';
110
- export { MultiLevelRubberband } from './MultiLevelRubberband/index.ts';
31
+ export { applyInitHighlights, navToInitLoc, showInitTracks, } from './LinearGenomeView/afterAttach.ts';
32
+ export { launchTrackInit, launchTrackWithModifiers, openedDisplayType, writeFilter, writeMembers, writeReadFilter, } from './TrackModifiers/index.ts';
33
+ export type { ModifierView } from './TrackModifiers/index.ts';
34
+ export { MultiLevelRubberband, multiLevelRowClickMenuItems, multiLevelRowMenuItems, rowLabels, } from './MultiLevelRubberband/index.ts';
111
35
  export { fetchResults, SearchResultsNotFoundError } from './searchUtils.ts';
112
36
  export type { LaunchLinearGenomeViewArgs } from './LaunchLinearGenomeView/index.ts';
113
- export type { BpOffset, ExportSvgOptions, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, VolatileGuide, } from './LinearGenomeView/types.ts';
37
+ export type { BpOffset, ExportSvgOptions, HighlightInput, HighlightType, InitState, LinearGenomeViewLaunchProps, LinearGenomeViewPanelInit, NavLocation, TrackLabelMode, ViewTrackLabelMode, VolatileGuide, } from './LinearGenomeView/types.ts';
114
38
  export type { ScalebarRefNameLabel } from './LinearGenomeView/util.ts';
39
+ export type { HighlightRegion, SearchHits, SearchPickerRow, SearchPickerState, } from './LinearGenomeView/model.ts';
115
40
  export type { RegionsOrientation } from './LinearGenomeView/util.ts';
41
+ export type { RegionEdit } from './LinearGenomeView/util.ts';
116
42
  export { makeTicks } from './LinearGenomeView/util.ts';
117
43
  export type { Tick } from './LinearGenomeView/util.ts';
44
+ export { containingLgv } from './LinearGenomeView/containingLgv.ts';
118
45
  export { showRegionsWithUndo } from './LinearGenomeView/showRegionsWithUndo.ts';
119
46
  export type { SharedFit } from './LinearGenomeView/sharedScaleContainer.ts';
120
47
  export { fitAllRegionsWindow } from './LinearGenomeView/util.ts';
121
48
  export { renderToSvg } from './LinearGenomeView/svgcomponents/SVGLinearGenomeView.tsx';
122
49
  export { useViewSvgFigure } from './LinearGenomeView/svgcomponents/useViewSvgFigure.tsx';
123
50
  export type { ViewSvgFigureOptions, ViewSvgFigureResult, } from './LinearGenomeView/svgcomponents/useViewSvgFigure.tsx';
124
- export { default as SVGTracks } from './LinearGenomeView/svgcomponents/SVGTracks.tsx';
125
- export { default as SVGView } from './LinearGenomeView/svgcomponents/SVGView.tsx';
126
- export { default as SVGRowHeader } from './LinearGenomeView/svgcomponents/SVGRowHeader.tsx';
127
- export { default as SVGHighlights } from './LinearGenomeView/svgcomponents/SVGHighlights.tsx';
128
- export { default as SVGHighlightsOverlay } from './LinearGenomeView/svgcomponents/SVGHighlightsOverlay.tsx';
51
+ export { default as SVGStackedRow } from './LinearGenomeView/svgcomponents/SVGStackedRow.tsx';
129
52
  export { default as ExportSvgDialog } from './LinearGenomeView/components/ExportSvgDialog.tsx';
130
53
  export { GetSequenceDialog } from './LinearGenomeView/lazyDialogs.ts';
131
54
  export { default as ConnectedHoverHighlight } from './LinearGenomeView/components/ConnectedHoverHighlight.tsx';
132
- export { default as HoverPositionHighlight } from './LinearGenomeView/components/HoverPositionHighlight.tsx';
133
- export { FloatingSvgOverlay, TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
134
55
  export type { HoverHighlightPosition } from './LinearGenomeView/components/HoverPositionHighlight.tsx';
56
+ export { FloatingSvgOverlay, TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
135
57
  export { SvgChrome, SvgClipRect } from '@jbrowse/core/svg/SvgExport';
136
58
  export { svgSafeId } from '@jbrowse/core/svg/svgId';
137
59
  export { awaitSvgReady, awaitSvgRenders } from '@jbrowse/core/svg/svgReady';
138
60
  export type { SvgExportable } from '@jbrowse/core/svg/svgReady';
139
- export { defaultTextHeight, getRowHeaderLayout, labelBaselineFromTop, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.ts';
61
+ export { defaultTextHeight, getRowHeaderLayout, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.ts';
140
62
  export { notifySkippedSvgTracks } from '@jbrowse/core/svg/trackNames';
141
63
  export { renderViewTracks } from './LinearGenomeView/svgcomponents/renderViewTracks.ts';
142
64
  export type { SvgExportTrack, ViewTracksSvg, } from './LinearGenomeView/svgcomponents/renderViewTracks.ts';
package/esm/index.js CHANGED
@@ -1,48 +1,37 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
2
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
3
3
  import { isAbstractMenuManager } from '@jbrowse/core/util';
4
- import baseLinearDisplayConfigSchema from '@jbrowse/display-kit/configSchema';
4
+ import { VIEW_TRACK_LABEL_MODES } from '@jbrowse/display-kit/types';
5
5
  import { types } from '@jbrowse/mobx-state-tree';
6
6
  import LineStyleIcon from '@mui/icons-material/LineStyle';
7
- import FeatureTrackF from './FeatureTrack/index.js';
8
7
  import LaunchLinearGenomeViewF from './LaunchLinearGenomeView/index.js';
9
8
  import SequenceFeatureHoverHighlightExtensionF from './LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js';
10
9
  import LinearGenomeViewF from './LinearGenomeView/index.js';
11
- import { LinearGenomeView, SearchBox, ZoomControls, } from './lazyPluginExports.js';
12
10
  export default class LinearGenomeViewPlugin extends Plugin {
13
11
  name = 'LinearGenomeViewPlugin';
14
- // the three components here are lazy, see lazyPluginExports.tsx — naming a
15
- // component in this object is enough to pin it into every host's first paint
16
- exports = {
17
- baseLinearDisplayConfigSchema,
18
- SearchBox,
19
- ZoomControls,
20
- LinearGenomeView,
21
- };
22
12
  /**
23
13
  * #config LinearGenomeViewConfigSchema
24
14
  * #category root
15
+ * Sets defaults for every linear genome view, on the root config under
16
+ * `configuration.LinearGenomeViewPlugin`.
25
17
  */
26
18
  configurationSchema = ConfigurationSchema('LinearGenomeViewConfigSchema', {
27
19
  /**
28
20
  * #slot configuration.LinearGenomeViewPlugin.trackLabels
29
- * where a track's name is drawn: `offset` gives it its own line above the
21
+ * The placement of a track's name: `offset` puts it on a line above the
30
22
  * data, `overlapping` floats it over the top of the data to save vertical
31
- * space, `hidden` omits it. The view menu's "Show..." submenu sets the same
32
- * thing per session, under its "Track labels" heading
23
+ * space, `hidden` omits it. The view menu's "Track labels" submenu sets the
24
+ * same thing per session
33
25
  */
34
26
  trackLabels: {
35
27
  type: 'string',
36
28
  defaultValue: 'offset',
37
29
  model: types.enumeration('trackLabelOptions', [
38
- 'offset',
39
- 'overlapping',
40
- 'hidden',
30
+ ...VIEW_TRACK_LABEL_MODES,
41
31
  ]),
42
32
  },
43
33
  });
44
34
  install(pluginManager) {
45
- FeatureTrackF(pluginManager);
46
35
  LinearGenomeViewF(pluginManager);
47
36
  LaunchLinearGenomeViewF(pluginManager);
48
37
  SequenceFeatureHoverHighlightExtensionF(pluginManager);
@@ -65,15 +54,10 @@ export default class LinearGenomeViewPlugin extends Plugin {
65
54
  // `@jbrowse/display-kit`, and is imported from there by subpath, never from
66
55
  // here.
67
56
  export { DisplayChromeOverlayProvider, DisplayUIProvider, FloatingLegend, TrackControlProvider, plainChromeOverlays, plainTrackControl, useTrackControlMenu, } from '@jbrowse/display-ui';
68
- export { HighlightBand, HighlightChip, OverviewHighlightBand, SVGHighlightBand, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.js';
69
- // Deliberately the component itself, and deliberately not the same `SearchBox`
70
- // the `exports` object above hands runtime plugins — that one is lazy. An
71
- // in-tree consumer (comparative view, breakpoint split view) imports this
72
- // barrel and gets shaken out of every build that doesn't, which is all the
73
- // laziness it needs; a runtime plugin resolves `exports` at module scope, where
74
- // only `lazy()` keeps the component out of the host's first paint. Imported
75
- // straight from the component rather than through `LinearGenomeView/index.ts`
76
- // so the view registration module holds no React component at all.
57
+ export { HighlightChip, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.js';
58
+ // Imported straight from the component rather than through
59
+ // `LinearGenomeView/index.ts` so the view registration module holds no React
60
+ // component at all; a consumer that never renders it shakes it out.
77
61
  export { default as SearchBox } from './LinearGenomeView/components/SearchBox.js';
78
62
  // The same two consumers, one composition further on: a header stacking several
79
63
  // views draws one search box per row beside the span it is showing, and
@@ -81,13 +65,12 @@ export { default as SearchBox } from './LinearGenomeView/components/SearchBox.js
81
65
  // visibility/orientation choice and `searchBoxMenuItems` the rows that set it —
82
66
  // shared rather than copied, since the copies had already drifted on what to
83
67
  // call `sideBySide: false`. Only the storage prefix stays with each container.
84
- export { default as HeaderSearchBoxes } from './LinearGenomeView/components/HeaderSearchBoxes.js';
85
68
  export { default as HeaderSearchBoxRow } from './LinearGenomeView/components/HeaderSearchBoxRow.js';
86
69
  export { searchBoxMenuItems, useSearchBoxPrefs, } from './LinearGenomeView/components/useSearchBoxPrefs.js';
87
70
  export { normalizeTrackInit } from '@jbrowse/core/util/tracks';
88
- export { linearGenomeViewPropKeys, partitionLaunchKeys, } from './LinearGenomeView/initKeys.js';
89
- export { applyInitHighlights } from './LinearGenomeView/afterAttach.js';
90
- export { MultiLevelRubberband } from './MultiLevelRubberband/index.js';
71
+ export { applyInitHighlights, navToInitLoc, showInitTracks, } from './LinearGenomeView/afterAttach.js';
72
+ export { launchTrackInit, launchTrackWithModifiers, openedDisplayType, writeFilter, writeMembers, writeReadFilter, } from './TrackModifiers/index.js';
73
+ export { MultiLevelRubberband, multiLevelRowClickMenuItems, multiLevelRowMenuItems, rowLabels, } from './MultiLevelRubberband/index.js';
91
74
  export { fetchResults, SearchResultsNotFoundError } from './searchUtils.js';
92
75
  // The scalebar's grid, published because it is a contract other views draw
93
76
  // against rather than an internal of this one: the synteny view's location
@@ -99,6 +82,7 @@ export { makeTicks } from './LinearGenomeView/util.js';
99
82
  // The two halves of "show these regions instead": navigate the view you are
100
83
  // looking at, or seed a snapshot for a new one. A caller deriving either itself
101
84
  // lands on a viewport property the model no longer reads — see each for how.
85
+ export { containingLgv } from './LinearGenomeView/containingLgv.js';
102
86
  export { showRegionsWithUndo } from './LinearGenomeView/showRegionsWithUndo.js';
103
87
  export { fitAllRegionsWindow } from './LinearGenomeView/util.js';
104
88
  export { renderToSvg } from './LinearGenomeView/svgcomponents/SVGLinearGenomeView.js';
@@ -106,15 +90,10 @@ export { renderToSvg } from './LinearGenomeView/svgcomponents/SVGLinearGenomeVie
106
90
  // components mounted in a host's own page. See the file for the three pieces
107
91
  // between `renderToSvg` and inline JSX that each fail quietly.
108
92
  export { useViewSvgFigure } from './LinearGenomeView/svgcomponents/useViewSvgFigure.js';
109
- export { default as SVGTracks } from './LinearGenomeView/svgcomponents/SVGTracks.js';
110
- export { default as SVGView } from './LinearGenomeView/svgcomponents/SVGView.js';
111
- export { default as SVGRowHeader } from './LinearGenomeView/svgcomponents/SVGRowHeader.js';
112
- export { default as SVGHighlights } from './LinearGenomeView/svgcomponents/SVGHighlights.js';
113
- export { default as SVGHighlightsOverlay } from './LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js';
93
+ export { default as SVGStackedRow } from './LinearGenomeView/svgcomponents/SVGStackedRow.js';
114
94
  export { default as ExportSvgDialog } from './LinearGenomeView/components/ExportSvgDialog.js';
115
95
  export { GetSequenceDialog } from './LinearGenomeView/lazyDialogs.js';
116
96
  export { default as ConnectedHoverHighlight } from './LinearGenomeView/components/ConnectedHoverHighlight.js';
117
- export { default as HoverPositionHighlight } from './LinearGenomeView/components/HoverPositionHighlight.js';
118
97
  // The overlay layer lives in `@jbrowse/display-ui` — a package rather than this
119
98
  // plugin, because `packages/tree-sidebar` needed it and had to depend on a
120
99
  // *plugin* to get it. Re-exported here, since every display already names it
@@ -131,7 +110,7 @@ export { SvgChrome, SvgClipRect } from '@jbrowse/core/svg/SvgExport';
131
110
  // inset or non-rect clip); ids built from a trackId/refName need it
132
111
  export { svgSafeId } from '@jbrowse/core/svg/svgId';
133
112
  export { awaitSvgReady, awaitSvgRenders } from '@jbrowse/core/svg/svgReady';
134
- export { defaultTextHeight, getRowHeaderLayout, labelBaselineFromTop, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.js';
113
+ export { defaultTextHeight, getRowHeaderLayout, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.js';
135
114
  // Re-exported from core, where it moved so the circular view — which depends
136
115
  // on neither this plugin nor the LGV geometry around it — can send the same
137
116
  // notification. Kept on this plugin's surface because published plugins
@@ -3,8 +3,7 @@ import type BaseResult from '@jbrowse/core/TextSearch/BaseResults';
3
3
  import type TextSearchManager from '@jbrowse/core/TextSearch/TextSearchManager';
4
4
  import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
5
5
  import type { SearchType } from '@jbrowse/core/data_adapters/BaseAdapter';
6
- import type { AssemblyHost, NotificationSink, TrackCatalog } from '@jbrowse/core/util';
7
- import type { StopToken } from '@jbrowse/core/util/stopToken';
6
+ import type { AbstractSessionModel, AssemblyHost, NotificationSink, TrackCatalog } from '@jbrowse/core/util';
8
7
  declare module '@jbrowse/core/PluginManager' {
9
8
  interface ExtensionPointRegistry {
10
9
  'LinearGenomeView-searchResultSelected': {
@@ -24,14 +23,14 @@ export declare function navigateToSelectedOption({ option, model, assemblyName,
24
23
  option: BaseResult;
25
24
  model: LinearGenomeViewModel;
26
25
  assemblyName: string;
27
- }): Promise<void>;
26
+ }): Promise<boolean>;
28
27
  export declare function isOpenInView(result: BaseResult, model: LinearGenomeViewModel): boolean;
29
- export declare function unanimousResult({ results, model, session, assembly, }: {
28
+ export declare function distinctDestinations({ results, model, session, assembly, }: {
30
29
  results: BaseResult[];
31
30
  model: LinearGenomeViewModel;
32
31
  session: TrackCatalog;
33
32
  assembly?: Assembly;
34
- }): BaseResult | undefined;
33
+ }): BaseResult[];
35
34
  export declare function showSearchResults({ results, query, model, assemblyName, grow, showHitTrack, }: {
36
35
  results: BaseResult[];
37
36
  query: string;
@@ -40,6 +39,7 @@ export declare function showSearchResults({ results, query, model, assemblyName,
40
39
  grow?: number;
41
40
  showHitTrack?: boolean;
42
41
  }): Promise<boolean>;
42
+ export declare function hitTrackToShow(result: BaseResult, session: TrackCatalog): string | undefined;
43
43
  export declare function navToOption({ option, model, assemblyName, grow, showHitTrack, }: {
44
44
  model: LinearGenomeViewModel;
45
45
  option: BaseResult;
@@ -58,13 +58,29 @@ export declare function handleSelectedRegion({ input, model, assemblyName, grow,
58
58
  grow?: number;
59
59
  showHitTrack?: boolean;
60
60
  }): Promise<boolean>;
61
- export declare function checkRef(str: string, isRef: (name: string) => boolean): boolean;
62
- export declare function fetchResults({ queryString, searchType, assemblyName, textSearchManager, assembly, stopToken, }: {
61
+ interface SearchArgs {
63
62
  queryString: string;
64
63
  assemblyName: string;
65
64
  searchType?: SearchType;
66
65
  textSearchManager?: TextSearchManager;
67
66
  assembly?: Assembly;
68
- stopToken?: StopToken;
69
- }): Promise<BaseResult[]>;
70
- export declare function splitLast(str: string, split: string): [string, string];
67
+ signal?: AbortSignal;
68
+ }
69
+ interface SessionSearchArgs {
70
+ session: Pick<AbstractSessionModel, 'assemblyManager' | 'textSearchManager'>;
71
+ queryString: string;
72
+ assemblyName: string;
73
+ searchType?: SearchType;
74
+ signal?: AbortSignal;
75
+ }
76
+ /**
77
+ * The search box's hits for a query: refNames and text-index results, merged.
78
+ * Pass the session and the function finds the index manager and the assembly
79
+ * itself; passing `textSearchManager` and `assembly` is the older form.
80
+ */
81
+ export declare function fetchResults(args: SessionSearchArgs | SearchArgs): Promise<BaseResult[]>;
82
+ export declare function nameNotFound(input: string, assemblyName: string, { indexCount, failures }: {
83
+ indexCount: number;
84
+ failures: unknown[];
85
+ }): Error;
86
+ export {};