@jbrowse/plugin-linear-genome-view 4.0.3 → 4.1.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 (74) hide show
  1. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +1 -0
  2. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +7 -3
  3. package/esm/BaseLinearDisplay/components/Tooltip.js +1 -1
  4. package/esm/BaseLinearDisplay/model.d.ts +9 -0
  5. package/esm/BaseLinearDisplay/model.js +4 -4
  6. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +5 -0
  7. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +11 -0
  8. package/esm/BaseLinearDisplay/util.d.ts +1 -0
  9. package/esm/BaseLinearDisplay/util.js +11 -1
  10. package/esm/LinearBareDisplay/model.d.ts +9 -0
  11. package/esm/LinearBasicDisplay/model.d.ts +26 -4
  12. package/esm/LinearBasicDisplay/model.js +25 -21
  13. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +1 -1
  14. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +6 -7
  15. package/esm/LinearFeatureDisplay/model.d.ts +18 -3
  16. package/esm/LinearFeatureDisplay/model.js +64 -24
  17. package/esm/LinearGenomeView/afterAttach.js +8 -2
  18. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  19. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  20. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +1 -1
  22. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +2 -2
  24. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +1 -1
  25. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +1 -1
  26. package/esm/LinearGenomeView/components/HeaderZoomControls.js +5 -5
  27. package/esm/LinearGenomeView/components/ImportForm.d.ts +1 -1
  28. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  30. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  31. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  32. package/esm/LinearGenomeView/components/MiniControls.js +3 -3
  33. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  34. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
  35. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +1 -1
  36. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +1 -1
  37. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +1 -1
  38. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +4 -2
  40. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  41. package/esm/LinearGenomeView/components/Rubberband.js +3 -3
  42. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  43. package/esm/LinearGenomeView/components/Scalebar.js +3 -4
  44. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  45. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  46. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +126 -4
  47. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  48. package/esm/LinearGenomeView/components/TrackLabel.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/TrackLabel.js +3 -4
  50. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +1 -1
  52. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  54. package/esm/LinearGenomeView/components/TracksContainer.js +2 -2
  55. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  56. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +2 -2
  57. package/esm/LinearGenomeView/components/useRangeSelect.js +28 -4
  58. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  59. package/esm/LinearGenomeView/index.d.ts +1 -0
  60. package/esm/LinearGenomeView/index.js +1 -0
  61. package/esm/LinearGenomeView/model.d.ts +14 -3
  62. package/esm/LinearGenomeView/model.js +52 -16
  63. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  64. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +1 -1
  65. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -1
  66. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  67. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +1 -1
  68. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  69. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +1 -1
  70. package/esm/LinearGenomeView/types.d.ts +9 -1
  71. package/esm/LinearGenomeView/util.d.ts +6 -2
  72. package/esm/LinearGenomeView/util.js +17 -18
  73. package/esm/index.d.ts +10 -0
  74. package/package.json +6 -5
@@ -95,7 +95,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
95
95
  trackDisplayMode: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
96
96
  trackMaxHeight: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<number>>;
97
97
  configuration: AnyConfigurationSchemaType;
98
- jexlFilters: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").ISimpleType<string>>>;
98
+ jexlFiltersSetting: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").ISimpleType<string>>>;
99
99
  }, {
100
100
  rendererTypeName: string;
101
101
  error: unknown;
@@ -143,6 +143,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
143
143
  }> | null;
144
144
  readonly adapterConfig: any;
145
145
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
146
+ readonly isMinimized: boolean;
146
147
  readonly parentDisplay: any;
147
148
  readonly effectiveRpcDriverName: any;
148
149
  } & {
@@ -199,6 +200,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
199
200
  }> | null;
200
201
  readonly adapterConfig: any;
201
202
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
203
+ readonly isMinimized: boolean;
202
204
  readonly parentDisplay: any;
203
205
  readonly effectiveRpcDriverName: any;
204
206
  } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IModelType<{
@@ -252,6 +254,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
252
254
  }> | null;
253
255
  readonly adapterConfig: any;
254
256
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
257
+ readonly isMinimized: boolean;
255
258
  readonly parentDisplay: any;
256
259
  readonly effectiveRpcDriverName: any;
257
260
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
@@ -533,6 +536,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
533
536
  }> | null;
534
537
  readonly adapterConfig: any;
535
538
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
539
+ readonly isMinimized: boolean;
536
540
  readonly parentDisplay: any;
537
541
  readonly effectiveRpcDriverName: any;
538
542
  } & {
@@ -589,6 +593,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
589
593
  }> | null;
590
594
  readonly adapterConfig: any;
591
595
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
596
+ readonly isMinimized: boolean;
592
597
  readonly parentDisplay: any;
593
598
  readonly effectiveRpcDriverName: any;
594
599
  } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IModelType<{
@@ -642,6 +647,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
642
647
  }> | null;
643
648
  readonly adapterConfig: any;
644
649
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
650
+ readonly isMinimized: boolean;
645
651
  readonly parentDisplay: any;
646
652
  readonly effectiveRpcDriverName: any;
647
653
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
@@ -868,6 +874,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
868
874
  }> | null;
869
875
  readonly adapterConfig: any;
870
876
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
877
+ readonly isMinimized: boolean;
871
878
  readonly parentDisplay: any;
872
879
  readonly effectiveRpcDriverName: any;
873
880
  } & {
@@ -924,6 +931,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
924
931
  }> | null;
925
932
  readonly adapterConfig: any;
926
933
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
934
+ readonly isMinimized: boolean;
927
935
  readonly parentDisplay: any;
928
936
  readonly effectiveRpcDriverName: any;
929
937
  } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IModelType<{
@@ -977,6 +985,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
977
985
  }> | null;
978
986
  readonly adapterConfig: any;
979
987
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
988
+ readonly isMinimized: boolean;
980
989
  readonly parentDisplay: any;
981
990
  readonly effectiveRpcDriverName: any;
982
991
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
@@ -1083,7 +1092,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
1083
1092
  } & {
1084
1093
  featureUnderMouseVolatile: Feature | undefined;
1085
1094
  } & {
1086
- readonly activeFilters: any;
1095
+ activeFilters(): string[];
1087
1096
  readonly rendererTypeName: any;
1088
1097
  readonly sequenceAdapter: any;
1089
1098
  readonly showLabels: any;
@@ -1171,6 +1180,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
1171
1180
  }> | null;
1172
1181
  readonly adapterConfig: any;
1173
1182
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
1183
+ readonly isMinimized: boolean;
1174
1184
  readonly parentDisplay: any;
1175
1185
  readonly effectiveRpcDriverName: any;
1176
1186
  } & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IModelType<{
@@ -1224,11 +1234,16 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
1224
1234
  }> | null;
1225
1235
  readonly adapterConfig: any;
1226
1236
  readonly parentTrack: import("@jbrowse/core/util").AbstractTrackModel;
1237
+ readonly isMinimized: boolean;
1227
1238
  readonly parentDisplay: any;
1228
1239
  readonly effectiveRpcDriverName: any;
1229
1240
  }, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
1230
1241
  };
1242
+ filterMenuItems(): MenuItem[];
1243
+ } & {
1231
1244
  trackMenuItems(): MenuItem[];
1245
+ } & {
1246
+ afterAttach(): void;
1232
1247
  }, {
1233
1248
  type: string;
1234
1249
  } & Partial<import("@jbrowse/mobx-state-tree/dist/internal").ExtractCFromProps<{
@@ -1408,7 +1423,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
1408
1423
  trackDisplayMode: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
1409
1424
  trackMaxHeight: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<number>>;
1410
1425
  configuration: AnyConfigurationSchemaType;
1411
- jexlFilters: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").ISimpleType<string>>>;
1426
+ jexlFiltersSetting: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").ISimpleType<string>>>;
1412
1427
  }>>;
1413
1428
  export type LinearFeatureDisplayStateModel = ReturnType<typeof stateModelFactory>;
1414
1429
  export type LinearFeatureDisplayModel = Instance<LinearFeatureDisplayStateModel>;
@@ -3,8 +3,10 @@ import { ConfigurationReference, getConf, readConfObject, } from '@jbrowse/core/
3
3
  import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
4
4
  import { SimpleFeature, getSession } from '@jbrowse/core/util';
5
5
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
6
- import { cast, getParent, isAlive, types } from '@jbrowse/mobx-state-tree';
6
+ import { addDisposer, cast, getParent, isAlive, types, } from '@jbrowse/mobx-state-tree';
7
+ import ClearAllIcon from '@mui/icons-material/ClearAll';
7
8
  import VisibilityIcon from '@mui/icons-material/Visibility';
9
+ import { reaction, toJS } from 'mobx';
8
10
  import { BaseLinearDisplay } from "../BaseLinearDisplay/index.js";
9
11
  const SetMaxHeightDialog = lazy(() => import("./components/SetMaxHeightDialog.js"));
10
12
  const AddFiltersDialog = lazy(() => import("./components/AddFiltersDialog.js"));
@@ -17,14 +19,14 @@ function stateModelFactory(configSchema) {
17
19
  trackDisplayMode: types.maybe(types.string),
18
20
  trackMaxHeight: types.maybe(types.number),
19
21
  configuration: ConfigurationReference(configSchema),
20
- jexlFilters: types.maybe(types.array(types.string)),
22
+ jexlFiltersSetting: types.maybe(types.array(types.string)),
21
23
  }))
22
24
  .volatile(() => ({
23
25
  featureUnderMouseVolatile: undefined,
24
26
  }))
25
27
  .views(self => ({
26
- get activeFilters() {
27
- return (self.jexlFilters ??
28
+ activeFilters() {
29
+ return (toJS(self.jexlFiltersSetting) ??
28
30
  getConf(self, 'jexlFilters').map((r) => `jexl:${r}`));
29
31
  },
30
32
  get rendererTypeName() {
@@ -66,7 +68,7 @@ function stateModelFactory(configSchema) {
66
68
  }))
67
69
  .actions(self => ({
68
70
  setJexlFilters(f) {
69
- self.jexlFilters = cast(f);
71
+ self.jexlFiltersSetting = cast(f);
70
72
  },
71
73
  setFeatureUnderMouse(feat) {
72
74
  self.featureUnderMouseVolatile = feat;
@@ -90,7 +92,7 @@ function stateModelFactory(configSchema) {
90
92
  },
91
93
  }))
92
94
  .views(self => {
93
- const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, renderingProps: superRenderingProps, } = self;
95
+ const { renderProps: superRenderProps, renderingProps: superRenderingProps, } = self;
94
96
  return {
95
97
  renderProps() {
96
98
  const superProps = superRenderProps();
@@ -98,7 +100,7 @@ function stateModelFactory(configSchema) {
98
100
  ...superProps,
99
101
  config: self.rendererConfig,
100
102
  filters: new SerializableFilterChain({
101
- filters: self.activeFilters,
103
+ filters: self.activeFilters(),
102
104
  }),
103
105
  sequenceAdapter: self.sequenceAdapter,
104
106
  };
@@ -162,6 +164,27 @@ function stateModelFactory(configSchema) {
162
164
  },
163
165
  };
164
166
  },
167
+ filterMenuItems() {
168
+ return [
169
+ {
170
+ label: 'Edit filters...',
171
+ onClick: () => {
172
+ getSession(self).queueDialog(handleClose => [
173
+ AddFiltersDialog,
174
+ {
175
+ model: self,
176
+ handleClose,
177
+ },
178
+ ]);
179
+ },
180
+ },
181
+ ];
182
+ },
183
+ };
184
+ })
185
+ .views(self => {
186
+ const { trackMenuItems: superTrackMenuItems } = self;
187
+ return {
165
188
  trackMenuItems() {
166
189
  return [
167
190
  ...superTrackMenuItems(),
@@ -225,31 +248,48 @@ function stateModelFactory(configSchema) {
225
248
  },
226
249
  },
227
250
  {
228
- label: 'Filters',
229
- subMenu: [
230
- {
231
- label: 'Edit filters...',
232
- onClick: () => {
233
- getSession(self).queueDialog(handleClose => [
234
- AddFiltersDialog,
235
- {
236
- model: self,
237
- handleClose,
238
- },
239
- ]);
240
- },
241
- },
242
- ],
251
+ label: 'Filter by...',
252
+ icon: ClearAllIcon,
253
+ subMenu: self.filterMenuItems(),
243
254
  },
244
255
  ];
245
256
  },
246
257
  };
247
258
  })
259
+ .actions(self => ({
260
+ afterAttach() {
261
+ addDisposer(self, reaction(() => self.featureIdUnderMouse, async (featureId) => {
262
+ if (!featureId) {
263
+ self.setFeatureUnderMouse(undefined);
264
+ return;
265
+ }
266
+ const session = getSession(self);
267
+ const { rpcManager } = session;
268
+ const { parentTrack } = self;
269
+ try {
270
+ const sessionId = getRpcSessionId(self);
271
+ const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
272
+ featureId,
273
+ sessionId,
274
+ trackInstanceId: parentTrack.id,
275
+ rendererType: self.rendererTypeName,
276
+ }));
277
+ if (isAlive(self) &&
278
+ feature &&
279
+ self.featureIdUnderMouse === featureId) {
280
+ self.setFeatureUnderMouse(new SimpleFeature(feature));
281
+ }
282
+ }
283
+ catch (e) {
284
+ }
285
+ }, { delay: 50, name: 'LinearFeatureDisplayMouseoverReaction' }));
286
+ },
287
+ }))
248
288
  .postProcessSnapshot(snap => {
249
289
  if (!snap) {
250
290
  return snap;
251
291
  }
252
- const { trackShowLabels, trackShowDescriptions, trackDisplayMode, trackMaxHeight, jexlFilters, ...rest } = snap;
292
+ const { trackShowLabels, trackShowDescriptions, trackDisplayMode, trackMaxHeight, jexlFiltersSetting, ...rest } = snap;
253
293
  return {
254
294
  ...rest,
255
295
  ...(trackShowLabels !== undefined ? { trackShowLabels } : {}),
@@ -258,7 +298,7 @@ function stateModelFactory(configSchema) {
258
298
  : {}),
259
299
  ...(trackDisplayMode !== undefined ? { trackDisplayMode } : {}),
260
300
  ...(trackMaxHeight !== undefined ? { trackMaxHeight } : {}),
261
- ...(jexlFilters?.length ? { jexlFilters } : {}),
301
+ ...(jexlFiltersSetting?.length ? { jexlFiltersSetting } : {}),
262
302
  };
263
303
  });
264
304
  }
@@ -34,11 +34,17 @@ export function setupInitAutorun(self) {
34
34
  const idsNotFound = [];
35
35
  for (const t of init.tracks) {
36
36
  try {
37
- self.showTrack(t);
37
+ if (typeof t === 'string') {
38
+ self.showTrack(t);
39
+ }
40
+ else {
41
+ self.showTrack(t.trackId, t.trackSnapshot ?? {}, t.displaySnapshot ?? {});
42
+ }
38
43
  }
39
44
  catch (e) {
45
+ const trackId = typeof t === 'string' ? t : t.trackId;
40
46
  if (/Could not resolve identifier/.exec(`${e}`)) {
41
- idsNotFound.push(t);
47
+ idsNotFound.push(trackId);
42
48
  }
43
49
  else {
44
50
  throw e;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const CenterLine: ({ model }: {
4
4
  model: LGV;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const Gridlines: ({ model, offset, }: {
4
4
  model: LGV;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const LinearGenomeViewHeader: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  export default function HeaderPanControls({ model }: {
4
4
  model: LGV;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const HeaderRegionWidth: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,7 @@ const useStyles = makeStyles()({
12
12
  });
13
13
  const HeaderRegionWidth = observer(function HeaderRegionWidth({ model, }) {
14
14
  const { classes } = useStyles();
15
- const { coarseTotalBpDisplayStr } = model;
16
- return (_jsx(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: coarseTotalBpDisplayStr }));
15
+ const { effectiveTotalBpDisplayStr } = model;
16
+ return (_jsx(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: effectiveTotalBpDisplayStr }));
17
17
  });
18
18
  export default HeaderRegionWidth;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const HeaderTrackSelectorButton: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const HeaderZoomControls: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -26,13 +26,13 @@ function ValueLabelComponent(props) {
26
26
  }
27
27
  const HeaderZoomControls = observer(function HeaderZoomControls({ model, }) {
28
28
  const { classes } = useStyles();
29
- const { width, maxBpPerPx, minBpPerPx, bpPerPx } = model;
29
+ const { width, maxBpPerPx, minBpPerPx, bpPerPx, effectiveBpPerPx } = model;
30
30
  const [value, setValue] = useState(-Math.log2(bpPerPx) * 100);
31
31
  useEffect(() => {
32
- setValue(-Math.log2(bpPerPx) * 100);
33
- }, [bpPerPx]);
34
- const zoomInDisabled = bpPerPx <= minBpPerPx + 0.0001;
35
- const zoomOutDisabled = bpPerPx >= maxBpPerPx - 0.0001;
32
+ setValue(-Math.log2(effectiveBpPerPx) * 100);
33
+ }, [effectiveBpPerPx]);
34
+ const zoomInDisabled = effectiveBpPerPx <= minBpPerPx + 0.0001;
35
+ const zoomOutDisabled = effectiveBpPerPx >= maxBpPerPx - 0.0001;
36
36
  return (_jsxs("div", { className: classes.container, children: [_jsx(Tooltip, { title: "Zoom out 2x", children: _jsx("span", { children: _jsx(IconButton, { "data-testid": "zoom_out", disabled: zoomOutDisabled, onClick: () => {
37
37
  model.zoom(bpPerPx * 2);
38
38
  }, children: _jsx(ZoomOut, {}) }) }) }), _jsx(Slider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChangeCommitted: () => model.zoomTo(2 ** (-value / 100)), valueLabelDisplay: "auto", valueLabelFormat: newValue => `Window size: ${getBpDisplayStr(2 ** (-newValue / 100) * width)}`, slots: {
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const LinearGenomeViewImportForm: ({ model }: {
4
4
  model: LGV;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  import type BaseResult from '@jbrowse/core/TextSearch/BaseResults';
3
3
  type LGV = LinearGenomeViewModel;
4
4
  declare const ImportFormRefNameAutocomplete: ({ model, selectedAsm, value, setValue, setOption, }: {
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const LinearGenomeView: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const LinearGenomeViewContainer: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const MiniControls: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element | null;
@@ -20,12 +20,12 @@ const useStyles = makeStyles()(theme => ({
20
20
  }));
21
21
  const MiniControls = observer(function MiniControls({ model, }) {
22
22
  const { classes } = useStyles();
23
- const { id, bpPerPx, maxBpPerPx, minBpPerPx, hideHeader } = model;
23
+ const { id, bpPerPx, maxBpPerPx, minBpPerPx, hideHeader, effectiveBpPerPx } = model;
24
24
  const { focusedViewId } = getSession(model);
25
25
  return hideHeader ? (_jsx(Paper, { className: classes.background, children: _jsxs(Paper, { className: focusedViewId === id ? classes.focusedBackground : undefined, children: [_jsx(CascadingMenuButton, { menuItems: () => model.menuItems(), children: _jsx(ArrowDown, { fontSize: "small" }) }), _jsx(IconButton, { "data-testid": "zoom_out", onClick: () => {
26
26
  model.zoom(bpPerPx * 2);
27
- }, disabled: bpPerPx >= maxBpPerPx - 0.0001, children: _jsx(ZoomOut, { fontSize: "small" }) }), _jsx(IconButton, { "data-testid": "zoom_in", onClick: () => {
27
+ }, disabled: effectiveBpPerPx >= maxBpPerPx - 0.0001, children: _jsx(ZoomOut, { fontSize: "small" }) }), _jsx(IconButton, { "data-testid": "zoom_in", onClick: () => {
28
28
  model.zoom(bpPerPx / 2);
29
- }, disabled: bpPerPx <= minBpPerPx + 0.0001, children: _jsx(ZoomIn, { fontSize: "small" }) })] }) })) : null;
29
+ }, disabled: effectiveBpPerPx <= minBpPerPx + 0.0001, children: _jsx(ZoomIn, { fontSize: "small" }) })] }) })) : null;
30
30
  });
31
31
  export default MiniControls;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const NoTracksActiveButton: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
3
3
  type LGV = LinearGenomeViewModel;
4
4
  declare const OverviewRubberband: ({ model, overview, ControlComponent, }: {
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
3
3
  type LGV = LinearGenomeViewModel;
4
4
  declare const OverviewRubberbandHoverTooltip: ({ model, open, guideX, overview, }: {
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const OverviewScalebar: ({ model, children, }: {
4
4
  model: LGV;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
3
3
  declare const OverviewScalebarPolygon: ({ model, overview, useOffset, }: {
4
4
  model: LinearGenomeViewModel;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
3
3
  import type { ContentBlock } from '@jbrowse/core/util/blockTypes';
4
4
  declare const OverviewScalebarTickLabels: ({ block, scale, overview, model, }: {
@@ -2,11 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TextField } from '@mui/material';
3
3
  export default function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, setInputValue, setCurrentSearch, }) {
4
4
  const { helperText, slotProps = {} } = TextFieldProps;
5
+ const { ref: inputRef, ...restInputProps } = params.InputProps;
6
+ const { InputProps: _InputProps, ...restParams } = params;
5
7
  return (_jsx(TextField, { onBlur: () => {
6
8
  setInputValue(inputBoxVal);
7
- }, ...params, ...TextFieldProps, size: "small", helperText: helperText, slotProps: {
9
+ }, ...restParams, ...TextFieldProps, inputRef: inputRef, size: "small", helperText: helperText, slotProps: {
8
10
  input: {
9
- ...params.InputProps,
11
+ ...restInputProps,
10
12
  ...slotProps.input,
11
13
  },
12
14
  }, placeholder: "Search for location", onChange: e => {
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const Rubberband: ({ model, ControlComponent, }: {
4
4
  model: LGV;
@@ -17,10 +17,10 @@ const useStyles = makeStyles()({
17
17
  const Rubberband = observer(function Rubberband({ model, ControlComponent = _jsx("div", {}), }) {
18
18
  const ref = useRef(null);
19
19
  const { classes } = useStyles();
20
- const { stickyViewHeaders, rubberbandTop } = model;
20
+ const { stickyViewHeaders, rubberbandTop, isScalebarRefNameMenuOpen } = model;
21
21
  const { guideX, rubberbandOn, leftBpOffset, rightBpOffset, numOfBpSelected, width, left, anchorPosition, open, isClick, clickBpOffset, handleMenuItemClick, handleClose, mouseMove, mouseDown, mouseOut, } = useRangeSelect(ref, model);
22
- return (_jsxs(_Fragment, { children: [guideX !== undefined ? (_jsx(VerticalGuide, { model: model, coordX: guideX })) : rubberbandOn ? (_jsx(RubberbandSpan, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, numOfBpSelected: numOfBpSelected, width: width, left: left, top: rubberbandTop, sticky: stickyViewHeaders })) : null, anchorPosition ? (_jsx(Menu, { anchorReference: "anchorPosition", anchorPosition: {
23
- left: anchorPosition.clientX,
22
+ return (_jsxs(_Fragment, { children: [guideX !== undefined && !isScalebarRefNameMenuOpen ? (_jsx(VerticalGuide, { model: model, coordX: guideX })) : rubberbandOn ? (_jsx(RubberbandSpan, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, numOfBpSelected: numOfBpSelected, width: width, left: left, top: rubberbandTop, sticky: stickyViewHeaders })) : null, anchorPosition ? (_jsx(Menu, { anchorReference: "anchorPosition", anchorPosition: {
23
+ left: anchorPosition.clientX + 10,
24
24
  top: anchorPosition.clientY,
25
25
  }, onMenuItemClick: handleMenuItemClick, open: open, onClose: handleClose, menuItems: isClick && clickBpOffset
26
26
  ? model.rubberbandClickMenuItems(clickBpOffset)
@@ -1,10 +1,10 @@
1
1
  import type React from 'react';
2
- import type { LinearGenomeViewModel } from '..';
2
+ import type { LinearGenomeViewModel } from '../index.ts';
3
3
  type LGV = LinearGenomeViewModel;
4
4
  interface ScalebarProps {
5
5
  model: LGV;
6
6
  style?: React.CSSProperties;
7
7
  className?: string;
8
8
  }
9
- declare const Scalebar: React.ForwardRefExoticComponent<ScalebarProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const Scalebar: ({ model, style, className, ...other }: ScalebarProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export default Scalebar;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
2
  import { cx, makeStyles } from '@jbrowse/core/util/tss-react';
4
3
  import { Paper } from '@mui/material';
5
4
  import { observer } from 'mobx-react';
@@ -20,14 +19,14 @@ const useStyles = makeStyles()({
20
19
  pointerEvents: 'none',
21
20
  },
22
21
  });
23
- const Scalebar = observer(forwardRef(function Scalebar2({ model, style, className, ...other }, ref) {
22
+ const Scalebar = observer(function Scalebar({ model, style, className, ...other }) {
24
23
  const { classes } = useStyles();
25
24
  const { scaleFactor, staticBlocks, offsetPx } = model;
26
- return (_jsxs(Paper, { "data-resizer": "true", className: cx(classes.container, className), variant: "outlined", ref: ref, style: { ...style, '--offset-px': `${offsetPx}px` }, ...other, children: [_jsx(Gridlines, { model: model, offset: 1 }), _jsx("div", { className: classes.zoomContainer, style: {
25
+ return (_jsxs(Paper, { "data-resizer": "true", className: cx(classes.container, className), variant: "outlined", style: { ...style, '--offset-px': `${offsetPx}px` }, ...other, children: [_jsx(Gridlines, { model: model, offset: 1 }), _jsx("div", { className: classes.zoomContainer, style: {
27
26
  transform: scaleFactor !== 1 ? `scaleX(${scaleFactor})` : undefined,
28
27
  }, children: _jsx("div", { className: classes.scalebar, style: {
29
28
  transform: `translateX(calc(${staticBlocks.offsetPx}px - var(--offset-px) - 1px))`,
30
29
  width: staticBlocks.totalWidthPx,
31
30
  }, children: _jsx(ScalebarCoordinateLabels, { model: model }) }) }), _jsx(ScalebarRefNameLabels, { model: model })] }));
32
- }));
31
+ });
33
32
  export default Scalebar;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const ScalebarCoordinateLabels: ({ model, }: {
4
4
  model: LGV;
@@ -1,4 +1,4 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const ScalebarRefNameLabels: ({ model, }: {
4
4
  model: LGV;