@jbrowse/plugin-linear-genome-view 2.7.1 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/BaseLinearDisplay/components/Tooltip.js +4 -2
  2. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +18 -11
  3. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +25 -2
  4. package/dist/BaseLinearDisplay/models/renderSvg.d.ts +1 -1
  5. package/dist/BaseLinearDisplay/models/renderSvg.js +2 -1
  6. package/dist/LinearBasicDisplay/model.d.ts +3 -1
  7. package/dist/LinearGenomeView/components/LinearGenomeView.js +29 -7
  8. package/dist/LinearGenomeView/components/OverviewRubberband.js +5 -2
  9. package/dist/LinearGenomeView/components/SearchBox.js +24 -23
  10. package/dist/LinearGenomeView/components/TrackLabelContainer.js +2 -2
  11. package/dist/LinearGenomeView/model.d.ts +7 -1
  12. package/dist/LinearGenomeView/model.js +30 -19
  13. package/dist/index.d.ts +52 -15
  14. package/dist/index.js +19 -0
  15. package/esm/BaseLinearDisplay/components/Tooltip.js +4 -2
  16. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +18 -11
  17. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +1 -1
  18. package/esm/BaseLinearDisplay/models/renderSvg.d.ts +1 -1
  19. package/esm/BaseLinearDisplay/models/renderSvg.js +1 -1
  20. package/esm/LinearBasicDisplay/model.d.ts +3 -1
  21. package/esm/LinearGenomeView/components/LinearGenomeView.js +29 -7
  22. package/esm/LinearGenomeView/components/OverviewRubberband.js +5 -2
  23. package/esm/LinearGenomeView/components/SearchBox.js +24 -23
  24. package/esm/LinearGenomeView/components/TrackLabelContainer.js +2 -2
  25. package/esm/LinearGenomeView/model.d.ts +7 -1
  26. package/esm/LinearGenomeView/model.js +30 -19
  27. package/esm/index.d.ts +52 -15
  28. package/esm/index.js +19 -0
  29. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -198,7 +198,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
198
198
  resizeHeight(distance: number): number;
199
199
  } & {
200
200
  featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
201
- featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
201
+ featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
202
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
203
+ */
202
204
  currStatsBpPerPx: number;
203
205
  } & {
204
206
  readonly currentBytesRequested: number;
@@ -401,7 +403,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
401
403
  resizeHeight(distance: number): number;
402
404
  } & {
403
405
  featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
404
- featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
406
+ featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
407
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
408
+ */
405
409
  currStatsBpPerPx: number;
406
410
  } & {
407
411
  readonly currentBytesRequested: number;
@@ -694,7 +698,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
694
698
  resizeHeight(distance: number): number;
695
699
  } & {
696
700
  featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
697
- featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
701
+ featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
702
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
703
+ */
698
704
  currStatsBpPerPx: number;
699
705
  } & {
700
706
  readonly currentBytesRequested: number;
@@ -894,9 +900,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
894
900
  hideHeaderOverview: boolean;
895
901
  hideNoTracksActive: boolean;
896
902
  trackSelectorType: string;
897
- trackLabels: string;
898
903
  showCenterLine: boolean;
899
904
  showCytobandsSetting: boolean;
905
+ trackLabels: string;
900
906
  showGridlines: boolean;
901
907
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
902
908
  width: number;
@@ -905,7 +911,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
905
911
  } & {
906
912
  setDisplayName(name: string): void;
907
913
  setWidth(newWidth: number): void;
908
- setMinimized(flag: boolean): void;
914
+ setMinimized(flag: boolean): void; /**
915
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
916
+ */
909
917
  } & {
910
918
  volatileWidth: number | undefined;
911
919
  minimumBlockWidth: number;
@@ -919,6 +927,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
919
927
  leftOffset: import("./LinearGenomeView").BpOffset | undefined;
920
928
  rightOffset: import("./LinearGenomeView").BpOffset | undefined;
921
929
  } & {
930
+ readonly trackLabelsSetting: any;
922
931
  readonly width: number;
923
932
  readonly interRegionPaddingWidth: number;
924
933
  readonly assemblyNames: string[];
@@ -1082,9 +1091,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1082
1091
  hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1083
1092
  hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1084
1093
  trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1085
- trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1086
1094
  showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
1087
1095
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
1096
+ trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1088
1097
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1089
1098
  }, {
1090
1099
  width: number;
@@ -1093,7 +1102,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1093
1102
  } & {
1094
1103
  setDisplayName(name: string): void;
1095
1104
  setWidth(newWidth: number): void;
1096
- setMinimized(flag: boolean): void;
1105
+ setMinimized(flag: boolean): void; /**
1106
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
1107
+ */
1097
1108
  } & {
1098
1109
  volatileWidth: number | undefined;
1099
1110
  minimumBlockWidth: number;
@@ -1107,6 +1118,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1107
1118
  leftOffset: import("./LinearGenomeView").BpOffset | undefined;
1108
1119
  rightOffset: import("./LinearGenomeView").BpOffset | undefined;
1109
1120
  } & {
1121
+ readonly trackLabelsSetting: any;
1110
1122
  readonly width: number;
1111
1123
  readonly interRegionPaddingWidth: number;
1112
1124
  readonly assemblyNames: string[];
@@ -1280,9 +1292,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1280
1292
  hideHeaderOverview: boolean;
1281
1293
  hideNoTracksActive: boolean;
1282
1294
  trackSelectorType: string;
1283
- trackLabels: string;
1284
1295
  showCenterLine: boolean;
1285
1296
  showCytobandsSetting: boolean;
1297
+ trackLabels: string;
1286
1298
  showGridlines: boolean;
1287
1299
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
1288
1300
  width: number;
@@ -1291,7 +1303,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1291
1303
  } & {
1292
1304
  setDisplayName(name: string): void;
1293
1305
  setWidth(newWidth: number): void;
1294
- setMinimized(flag: boolean): void;
1306
+ setMinimized(flag: boolean): void; /**
1307
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
1308
+ */
1295
1309
  } & {
1296
1310
  volatileWidth: number | undefined;
1297
1311
  minimumBlockWidth: number;
@@ -1305,6 +1319,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1305
1319
  leftOffset: import("./LinearGenomeView").BpOffset | undefined;
1306
1320
  rightOffset: import("./LinearGenomeView").BpOffset | undefined;
1307
1321
  } & {
1322
+ readonly trackLabelsSetting: any;
1308
1323
  readonly width: number;
1309
1324
  readonly interRegionPaddingWidth: number;
1310
1325
  readonly assemblyNames: string[];
@@ -1468,9 +1483,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1468
1483
  hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1469
1484
  hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1470
1485
  trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1471
- trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1472
1486
  showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
1473
1487
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
1488
+ trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1474
1489
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1475
1490
  }, {
1476
1491
  width: number;
@@ -1479,7 +1494,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1479
1494
  } & {
1480
1495
  setDisplayName(name: string): void;
1481
1496
  setWidth(newWidth: number): void;
1482
- setMinimized(flag: boolean): void;
1497
+ setMinimized(flag: boolean): void; /**
1498
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
1499
+ */
1483
1500
  } & {
1484
1501
  volatileWidth: number | undefined;
1485
1502
  minimumBlockWidth: number;
@@ -1493,6 +1510,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1493
1510
  leftOffset: import("./LinearGenomeView").BpOffset | undefined;
1494
1511
  rightOffset: import("./LinearGenomeView").BpOffset | undefined;
1495
1512
  } & {
1513
+ readonly trackLabelsSetting: any;
1496
1514
  readonly width: number;
1497
1515
  readonly interRegionPaddingWidth: number;
1498
1516
  readonly assemblyNames: string[];
@@ -1666,9 +1684,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1666
1684
  hideHeaderOverview: boolean;
1667
1685
  hideNoTracksActive: boolean;
1668
1686
  trackSelectorType: string;
1669
- trackLabels: string;
1670
1687
  showCenterLine: boolean;
1671
1688
  showCytobandsSetting: boolean;
1689
+ trackLabels: string;
1672
1690
  showGridlines: boolean;
1673
1691
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
1674
1692
  width: number;
@@ -1677,7 +1695,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1677
1695
  } & {
1678
1696
  setDisplayName(name: string): void;
1679
1697
  setWidth(newWidth: number): void;
1680
- setMinimized(flag: boolean): void;
1698
+ setMinimized(flag: boolean): void; /**
1699
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
1700
+ */
1681
1701
  } & {
1682
1702
  volatileWidth: number | undefined;
1683
1703
  minimumBlockWidth: number;
@@ -1691,6 +1711,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1691
1711
  leftOffset: import("./LinearGenomeView").BpOffset | undefined;
1692
1712
  rightOffset: import("./LinearGenomeView").BpOffset | undefined;
1693
1713
  } & {
1714
+ readonly trackLabelsSetting: any;
1694
1715
  readonly width: number;
1695
1716
  readonly interRegionPaddingWidth: number;
1696
1717
  readonly assemblyNames: string[];
@@ -1854,9 +1875,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1854
1875
  hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1855
1876
  hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1856
1877
  trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1857
- trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1858
1878
  showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
1859
1879
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
1880
+ trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1860
1881
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
1861
1882
  }, {
1862
1883
  width: number;
@@ -1865,7 +1886,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
1865
1886
  } & {
1866
1887
  setDisplayName(name: string): void;
1867
1888
  setWidth(newWidth: number): void;
1868
- setMinimized(flag: boolean): void;
1889
+ setMinimized(flag: boolean): void; /**
1890
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
1891
+ */
1869
1892
  } & {
1870
1893
  volatileWidth: number | undefined;
1871
1894
  minimumBlockWidth: number;
@@ -1879,6 +1902,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1879
1902
  leftOffset: import("./LinearGenomeView").BpOffset | undefined;
1880
1903
  rightOffset: import("./LinearGenomeView").BpOffset | undefined;
1881
1904
  } & {
1905
+ readonly trackLabelsSetting: any;
1882
1906
  readonly width: number;
1883
1907
  readonly interRegionPaddingWidth: number;
1884
1908
  readonly assemblyNames: string[];
@@ -2021,6 +2045,19 @@ export default class LinearGenomeViewPlugin extends Plugin {
2021
2045
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
2022
2046
  }) => import("react").JSX.Element;
2023
2047
  };
2048
+ /**
2049
+ * #config LinearGenomeViewConfigSchema
2050
+ */
2051
+ configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2052
+ /**
2053
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
2054
+ */
2055
+ trackLabels: {
2056
+ type: string;
2057
+ defaultValue: string;
2058
+ model: import("mobx-state-tree").ISimpleType<string>;
2059
+ };
2060
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
2024
2061
  install(pluginManager: PluginManager): void;
2025
2062
  configure(pluginManager: PluginManager): void;
2026
2063
  }
package/dist/index.js CHANGED
@@ -39,6 +39,8 @@ const LinearBasicDisplay_1 = __importDefault(require("./LinearBasicDisplay"));
39
39
  const FeatureTrack_1 = __importDefault(require("./FeatureTrack"));
40
40
  const BasicTrack_1 = __importDefault(require("./BasicTrack"));
41
41
  const LaunchLinearGenomeView_1 = __importDefault(require("./LaunchLinearGenomeView"));
42
+ const configuration_1 = require("@jbrowse/core/configuration");
43
+ const mobx_state_tree_1 = require("mobx-state-tree");
42
44
  class LinearGenomeViewPlugin extends Plugin_1.default {
43
45
  constructor() {
44
46
  super(...arguments);
@@ -51,6 +53,23 @@ class LinearGenomeViewPlugin extends Plugin_1.default {
51
53
  ZoomControls: LinearGenomeView_1.ZoomControls,
52
54
  LinearGenomeView: LinearGenomeView_1.LinearGenomeView,
53
55
  };
56
+ /**
57
+ * #config LinearGenomeViewConfigSchema
58
+ */
59
+ this.configurationSchema = (0, configuration_1.ConfigurationSchema)('LinearGenomeViewConfigSchema', {
60
+ /**
61
+ * #slot configuration.LinearGenomeViewPlugin.trackLabels
62
+ */
63
+ trackLabels: {
64
+ type: 'string',
65
+ defaultValue: 'overlapping',
66
+ model: mobx_state_tree_1.types.enumeration('trackLabelOptions', [
67
+ 'offset',
68
+ 'overlapping',
69
+ 'hidden',
70
+ ]),
71
+ },
72
+ });
54
73
  }
55
74
  install(pluginManager) {
56
75
  (0, FeatureTrack_1.default)(pluginManager);
@@ -28,7 +28,8 @@ const TooltipContents = React.forwardRef(function TooltipContents2({ message },
28
28
  return (React.createElement("div", { ref: ref }, React.isValidElement(message) ? (message) : message ? (React.createElement(SanitizedHTML, { html: String(message) })) : null));
29
29
  });
30
30
  const Tooltip = observer(({ model, clientMouseCoord, }) => {
31
- const { classes } = useStyles();
31
+ var _a, _b;
32
+ const { theme, classes } = useStyles();
32
33
  const { featureUnderMouse } = model;
33
34
  const [width, setWidth] = useState(0);
34
35
  const [popperElt, setPopperElt] = useState(null);
@@ -54,7 +55,8 @@ const Tooltip = observer(({ model, clientMouseCoord, }) => {
54
55
  const contents = featureUnderMouse
55
56
  ? getConf(model, 'mouseover', { feature: featureUnderMouse })
56
57
  : undefined;
57
- return featureUnderMouse && contents ? (React.createElement(Portal, null,
58
+ const popperTheme = (_a = theme === null || theme === void 0 ? void 0 : theme.components) === null || _a === void 0 ? void 0 : _a.MuiPopper;
59
+ return featureUnderMouse && contents ? (React.createElement(Portal, { container: (_b = popperTheme === null || popperTheme === void 0 ? void 0 : popperTheme.defaultProps) === null || _b === void 0 ? void 0 : _b.container },
58
60
  React.createElement("div", { ref: setPopperElt, className: classes.tooltip,
59
61
  // zIndex needed to go over widget drawer
60
62
  style: { ...styles.popper, zIndex: 100000 }, ...attributes.popper },
@@ -69,7 +69,11 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
69
69
  setMessage(messageText: string): void;
70
70
  setRendered(props: {
71
71
  reactElement: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
72
- features: Map<string, Feature>;
72
+ features: Map<string, Feature>; /**
73
+ * #getter
74
+ * a CompositeMap of `featureId -> feature obj` that
75
+ * just looks in all the block data for that feature
76
+ */
73
77
  layout: any;
74
78
  maxHeightReached: boolean;
75
79
  renderProps: any;
@@ -128,7 +132,9 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
128
132
  message: string | undefined;
129
133
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
130
134
  onHorizontalScroll?: Function | undefined;
131
- blockState?: Record<string, any> | undefined;
135
+ blockState?: Record<string, any> | undefined; /**
136
+ * #property
137
+ */
132
138
  }>;
133
139
  readonly DisplayBlurb: React.FC<{
134
140
  model: {
@@ -136,7 +142,9 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
136
142
  type: string;
137
143
  rpcDriverName: string | undefined;
138
144
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
139
- rendererTypeName: string;
145
+ rendererTypeName: string; /**
146
+ * #getter
147
+ */
140
148
  error: unknown;
141
149
  message: string | undefined;
142
150
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
@@ -144,9 +152,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
144
152
  type: import("mobx-state-tree").ISimpleType<string>;
145
153
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
146
154
  }, {
147
- rendererTypeName: string; /**
148
- * #getter
149
- */
155
+ rendererTypeName: string;
150
156
  error: unknown;
151
157
  message: string | undefined;
152
158
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
@@ -179,10 +185,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
179
185
  } & {
180
186
  readonly currentBytesRequested: number;
181
187
  readonly currentFeatureScreenDensity: number;
182
- readonly maxFeatureScreenDensity: any; /**
183
- * #property
184
- * updated via autorun
185
- */
188
+ readonly maxFeatureScreenDensity: any;
186
189
  readonly featureDensityStatsReady: boolean;
187
190
  readonly maxAllowableBytes: number;
188
191
  } & {
@@ -358,7 +361,11 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
358
361
  setMessage(messageText: string): void;
359
362
  setRendered(props: {
360
363
  reactElement: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
361
- features: Map<string, Feature>;
364
+ features: Map<string, Feature>; /**
365
+ * #getter
366
+ * a CompositeMap of `featureId -> feature obj` that
367
+ * just looks in all the block data for that feature
368
+ */
362
369
  layout: any;
363
370
  maxHeightReached: boolean;
364
371
  renderProps: any;
@@ -10,7 +10,6 @@ import MenuOpenIcon from '@mui/icons-material/MenuOpen';
10
10
  import { Tooltip } from '../components/BaseLinearDisplay';
11
11
  import BlockState from './serverSideRenderedBlock';
12
12
  import configSchema from './configSchema';
13
- import renderBaseLinearDisplaySvg from './renderSvg';
14
13
  import TrackHeightMixin from './TrackHeightMixin';
15
14
  import FeatureDensityMixin from './FeatureDensityMixin';
16
15
  /**
@@ -290,6 +289,7 @@ function stateModelFactory() {
290
289
  * #method
291
290
  */
292
291
  async renderSvg(opts) {
292
+ const { renderBaseLinearDisplaySvg } = await import('./renderSvg');
293
293
  return renderBaseLinearDisplaySvg(self, opts);
294
294
  },
295
295
  afterAttach() {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ThemeOptions } from '@mui/material';
3
3
  import { ExportSvgOptions } from '../../LinearGenomeView';
4
4
  import { BaseLinearDisplayModel } from './BaseLinearDisplayModel';
5
- export default function renderBaseLinearDisplaySvg(self: BaseLinearDisplayModel, opts: ExportSvgOptions & {
5
+ export declare function renderBaseLinearDisplaySvg(self: BaseLinearDisplayModel, opts: ExportSvgOptions & {
6
6
  overrideHeight: number;
7
7
  theme: ThemeOptions;
8
8
  }): Promise<React.JSX.Element>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { getContainingView, getViewParams, ReactRendering, } from '@jbrowse/core/util';
3
3
  import BlockState, { renderBlockData } from './serverSideRenderedBlock';
4
4
  import { getId } from './util';
5
- export default async function renderBaseLinearDisplaySvg(self, opts) {
5
+ export async function renderBaseLinearDisplaySvg(self, opts) {
6
6
  const { height, id } = self;
7
7
  const { overrideHeight } = opts;
8
8
  const view = getContainingView(self);
@@ -219,7 +219,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
219
219
  featureIdUnderMouse: string | undefined;
220
220
  contextMenuFeature: import("@jbrowse/core/util").Feature | undefined;
221
221
  } & {
222
- readonly blockType: "dynamicBlocks" | "staticBlocks";
222
+ readonly blockType: "dynamicBlocks" | "staticBlocks"; /**
223
+ * #getter
224
+ */
223
225
  readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
224
226
  } & {
225
227
  readonly renderDelay: number;
@@ -2,12 +2,12 @@ import React, { lazy, useEffect, useRef } from 'react';
2
2
  import { Button, Paper, Typography } from '@mui/material';
3
3
  import { makeStyles } from 'tss-react/mui';
4
4
  import { LoadingEllipses } from '@jbrowse/core/ui';
5
+ import { getSession } from '@jbrowse/core/util';
5
6
  import { observer } from 'mobx-react';
6
7
  // icons
7
8
  import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
8
9
  import TrackContainer from './TrackContainer';
9
10
  import TracksContainer from './TracksContainer';
10
- import { getSession } from '@jbrowse/core/util';
11
11
  const ImportForm = lazy(() => import('./ImportForm'));
12
12
  const useStyles = makeStyles()(theme => ({
13
13
  note: {
@@ -15,14 +15,28 @@ const useStyles = makeStyles()(theme => ({
15
15
  paddingTop: theme.spacing(1),
16
16
  paddingBottom: theme.spacing(1),
17
17
  },
18
+ rel: {
19
+ position: 'relative',
20
+ },
21
+ top: {
22
+ zIndex: 1000,
23
+ },
18
24
  }));
25
+ function NoTracksActive({ model }) {
26
+ const { classes } = useStyles();
27
+ const { hideNoTracksActive } = model;
28
+ return (React.createElement(Paper, { className: classes.note }, !hideNoTracksActive ? (React.createElement(React.Fragment, null,
29
+ React.createElement(Typography, null, "No tracks active."),
30
+ React.createElement(Button, { variant: "contained", color: "primary", onClick: () => model.activateTrackSelector(), className: classes.top, startIcon: React.createElement(TrackSelectorIcon, null) }, "Open track selector"))) : (React.createElement("div", { style: { height: '48px' } }))));
31
+ }
19
32
  const LinearGenomeView = observer(({ model }) => {
20
33
  const { tracks, error, initialized, hasDisplayedRegions } = model;
21
- const { classes } = useStyles();
22
34
  const ref = useRef(null);
23
35
  const session = getSession(model);
36
+ const { classes } = useStyles();
24
37
  useEffect(() => {
25
- // sets the focused view id based on a click within the LGV; necessary for subviews to be focused properly
38
+ // sets the focused view id based on a click within the LGV;
39
+ // necessary for subviews to be focused properly
26
40
  function handleSelectView(e) {
27
41
  var _a, _b;
28
42
  if (e.target instanceof Element && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
@@ -44,11 +58,19 @@ const LinearGenomeView = observer(({ model }) => {
44
58
  }
45
59
  const MiniControlsComponent = model.MiniControlsComponent();
46
60
  const HeaderComponent = model.HeaderComponent();
47
- return (React.createElement("div", { style: { position: 'relative' }, ref: ref },
61
+ return (React.createElement("div", { className: classes.rel, ref: ref, onMouseLeave: () => session.setHovered(undefined), onMouseMove: event => {
62
+ const c = ref.current;
63
+ if (!c) {
64
+ return;
65
+ }
66
+ const { tracks } = model;
67
+ const leftPx = event.clientX - c.getBoundingClientRect().left;
68
+ const hoverPosition = model.pxToBp(leftPx);
69
+ const hoverFeature = tracks.find(t => t.displays[0].featureUnderMouse);
70
+ session.setHovered({ hoverPosition, hoverFeature });
71
+ } },
48
72
  React.createElement(HeaderComponent, { model: model }),
49
73
  React.createElement(MiniControlsComponent, { model: model }),
50
- React.createElement(TracksContainer, { model: model }, !tracks.length ? (React.createElement(Paper, { variant: "outlined", className: classes.note }, !model.hideNoTracksActive ? (React.createElement(React.Fragment, null,
51
- React.createElement(Typography, null, "No tracks active."),
52
- React.createElement(Button, { variant: "contained", color: "primary", onClick: model.activateTrackSelector, style: { zIndex: 1000 }, startIcon: React.createElement(TrackSelectorIcon, null) }, "Open track selector"))) : (React.createElement("div", { style: { height: '48px' } })))) : (tracks.map(track => (React.createElement(TrackContainer, { key: track.id, model: model, track: track })))))));
74
+ React.createElement(TracksContainer, { model: model }, !tracks.length ? (React.createElement(NoTracksActive, { model: model })) : (tracks.map(track => (React.createElement(TrackContainer, { key: track.id, model: model, track: track })))))));
53
75
  });
54
76
  export default LinearGenomeView;
@@ -18,6 +18,9 @@ const useStyles = makeStyles()({
18
18
  position: 'absolute',
19
19
  zIndex: 10,
20
20
  },
21
+ rel: {
22
+ position: 'relative',
23
+ },
21
24
  });
22
25
  const HoverTooltip = observer(function ({ model, open, guideX, overview, }) {
23
26
  var _a;
@@ -103,7 +106,7 @@ const OverviewRubberband = observer(function OverviewRubberband({ model, overvie
103
106
  setGuideX(undefined);
104
107
  }
105
108
  if (startX === undefined) {
106
- return (React.createElement("div", { style: { position: 'relative' } },
109
+ return (React.createElement("div", { className: classes.rel },
107
110
  guideX !== undefined ? (React.createElement(HoverTooltip, { model: model, open: !mouseDragging, overview: overview, guideX: guideX })) : null,
108
111
  React.createElement("div", { className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
109
112
  }
@@ -124,7 +127,7 @@ const OverviewRubberband = observer(function OverviewRubberband({ model, overvie
124
127
  [leftBpOffset, rightBpOffset] = [rightBpOffset, leftBpOffset];
125
128
  }
126
129
  }
127
- return (React.createElement("div", { style: { position: 'relative' } },
130
+ return (React.createElement("div", { className: classes.rel },
128
131
  leftBpOffset && rightBpOffset ? (React.createElement(RubberbandSpan, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, width: Math.abs(width), left: left })) : null,
129
132
  React.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
130
133
  });
@@ -12,6 +12,11 @@ const useStyles = makeStyles()(() => ({
12
12
  minWidth: 100,
13
13
  },
14
14
  }));
15
+ function checkRef(str, allRefs) {
16
+ const [ref, rest] = splitLast(str, ':');
17
+ return (allRefs.includes(str) ||
18
+ (allRefs.includes(ref) && !Number.isNaN(Number.parseInt(rest, 10))));
19
+ }
15
20
  const SearchBox = observer(function ({ model, showHelp, }) {
16
21
  const { classes } = useStyles();
17
22
  const theme = useTheme();
@@ -39,38 +44,34 @@ const SearchBox = observer(function ({ model, showHelp, }) {
39
44
  async function handleSelectedRegion(option) {
40
45
  var _a;
41
46
  try {
47
+ const input = option.getLabel();
48
+ const allRefs = (assembly === null || assembly === void 0 ? void 0 : assembly.allRefNamesWithLowerCase) || [];
42
49
  if (option.hasLocation()) {
43
50
  await navToOption(option);
44
51
  }
45
52
  else if ((_a = option.results) === null || _a === void 0 ? void 0 : _a.length) {
46
53
  model.setSearchResults(option.results, option.getLabel());
47
54
  }
55
+ else if (input.split(' ').every(entry => checkRef(entry, allRefs))) {
56
+ await model.navToLocString(input, assemblyName);
57
+ }
48
58
  else {
49
- const input = option.getLabel();
50
- const [ref, rest] = splitLast(input, ':');
51
- const allRefs = (assembly === null || assembly === void 0 ? void 0 : assembly.allRefNamesWithLowerCase) || [];
52
- if (allRefs.includes(input) ||
53
- (allRefs.includes(ref) && !Number.isNaN(Number.parseInt(rest, 10)))) {
54
- await model.navToLocString(input, assemblyName);
59
+ const results = await fetchResults({
60
+ queryString: input,
61
+ searchType: 'exact',
62
+ searchScope,
63
+ rankSearchResults,
64
+ textSearchManager,
65
+ assembly,
66
+ });
67
+ if (results.length > 1) {
68
+ model.setSearchResults(results, input.toLowerCase());
69
+ }
70
+ else if (results.length === 1) {
71
+ await navToOption(results[0]);
55
72
  }
56
73
  else {
57
- const results = await fetchResults({
58
- queryString: input,
59
- searchType: 'exact',
60
- searchScope,
61
- rankSearchResults,
62
- textSearchManager,
63
- assembly,
64
- });
65
- if (results.length > 1) {
66
- model.setSearchResults(results, input.toLowerCase());
67
- }
68
- else if (results.length === 1) {
69
- await navToOption(results[0]);
70
- }
71
- else {
72
- await model.navToLocString(input, assemblyName);
73
- }
74
+ await model.navToLocString(input, assemblyName);
74
75
  }
75
76
  }
76
77
  }
@@ -18,9 +18,9 @@ const TrackLabelContainer = observer(function ({ track, view, }) {
18
18
  const { classes, cx } = useStyles();
19
19
  const display = track.displays[0];
20
20
  const { trackLabel, trackLabelOverlap, trackLabelOffset } = classes;
21
- const labelStyle = view.trackLabels !== 'overlapping' || display.prefersOffset
21
+ const labelStyle = view.trackLabelsSetting !== 'overlapping' || display.prefersOffset
22
22
  ? trackLabelOffset
23
23
  : trackLabelOverlap;
24
- return view.trackLabels !== 'hidden' ? (React.createElement(TrackLabel, { track: track, className: cx(trackLabel, labelStyle) })) : null;
24
+ return view.trackLabelsSetting !== 'hidden' ? (React.createElement(TrackLabel, { track: track, className: cx(trackLabel, labelStyle) })) : null;
25
25
  });
26
26
  export default TrackLabelContainer;
@@ -71,9 +71,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
71
71
  hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
72
72
  hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
73
73
  trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
74
- trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
75
74
  showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
76
75
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
76
+ trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
77
77
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
78
78
  }, {
79
79
  width: number;
@@ -96,6 +96,12 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
96
96
  leftOffset: BpOffset | undefined;
97
97
  rightOffset: BpOffset | undefined;
98
98
  } & {
99
+ /**
100
+ * #getter
101
+ * this is the effective value of the track labels setting, incorporating
102
+ * both the config and view state. use this instead of view.trackLabels
103
+ */
104
+ readonly trackLabelsSetting: any;
99
105
  /**
100
106
  * #getter
101
107
  */