@jbrowse/plugin-linear-genome-view 5.0.0-beta.1 → 5.0.0-beta.10

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 (145) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +142 -50
  2. package/esm/LaunchLinearGenomeView/index.js +2 -13
  3. package/esm/LinearGenomeView/afterAttach.d.ts +5 -5
  4. package/esm/LinearGenomeView/afterAttach.js +73 -59
  5. package/esm/LinearGenomeView/components/CenterLine.js +5 -3
  6. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +3 -5
  7. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +3 -2
  8. package/esm/LinearGenomeView/components/ExportSvgDialog.js +6 -2
  9. package/esm/LinearGenomeView/components/GetSequenceDialog.js +2 -2
  10. package/esm/LinearGenomeView/components/Header.js +11 -1
  11. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +2 -2
  12. package/esm/LinearGenomeView/components/HeaderPanControls.js +2 -1
  13. package/esm/LinearGenomeView/components/HeaderZoomControls.js +4 -34
  14. package/esm/LinearGenomeView/components/Highlight.js +7 -7
  15. package/esm/LinearGenomeView/components/HighlightBand.js +2 -2
  16. package/esm/LinearGenomeView/components/HighlightChip.d.ts +1 -2
  17. package/esm/LinearGenomeView/components/HighlightChip.js +5 -7
  18. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +3 -3
  19. package/esm/LinearGenomeView/components/ImportForm.js +2 -2
  20. package/esm/LinearGenomeView/components/LinearGenomeView.js +3 -3
  21. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +3 -4
  22. package/esm/LinearGenomeView/components/MiniControls.js +3 -2
  23. package/esm/LinearGenomeView/components/OverviewHighlight.js +3 -3
  24. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +2 -3
  25. package/esm/LinearGenomeView/components/OverviewRubberband.js +20 -45
  26. package/esm/LinearGenomeView/components/OverviewScalebar.js +4 -5
  27. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +5 -3
  28. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/PaddingBlocks.js +14 -9
  30. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +5 -6
  31. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
  32. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
  33. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -2
  34. package/esm/LinearGenomeView/components/Rubberband.js +3 -2
  35. package/esm/LinearGenomeView/components/SVGHighlightBand.js +2 -3
  36. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
  37. package/esm/LinearGenomeView/components/Scalebar.js +8 -5
  38. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +49 -34
  39. package/esm/LinearGenomeView/components/SearchBox.js +8 -7
  40. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +2 -1
  41. package/esm/LinearGenomeView/components/SearchResultsDialog.js +2 -2
  42. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +2 -1
  43. package/esm/LinearGenomeView/components/SearchResultsTable.js +12 -29
  44. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -4
  45. package/esm/LinearGenomeView/components/TrackContainer.js +63 -9
  46. package/esm/LinearGenomeView/components/TrackLabel.js +10 -3
  47. package/esm/LinearGenomeView/components/TrackLabelButtons.js +2 -2
  48. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +2 -2
  49. package/esm/LinearGenomeView/components/TrackLabelMenu.js +3 -2
  50. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +4 -1
  51. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +11 -23
  52. package/esm/LinearGenomeView/components/TracksContainer.js +10 -22
  53. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -2
  54. package/esm/LinearGenomeView/components/VerticalGuide.js +3 -16
  55. package/esm/LinearGenomeView/components/ZoomButton.js +6 -1
  56. package/esm/LinearGenomeView/components/ZoomTransform.js +4 -0
  57. package/esm/LinearGenomeView/components/fetchSequence.d.ts +1 -2
  58. package/esm/LinearGenomeView/components/recentLocationsMenu.js +10 -0
  59. package/esm/LinearGenomeView/components/searchModes.d.ts +1 -1
  60. package/esm/LinearGenomeView/components/searchModes.js +1 -1
  61. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +0 -3
  62. package/esm/LinearGenomeView/components/useRangeSelect.js +20 -59
  63. package/esm/LinearGenomeView/components/useSideScroll.d.ts +16 -2
  64. package/esm/LinearGenomeView/components/useSideScroll.js +153 -103
  65. package/esm/LinearGenomeView/components/util.d.ts +4 -0
  66. package/esm/LinearGenomeView/components/util.js +4 -2
  67. package/esm/LinearGenomeView/consts.d.ts +2 -0
  68. package/esm/LinearGenomeView/consts.js +3 -1
  69. package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
  70. package/esm/LinearGenomeView/containingLgv.js +23 -0
  71. package/esm/LinearGenomeView/headerFit.d.ts +4 -2
  72. package/esm/LinearGenomeView/headerFit.js +20 -7
  73. package/esm/LinearGenomeView/index.d.ts +1 -5
  74. package/esm/LinearGenomeView/index.js +10 -7
  75. package/esm/LinearGenomeView/keyboardHandler.d.ts +2 -0
  76. package/esm/LinearGenomeView/keyboardHandler.js +15 -1
  77. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  78. package/esm/LinearGenomeView/launchKeys.js +27 -0
  79. package/esm/LinearGenomeView/lazyDialogs.d.ts +2 -4
  80. package/esm/LinearGenomeView/lazyDialogs.js +1 -0
  81. package/esm/LinearGenomeView/linkedViewSync.d.ts +3 -11
  82. package/esm/LinearGenomeView/linkedViewSync.js +27 -43
  83. package/esm/LinearGenomeView/menuItems.d.ts +16 -18
  84. package/esm/LinearGenomeView/menuItems.js +242 -151
  85. package/esm/LinearGenomeView/model.d.ts +2009 -200
  86. package/esm/LinearGenomeView/model.js +545 -395
  87. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +1 -1
  88. package/esm/LinearGenomeView/showRegionsWithUndo.js +7 -1
  89. package/esm/LinearGenomeView/stickyChrome.d.ts +5 -9
  90. package/esm/LinearGenomeView/stickyChrome.js +5 -9
  91. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +4 -4
  92. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +4 -1
  93. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +8 -21
  94. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +8 -8
  95. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +3 -3
  96. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +7 -11
  97. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +2 -5
  98. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +5 -6
  99. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +9 -10
  100. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +3 -3
  101. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
  102. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
  103. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +15 -6
  104. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +4 -4
  105. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +6 -5
  106. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +1 -1
  107. package/esm/LinearGenomeView/svgcomponents/SVGView.js +1 -1
  108. package/esm/LinearGenomeView/svgcomponents/figureContract.js +14 -14
  109. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +1 -1
  110. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +50 -68
  111. package/esm/LinearGenomeView/svgcomponents/util.d.ts +9 -5
  112. package/esm/LinearGenomeView/svgcomponents/util.js +26 -21
  113. package/esm/LinearGenomeView/types.d.ts +8 -11
  114. package/esm/LinearGenomeView/util.d.ts +60 -45
  115. package/esm/LinearGenomeView/util.js +131 -160
  116. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +7 -4
  117. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  118. package/esm/MultiLevelRubberband/index.js +2 -0
  119. package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
  120. package/esm/MultiLevelRubberband/menuItems.js +52 -0
  121. package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
  122. package/esm/MultiLevelRubberband/rowLabel.js +27 -0
  123. package/esm/MultiLevelRubberband/types.d.ts +1 -0
  124. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +2 -1
  125. package/esm/MultiLevelRubberband/useRangeSelect.js +31 -47
  126. package/esm/displayKitTests/perRegionTestEnv.d.ts +214 -86
  127. package/esm/displayKitTests/perRegionTestEnv.js +30 -29
  128. package/esm/index.d.ts +15 -85
  129. package/esm/index.js +13 -36
  130. package/esm/searchUtils.d.ts +18 -9
  131. package/esm/searchUtils.js +85 -69
  132. package/esm/shared/RubberbandSpan.js +2 -1
  133. package/esm/shared/coordLabels.d.ts +7 -0
  134. package/esm/shared/coordLabels.js +15 -1
  135. package/esm/shared/useWindowDrag.d.ts +18 -0
  136. package/esm/shared/useWindowDrag.js +45 -0
  137. package/package.json +10 -10
  138. package/esm/LinearGenomeView/FloatingSvgOverlay.d.ts +0 -5
  139. package/esm/LinearGenomeView/FloatingSvgOverlay.js +0 -25
  140. package/esm/LinearGenomeView/initKeys.d.ts +0 -13
  141. package/esm/LinearGenomeView/initKeys.js +0 -104
  142. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +0 -6
  143. package/esm/MultiLevelRubberband/VerticalGuide.js +0 -21
  144. package/esm/lazyPluginExports.d.ts +0 -23
  145. package/esm/lazyPluginExports.js +0 -36
@@ -28,47 +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
- get densityGateEnabled() {
45
- return gate.densityGateEnabled ?? false;
46
- },
47
63
  get densityTooLarge() {
48
64
  return control.densityTooLarge;
49
65
  },
50
- get regionFetchKey() {
51
- return self.fetchKey;
52
- },
53
- regionHasData(_displayedRegionIndex) {
54
- control.cacheValidCalls += 1;
55
- if (control.staleAnswers > 0) {
56
- control.staleAnswers -= 1;
57
- return false;
58
- }
59
- return true;
66
+ zoomFetchArgs() {
67
+ return { key: self.fetchKey };
60
68
  },
61
69
  }))
62
70
  .actions(self => ({
63
71
  setFetchKey(key) {
64
72
  self.fetchKey = key;
65
73
  },
66
- setLoaded(displayedRegionIndex, value) {
67
- self.loadedData.set(displayedRegionIndex, value);
68
- },
69
- clearDisplaySpecificData() {
70
- self.loadedData.clear();
71
- },
72
74
  }))
73
75
  .actions(self => ({
74
76
  fetchNeeded(needed) {
@@ -93,17 +95,15 @@ function makeStateModel(control, gate, configSchema) {
93
95
  // budget means no measurement at all, which is why `estimateCalls`
94
96
  // stays at zero for an ungated display.
95
97
  if (byteLimit === undefined) {
96
- return { value: 'data' };
98
+ return { value: control.payloadTag };
97
99
  }
98
100
  control.estimateCalls += 1;
99
101
  const bytes = control.estimateBytes;
100
102
  return bytes > byteLimit
101
103
  ? { regionTooLarge: true, bytes }
102
- : { value: 'data', bytes };
103
- },
104
- onResult: (idx, result) => {
105
- self.setLoaded(idx, result.value);
104
+ : { value: control.payloadTag, bytes };
106
105
  },
106
+ onResult: (_idx, result) => result.value,
107
107
  });
108
108
  },
109
109
  }));
@@ -121,6 +121,7 @@ export function createPerRegionTestEnvironment({ measuresBytes = false, gate, es
121
121
  estimateBytes,
122
122
  estimateCalls: 0,
123
123
  densityTooLarge: false,
124
+ payloadTag: 'data',
124
125
  };
125
126
  const optIns = gate ?? { gateEnabled: measuresBytes };
126
127
  const env = createDisplayTestEnvironment({
package/esm/index.d.ts CHANGED
@@ -2,129 +2,59 @@ 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 fetchSizeLimit: {
8
- readonly type: 'number';
9
- readonly defaultValue: 1000000;
10
- readonly description: "maximum data to attempt to download for a given track, used if adapter doesn't specify one";
11
- readonly advanced: true;
12
- };
13
- readonly forceLoad: {
14
- readonly type: 'boolean';
15
- readonly defaultValue: false;
16
- 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.';
17
- readonly advanced: true;
18
- };
19
- readonly maxFeatureScreenDensity: {
20
- readonly type: "number";
21
- readonly description: "maximum features per pixel before showing a \"too many features\" message";
22
- readonly defaultValue: 1;
23
- readonly advanced: true;
24
- };
25
- readonly height: {
26
- readonly type: "number";
27
- readonly defaultValue: 100;
28
- readonly description: "default height for the track";
29
- };
30
- readonly mouseover: {
31
- readonly type: "string";
32
- readonly description: "text to display when the cursor hovers over a feature";
33
- readonly defaultValue: "jexl:get(feature,'_mouseOver')||get(feature,'name')||get(feature,'function')||get(feature,'id')";
34
- readonly contextVariable: ["feature"];
35
- };
36
- readonly jexlFilters: {
37
- readonly type: "stringArray";
38
- 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";
39
- readonly defaultValue: readonly [];
40
- };
41
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
42
- SearchBox: {
43
- (props: {
44
- model: import("./index.ts").LinearGenomeViewModel;
45
- showHelp?: boolean;
46
- minWidth?: number;
47
- maxWidth?: number;
48
- style?: React.CSSProperties;
49
- }): import("react").JSX.Element;
50
- displayName: string;
51
- };
52
- ZoomControls: {
53
- (props: {
54
- model: import("./index.ts").LinearGenomeViewModel;
55
- }): import("react").JSX.Element;
56
- displayName: string;
57
- };
58
- LinearGenomeView: {
59
- (props: {
60
- model: import("./index.ts").LinearGenomeViewModel;
61
- }): import("react").JSX.Element;
62
- displayName: string;
63
- };
64
- };
65
5
  /**
66
6
  * #config LinearGenomeViewConfigSchema
67
7
  * #category root
68
8
  */
69
9
  configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
70
- /**
71
- * #slot configuration.LinearGenomeViewPlugin.trackLabels
72
- * where a track's name is drawn: `offset` gives it its own line above the
73
- * data, `overlapping` floats it over the top of the data to save vertical
74
- * space, `hidden` omits it. The view menu's "Show..." submenu sets the same
75
- * thing per session, under its "Track labels" heading
76
- */
77
10
  readonly trackLabels: {
78
- readonly type: "string";
79
- readonly defaultValue: "offset";
80
- readonly model: import("@jbrowse/mobx-state-tree").ISimpleType<"hidden" | "offset" | "overlapping">;
11
+ type: "string";
12
+ } & {
13
+ model: import("@jbrowse/mobx-state-tree").ISimpleType<"hidden" | "offset" | "overlapping">;
14
+ } & {
15
+ defaultValue: string;
81
16
  };
82
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
17
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, undefined, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>, any>>;
83
18
  install(pluginManager: PluginManager): void;
84
19
  configure(pluginManager: PluginManager): void;
85
20
  }
86
21
  export { DisplayChromeOverlayProvider, DisplayUIProvider, FloatingLegend, TrackControlProvider, plainChromeOverlays, plainTrackControl, useTrackControlMenu, } from '@jbrowse/display-ui';
87
22
  export type { DisplayBackgroundProgressModel, DisplayChromeOverlays, DisplayErrorBarModel, DisplayLoadingOverlayModel, LegendItem, LegendSection, TooLargeMessageModel, TrackControlComponent, TrackControlIcon, TrackControlMenu, TrackControlOption, TrackControlProps, } from '@jbrowse/display-ui';
88
- export { HighlightBand, HighlightChip, type LinearGenomeViewModel, type LinearGenomeViewStateModel, OverviewHighlightBand, SVGHighlightBand, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.ts';
23
+ export { HighlightChip, type LinearGenomeViewModel, type LinearGenomeViewStateModel, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.ts';
89
24
  export { default as SearchBox } from './LinearGenomeView/components/SearchBox.tsx';
90
- export { default as HeaderSearchBoxes } from './LinearGenomeView/components/HeaderSearchBoxes.tsx';
91
25
  export { default as HeaderSearchBoxRow } from './LinearGenomeView/components/HeaderSearchBoxRow.tsx';
92
26
  export { searchBoxMenuItems, useSearchBoxPrefs, } from './LinearGenomeView/components/useSearchBoxPrefs.ts';
93
27
  export type { SearchBoxPrefs } from './LinearGenomeView/components/useSearchBoxPrefs.ts';
94
28
  export { normalizeTrackInit } from '@jbrowse/core/util/tracks';
95
- export { linearGenomeViewPropKeys, partitionLaunchKeys, } from './LinearGenomeView/initKeys.ts';
96
29
  export { applyInitHighlights } from './LinearGenomeView/afterAttach.ts';
97
- export { MultiLevelRubberband } from './MultiLevelRubberband/index.ts';
30
+ export { MultiLevelRubberband, multiLevelRowClickMenuItems, multiLevelRowMenuItems, rowLabels, } from './MultiLevelRubberband/index.ts';
98
31
  export { fetchResults, SearchResultsNotFoundError } from './searchUtils.ts';
99
32
  export type { LaunchLinearGenomeViewArgs } from './LaunchLinearGenomeView/index.ts';
100
- export type { BpOffset, ExportSvgOptions, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, VolatileGuide, } from './LinearGenomeView/types.ts';
33
+ export type { BpOffset, ExportSvgOptions, HighlightInput, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, ViewTrackLabelMode, VolatileGuide, } from './LinearGenomeView/types.ts';
101
34
  export type { ScalebarRefNameLabel } from './LinearGenomeView/util.ts';
35
+ export type { HighlightRegion } from './LinearGenomeView/model.ts';
102
36
  export type { RegionsOrientation } from './LinearGenomeView/util.ts';
37
+ export type { RegionEdit } from './LinearGenomeView/util.ts';
103
38
  export { makeTicks } from './LinearGenomeView/util.ts';
104
39
  export type { Tick } from './LinearGenomeView/util.ts';
40
+ export { containingLgv } from './LinearGenomeView/containingLgv.ts';
105
41
  export { showRegionsWithUndo } from './LinearGenomeView/showRegionsWithUndo.ts';
106
42
  export type { SharedFit } from './LinearGenomeView/sharedScaleContainer.ts';
107
43
  export { fitAllRegionsWindow } from './LinearGenomeView/util.ts';
108
44
  export { renderToSvg } from './LinearGenomeView/svgcomponents/SVGLinearGenomeView.tsx';
109
45
  export { useViewSvgFigure } from './LinearGenomeView/svgcomponents/useViewSvgFigure.tsx';
110
46
  export type { ViewSvgFigureOptions, ViewSvgFigureResult, } from './LinearGenomeView/svgcomponents/useViewSvgFigure.tsx';
111
- export { default as SVGTracks } from './LinearGenomeView/svgcomponents/SVGTracks.tsx';
112
- export { default as SVGView } from './LinearGenomeView/svgcomponents/SVGView.tsx';
113
- export { default as SVGRowHeader } from './LinearGenomeView/svgcomponents/SVGRowHeader.tsx';
114
- export { default as SVGHighlights } from './LinearGenomeView/svgcomponents/SVGHighlights.tsx';
115
- export { default as SVGHighlightsOverlay } from './LinearGenomeView/svgcomponents/SVGHighlightsOverlay.tsx';
47
+ export { default as SVGStackedRow } from './LinearGenomeView/svgcomponents/SVGStackedRow.tsx';
116
48
  export { default as ExportSvgDialog } from './LinearGenomeView/components/ExportSvgDialog.tsx';
117
49
  export { GetSequenceDialog } from './LinearGenomeView/lazyDialogs.ts';
118
50
  export { default as ConnectedHoverHighlight } from './LinearGenomeView/components/ConnectedHoverHighlight.tsx';
119
- export { default as HoverPositionHighlight } from './LinearGenomeView/components/HoverPositionHighlight.tsx';
120
- export { TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
121
- export { FloatingSvgOverlay } from './LinearGenomeView/FloatingSvgOverlay.tsx';
122
51
  export type { HoverHighlightPosition } from './LinearGenomeView/components/HoverPositionHighlight.tsx';
52
+ export { FloatingSvgOverlay, TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
123
53
  export { SvgChrome, SvgClipRect } from '@jbrowse/core/svg/SvgExport';
124
54
  export { svgSafeId } from '@jbrowse/core/svg/svgId';
125
55
  export { awaitSvgReady, awaitSvgRenders } from '@jbrowse/core/svg/svgReady';
126
56
  export type { SvgExportable } from '@jbrowse/core/svg/svgReady';
127
- export { defaultTextHeight, getRowHeaderLayout, labelBaselineFromTop, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.ts';
57
+ export { defaultTextHeight, getRowHeaderLayout, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.ts';
128
58
  export { notifySkippedSvgTracks } from '@jbrowse/core/svg/trackNames';
129
59
  export { renderViewTracks } from './LinearGenomeView/svgcomponents/renderViewTracks.ts';
130
60
  export type { SvgExportTrack, ViewTracksSvg, } from './LinearGenomeView/svgcomponents/renderViewTracks.ts';
package/esm/index.js CHANGED
@@ -1,24 +1,15 @@
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
7
  import FeatureTrackF from './FeatureTrack/index.js';
8
8
  import LaunchLinearGenomeViewF from './LaunchLinearGenomeView/index.js';
9
9
  import SequenceFeatureHoverHighlightExtensionF from './LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js';
10
10
  import LinearGenomeViewF from './LinearGenomeView/index.js';
11
- import { LinearGenomeView, SearchBox, ZoomControls, } from './lazyPluginExports.js';
12
11
  export default class LinearGenomeViewPlugin extends Plugin {
13
12
  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
13
  /**
23
14
  * #config LinearGenomeViewConfigSchema
24
15
  * #category root
@@ -28,16 +19,14 @@ export default class LinearGenomeViewPlugin extends Plugin {
28
19
  * #slot configuration.LinearGenomeViewPlugin.trackLabels
29
20
  * where a track's name is drawn: `offset` gives it its own line above the
30
21
  * 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
22
+ * space, `hidden` omits it. The view menu's "Track labels" submenu sets the
23
+ * same thing per session
33
24
  */
34
25
  trackLabels: {
35
26
  type: 'string',
36
27
  defaultValue: 'offset',
37
28
  model: types.enumeration('trackLabelOptions', [
38
- 'offset',
39
- 'overlapping',
40
- 'hidden',
29
+ ...VIEW_TRACK_LABEL_MODES,
41
30
  ]),
42
31
  },
43
32
  });
@@ -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,11 @@ 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
71
  export { applyInitHighlights } from './LinearGenomeView/afterAttach.js';
90
- export { MultiLevelRubberband } from './MultiLevelRubberband/index.js';
72
+ export { MultiLevelRubberband, multiLevelRowClickMenuItems, multiLevelRowMenuItems, rowLabels, } from './MultiLevelRubberband/index.js';
91
73
  export { fetchResults, SearchResultsNotFoundError } from './searchUtils.js';
92
74
  // The scalebar's grid, published because it is a contract other views draw
93
75
  // against rather than an internal of this one: the synteny view's location
@@ -99,6 +81,7 @@ export { makeTicks } from './LinearGenomeView/util.js';
99
81
  // The two halves of "show these regions instead": navigate the view you are
100
82
  // looking at, or seed a snapshot for a new one. A caller deriving either itself
101
83
  // lands on a viewport property the model no longer reads — see each for how.
84
+ export { containingLgv } from './LinearGenomeView/containingLgv.js';
102
85
  export { showRegionsWithUndo } from './LinearGenomeView/showRegionsWithUndo.js';
103
86
  export { fitAllRegionsWindow } from './LinearGenomeView/util.js';
104
87
  export { renderToSvg } from './LinearGenomeView/svgcomponents/SVGLinearGenomeView.js';
@@ -106,15 +89,10 @@ export { renderToSvg } from './LinearGenomeView/svgcomponents/SVGLinearGenomeVie
106
89
  // components mounted in a host's own page. See the file for the three pieces
107
90
  // between `renderToSvg` and inline JSX that each fail quietly.
108
91
  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';
92
+ export { default as SVGStackedRow } from './LinearGenomeView/svgcomponents/SVGStackedRow.js';
114
93
  export { default as ExportSvgDialog } from './LinearGenomeView/components/ExportSvgDialog.js';
115
94
  export { GetSequenceDialog } from './LinearGenomeView/lazyDialogs.js';
116
95
  export { default as ConnectedHoverHighlight } from './LinearGenomeView/components/ConnectedHoverHighlight.js';
117
- export { default as HoverPositionHighlight } from './LinearGenomeView/components/HoverPositionHighlight.js';
118
96
  // The overlay layer lives in `@jbrowse/display-ui` — a package rather than this
119
97
  // plugin, because `packages/tree-sidebar` needed it and had to depend on a
120
98
  // *plugin* to get it. Re-exported here, since every display already names it
@@ -125,14 +103,13 @@ export { default as HoverPositionHighlight } from './LinearGenomeView/components
125
103
  // mounts it, and so does an embedder mounting `RenderingComponent` directly —
126
104
  // who otherwise supplies no node at all and gets display chrome buried under
127
105
  // their own region masks.
128
- export { TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
129
- export { FloatingSvgOverlay } from './LinearGenomeView/FloatingSvgOverlay.js';
106
+ export { FloatingSvgOverlay, TrackOverlayContext, TrackOverlayPortal, TrackOverlaySlot, } from '@jbrowse/display-ui';
130
107
  export { SvgChrome, SvgClipRect } from '@jbrowse/core/svg/SvgExport';
131
108
  // for a display that hand-rolls a <clipPath> instead of using SvgClipRect (an
132
109
  // inset or non-rect clip); ids built from a trackId/refName need it
133
110
  export { svgSafeId } from '@jbrowse/core/svg/svgId';
134
111
  export { awaitSvgReady, awaitSvgRenders } from '@jbrowse/core/svg/svgReady';
135
- export { defaultTextHeight, getRowHeaderLayout, labelBaselineFromTop, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.js';
112
+ export { defaultTextHeight, getRowHeaderLayout, labelOffset, totalHeight, trackBoxHeight, trackBoxOffsets, trackLabelLeftOffset, } from './LinearGenomeView/svgcomponents/util.js';
136
113
  // Re-exported from core, where it moved so the circular view — which depends
137
114
  // on neither this plugin nor the LGV geometry around it — can send the same
138
115
  // notification. Kept on this plugin's surface because published plugins
@@ -4,7 +4,6 @@ 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
6
  import type { AssemblyHost, NotificationSink, TrackCatalog } from '@jbrowse/core/util';
7
- import type { StopToken } from '@jbrowse/core/util/stopToken';
8
7
  declare module '@jbrowse/core/PluginManager' {
9
8
  interface ExtensionPointRegistry {
10
9
  'LinearGenomeView-searchResultSelected': {
@@ -26,42 +25,52 @@ export declare function navigateToSelectedOption({ option, model, assemblyName,
26
25
  assemblyName: string;
27
26
  }): Promise<void>;
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;
35
- export declare function showSearchResults({ results, query, model, assemblyName, grow, }: {
33
+ }): BaseResult[];
34
+ export declare function showSearchResults({ results, query, model, assemblyName, grow, showHitTrack, }: {
36
35
  results: BaseResult[];
37
36
  query: string;
38
37
  model: LinearGenomeViewModel;
39
38
  assemblyName: string;
40
39
  grow?: number;
40
+ showHitTrack?: boolean;
41
41
  }): Promise<boolean>;
42
- export declare function navToOption({ option, model, assemblyName, grow, }: {
42
+ export declare function hitTrackToShow(result: BaseResult, session: TrackCatalog): string | undefined;
43
+ export declare function navToOption({ option, model, assemblyName, grow, showHitTrack, }: {
43
44
  model: LinearGenomeViewModel;
44
45
  option: BaseResult;
45
46
  assemblyName: string;
46
47
  grow?: number;
48
+ showHitTrack?: boolean;
47
49
  }): Promise<void>;
48
50
  export declare class SearchResultsNotFoundError extends Error {
49
51
  name: string;
50
52
  }
51
53
  export declare function notifySearchFailure(session: NotificationSink, e: unknown): void;
52
- export declare function handleSelectedRegion({ input, model, assemblyName, grow, }: {
54
+ export declare function handleSelectedRegion({ input, model, assemblyName, grow, showHitTrack, }: {
53
55
  input: string;
54
56
  model: LinearGenomeViewModel;
55
57
  assemblyName: string;
56
58
  grow?: number;
59
+ showHitTrack?: boolean;
57
60
  }): Promise<boolean>;
58
61
  export declare function checkRef(str: string, isRef: (name: string) => boolean): boolean;
59
- export declare function fetchResults({ queryString, searchType, assemblyName, textSearchManager, assembly, stopToken, }: {
62
+ interface SearchArgs {
60
63
  queryString: string;
61
64
  assemblyName: string;
62
65
  searchType?: SearchType;
63
66
  textSearchManager?: TextSearchManager;
64
67
  assembly?: Assembly;
65
- stopToken?: StopToken;
66
- }): Promise<BaseResult[]>;
68
+ signal?: AbortSignal;
69
+ }
70
+ export declare function fetchResults(args: SearchArgs): Promise<BaseResult[]>;
71
+ export declare function nameNotFound(input: string, assemblyName: string, { indexCount, failures }: {
72
+ indexCount: number;
73
+ failures: unknown[];
74
+ }): Error;
67
75
  export declare function splitLast(str: string, split: string): [string, string];
76
+ export {};