@jbrowse/plugin-linear-genome-view 3.6.4 → 3.7.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 (69) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -1
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +3 -18
  3. package/dist/BaseLinearDisplay/components/BlockMsg.js +2 -0
  4. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -5
  5. package/dist/BaseLinearDisplay/components/LinearBlocks.js +5 -38
  6. package/dist/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +3 -0
  7. package/dist/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +27 -0
  8. package/dist/BaseLinearDisplay/components/MenuPage.d.ts +8 -0
  9. package/dist/BaseLinearDisplay/components/MenuPage.js +26 -0
  10. package/dist/BaseLinearDisplay/components/RenderedBlocks.d.ts +9 -0
  11. package/dist/BaseLinearDisplay/components/RenderedBlocks.js +27 -0
  12. package/dist/BaseLinearDisplay/components/Tooltip.d.ts +1 -0
  13. package/dist/BaseLinearDisplay/components/Tooltip.js +5 -2
  14. package/dist/BaseLinearDisplay/components/types.d.ts +1 -0
  15. package/dist/BaseLinearDisplay/components/types.js +2 -0
  16. package/dist/BaseLinearDisplay/index.d.ts +2 -2
  17. package/dist/BaseLinearDisplay/index.js +2 -2
  18. package/dist/BaseLinearDisplay/{models/BaseLinearDisplayModel.d.ts → model.d.ts} +17 -4
  19. package/dist/BaseLinearDisplay/{models/BaseLinearDisplayModel.js → model.js} +22 -7
  20. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +1 -1
  21. package/dist/BaseLinearDisplay/models/configSchema.js +2 -2
  22. package/dist/BaseLinearDisplay/models/renderSvg.d.ts +1 -1
  23. package/dist/LinearBareDisplay/model.d.ts +17 -2
  24. package/dist/LinearBasicDisplay/model.d.ts +17 -2
  25. package/dist/LinearGenomeView/components/Cytobands.js +2 -0
  26. package/dist/LinearGenomeView/components/RegionWidthEditorDialog.js +1 -1
  27. package/dist/LinearGenomeView/components/SequenceSearchDialog.js +1 -1
  28. package/dist/LinearGenomeView/components/TrackContainer.js +7 -3
  29. package/dist/LinearGenomeView/components/TrackLabelMenu.js +1 -1
  30. package/dist/LinearGenomeView/components/useRangeSelect.js +10 -14
  31. package/dist/LinearGenomeView/model.d.ts +2 -2
  32. package/dist/LinearGenomeView/model.js +2 -2
  33. package/dist/LinearGenomeView/util.js +1 -1
  34. package/dist/index.d.ts +17 -2
  35. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -1
  36. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +3 -18
  37. package/esm/BaseLinearDisplay/components/BlockMsg.js +2 -0
  38. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -5
  39. package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -37
  40. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +3 -0
  41. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +24 -0
  42. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +8 -0
  43. package/esm/BaseLinearDisplay/components/MenuPage.js +24 -0
  44. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +9 -0
  45. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +22 -0
  46. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +1 -0
  47. package/esm/BaseLinearDisplay/components/Tooltip.js +5 -2
  48. package/esm/BaseLinearDisplay/components/types.d.ts +1 -0
  49. package/esm/BaseLinearDisplay/components/types.js +1 -0
  50. package/esm/BaseLinearDisplay/index.d.ts +2 -2
  51. package/esm/BaseLinearDisplay/index.js +1 -1
  52. package/esm/BaseLinearDisplay/{models/BaseLinearDisplayModel.d.ts → model.d.ts} +17 -4
  53. package/esm/BaseLinearDisplay/{models/BaseLinearDisplayModel.js → model.js} +22 -7
  54. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +1 -1
  55. package/esm/BaseLinearDisplay/models/configSchema.js +2 -2
  56. package/esm/BaseLinearDisplay/models/renderSvg.d.ts +1 -1
  57. package/esm/LinearBareDisplay/model.d.ts +17 -2
  58. package/esm/LinearBasicDisplay/model.d.ts +17 -2
  59. package/esm/LinearGenomeView/components/Cytobands.js +2 -0
  60. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +1 -1
  61. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +1 -1
  62. package/esm/LinearGenomeView/components/TrackContainer.js +7 -3
  63. package/esm/LinearGenomeView/components/TrackLabelMenu.js +1 -1
  64. package/esm/LinearGenomeView/components/useRangeSelect.js +11 -15
  65. package/esm/LinearGenomeView/model.d.ts +2 -2
  66. package/esm/LinearGenomeView/model.js +2 -2
  67. package/esm/LinearGenomeView/util.js +1 -1
  68. package/esm/index.d.ts +17 -2
  69. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import type { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel';
1
+ import type { BaseLinearDisplayModel } from '../model';
2
2
  declare const BaseLinearDisplay: (props: {
3
3
  model: BaseLinearDisplayModel;
4
4
  children?: React.ReactNode;
@@ -7,10 +7,10 @@ exports.BlockMsg = exports.Tooltip = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const configuration_1 = require("@jbrowse/core/configuration");
10
- const ui_1 = require("@jbrowse/core/ui");
11
10
  const mobx_react_1 = require("mobx-react");
12
11
  const mui_1 = require("tss-react/mui");
13
12
  const LinearBlocks_1 = __importDefault(require("./LinearBlocks"));
13
+ const MenuPage_1 = __importDefault(require("./MenuPage"));
14
14
  const useStyles = (0, mui_1.makeStyles)()({
15
15
  display: {
16
16
  position: 'relative',
@@ -29,8 +29,6 @@ const BaseLinearDisplay = (0, mobx_react_1.observer)(function (props) {
29
29
  const [contextCoord, setContextCoord] = (0, react_1.useState)();
30
30
  const { model, children } = props;
31
31
  const { TooltipComponent, DisplayMessageComponent, height } = model;
32
- const items = model.contextMenuItems();
33
- const open = Boolean(contextCoord) && items.length > 0;
34
32
  return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, "data-testid": `display-${(0, configuration_1.getConf)(model, 'displayId')}`, className: classes.display, onContextMenu: event => {
35
33
  event.preventDefault();
36
34
  if (contextCoord) {
@@ -48,22 +46,9 @@ const BaseLinearDisplay = (0, mobx_react_1.observer)(function (props) {
48
46
  setOffsetMouseCoord([event.clientX - left, event.clientY - top]);
49
47
  setClientMouseCoord([event.clientX, event.clientY]);
50
48
  setClientRect(rect);
51
- }, children: [DisplayMessageComponent ? ((0, jsx_runtime_1.jsx)(DisplayMessageComponent, { model: model })) : ((0, jsx_runtime_1.jsx)(LinearBlocks_1.default, { ...props })), children, (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(TooltipComponent, { model: model, height: height, offsetMouseCoord: offsetMouseCoord, clientMouseCoord: clientMouseCoord, clientRect: clientRect, mouseCoord: offsetMouseCoord }) }), open ? ((0, jsx_runtime_1.jsx)(ui_1.Menu, { open: true, onMenuItemClick: (_, callback) => {
52
- callback();
49
+ }, children: [DisplayMessageComponent ? ((0, jsx_runtime_1.jsx)(DisplayMessageComponent, { model: model })) : ((0, jsx_runtime_1.jsx)(LinearBlocks_1.default, { ...props })), children, (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(TooltipComponent, { model: model, height: height, offsetMouseCoord: offsetMouseCoord, clientMouseCoord: clientMouseCoord, clientRect: clientRect, mouseCoord: offsetMouseCoord }) }), contextCoord ? ((0, jsx_runtime_1.jsx)(MenuPage_1.default, { contextCoord: contextCoord, model: model, onClose: () => {
53
50
  setContextCoord(undefined);
54
- }, onClose: () => {
55
- setContextCoord(undefined);
56
- model.setContextMenuFeature(undefined);
57
- }, slotProps: {
58
- transition: {
59
- onExit: () => {
60
- setContextCoord(undefined);
61
- model.setContextMenuFeature(undefined);
62
- },
63
- },
64
- }, anchorReference: "anchorPosition", anchorPosition: contextCoord
65
- ? { top: contextCoord[1], left: contextCoord[0] }
66
- : undefined, menuItems: items })) : null] }));
51
+ } })) : null] }));
67
52
  });
68
53
  exports.default = BaseLinearDisplay;
69
54
  var Tooltip_1 = require("./Tooltip");
@@ -16,5 +16,7 @@ function BlockMsg({ message, severity, action, }) {
16
16
  message: classes.ellipses,
17
17
  }, onMouseDown: event => {
18
18
  event.stopPropagation();
19
+ }, onClick: event => {
20
+ event.stopPropagation();
19
21
  }, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: message, children: (0, jsx_runtime_1.jsx)("div", { children: message }) }) }));
20
22
  }
@@ -1,8 +1,4 @@
1
- import type { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel';
2
- declare const RenderedBlocks: ({ model, }: {
3
- model: BaseLinearDisplayModel;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export { RenderedBlocks };
1
+ import type { BaseLinearDisplayModel } from '../model';
6
2
  declare const LinearBlocks: ({ model, }: {
7
3
  model: BaseLinearDisplayModel;
8
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RenderedBlocks = void 0;
4
6
  const jsx_runtime_1 = require("react/jsx-runtime");
5
7
  const util_1 = require("@jbrowse/core/util");
6
8
  const mobx_react_1 = require("mobx-react");
7
9
  const mui_1 = require("tss-react/mui");
8
- const Block_1 = require("./Block");
10
+ const RenderedBlocks_1 = __importDefault(require("./RenderedBlocks"));
9
11
  const useStyles = (0, mui_1.makeStyles)()({
10
12
  linearBlocks: {
11
13
  whiteSpace: 'nowrap',
@@ -14,48 +16,13 @@ const useStyles = (0, mui_1.makeStyles)()({
14
16
  minHeight: '100%',
15
17
  display: 'flex',
16
18
  },
17
- heightOverflowed: {
18
- position: 'absolute',
19
- color: 'rgb(77,77,77)',
20
- borderBottom: '2px solid rgb(77,77,77)',
21
- textShadow: 'white 0px 0px 1px',
22
- whiteSpace: 'nowrap',
23
- width: '100%',
24
- fontWeight: 'bold',
25
- textAlign: 'center',
26
- zIndex: 999,
27
- boxSizing: 'border-box',
28
- },
29
- });
30
- const RenderedBlocks = (0, mobx_react_1.observer)(function ({ model, }) {
31
- const { classes } = useStyles();
32
- const { blockDefinitions, blockState } = model;
33
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: blockDefinitions.map(block => {
34
- const key = `${model.id}-${block.key}`;
35
- if (block.type === 'ContentBlock') {
36
- const state = blockState.get(block.key);
37
- return ((0, jsx_runtime_1.jsxs)(Block_1.ContentBlock, { block: block, children: [(state === null || state === void 0 ? void 0 : state.ReactComponent) ? ((0, jsx_runtime_1.jsx)(state.ReactComponent, { model: state })) : null, (state === null || state === void 0 ? void 0 : state.maxHeightReached) ? ((0, jsx_runtime_1.jsx)("div", { className: classes.heightOverflowed, style: {
38
- top: state.layout.getTotalHeight() - 16,
39
- pointerEvents: 'none',
40
- height: 16,
41
- }, children: "Max height reached" })) : null] }, key));
42
- }
43
- if (block.type === 'ElidedBlock') {
44
- return (0, jsx_runtime_1.jsx)(Block_1.ElidedBlock, { width: block.widthPx }, key);
45
- }
46
- if (block.type === 'InterRegionPaddingBlock') {
47
- return ((0, jsx_runtime_1.jsx)(Block_1.InterRegionPaddingBlock, { width: block.widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }, key));
48
- }
49
- throw new Error(`invalid block type ${JSON.stringify(block)}`);
50
- }) }));
51
19
  });
52
- exports.RenderedBlocks = RenderedBlocks;
53
20
  const LinearBlocks = (0, mobx_react_1.observer)(function ({ model, }) {
54
21
  const { classes } = useStyles();
55
22
  const { blockDefinitions } = model;
56
23
  const viewModel = (0, util_1.getContainingView)(model);
57
24
  return ((0, jsx_runtime_1.jsx)("div", { className: classes.linearBlocks, style: {
58
25
  left: blockDefinitions.offsetPx - viewModel.offsetPx,
59
- }, children: (0, jsx_runtime_1.jsx)(RenderedBlocks, { model: model }) }));
26
+ }, children: (0, jsx_runtime_1.jsx)(RenderedBlocks_1.default, { model: model }) }));
60
27
  });
61
28
  exports.default = LinearBlocks;
@@ -0,0 +1,3 @@
1
+ export default function MaxHeightReached({ top }: {
2
+ top: number;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = MaxHeightReached;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const mui_1 = require("tss-react/mui");
6
+ const useStyles = (0, mui_1.makeStyles)()({
7
+ heightOverflowed: {
8
+ position: 'absolute',
9
+ color: 'rgb(77,77,77)',
10
+ borderBottom: '2px solid rgb(77,77,77)',
11
+ textShadow: 'white 0px 0px 1px',
12
+ whiteSpace: 'nowrap',
13
+ width: '100%',
14
+ fontWeight: 'bold',
15
+ textAlign: 'center',
16
+ zIndex: 999,
17
+ boxSizing: 'border-box',
18
+ },
19
+ });
20
+ function MaxHeightReached({ top }) {
21
+ const { classes } = useStyles();
22
+ return ((0, jsx_runtime_1.jsx)("div", { className: classes.heightOverflowed, style: {
23
+ top,
24
+ pointerEvents: 'none',
25
+ height: 16,
26
+ }, children: "Max height reached" }));
27
+ }
@@ -0,0 +1,8 @@
1
+ import type { Coord } from './types';
2
+ import type { BaseLinearDisplayModel } from '../model';
3
+ declare const MenuPage: ({ onClose, contextCoord, model, }: {
4
+ model: BaseLinearDisplayModel;
5
+ contextCoord: Coord;
6
+ onClose: () => void;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export default MenuPage;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const ui_1 = require("@jbrowse/core/ui");
5
+ const mobx_react_1 = require("mobx-react");
6
+ const MenuPage = (0, mobx_react_1.observer)(function ({ onClose, contextCoord, model, }) {
7
+ const items = model.contextMenuItems();
8
+ return ((0, jsx_runtime_1.jsx)(ui_1.Menu, { open: items.length > 0, onMenuItemClick: (_, callback) => {
9
+ callback();
10
+ onClose();
11
+ }, onClose: () => {
12
+ onClose();
13
+ model.setContextMenuFeature(undefined);
14
+ }, slotProps: {
15
+ transition: {
16
+ onExit: () => {
17
+ onClose();
18
+ model.setContextMenuFeature(undefined);
19
+ },
20
+ },
21
+ }, anchorReference: "anchorPosition", anchorPosition: {
22
+ top: contextCoord[1],
23
+ left: contextCoord[0],
24
+ }, menuItems: items }));
25
+ });
26
+ exports.default = MenuPage;
@@ -0,0 +1,9 @@
1
+ import type { BlockSet } from '@jbrowse/core/util/blockTypes';
2
+ declare const RenderedBlocks: ({ model, }: {
3
+ model: {
4
+ id: string;
5
+ blockDefinitions: BlockSet;
6
+ blockState: any;
7
+ };
8
+ }) => import("react/jsx-runtime").JSX.Element[];
9
+ export default RenderedBlocks;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const mobx_react_1 = require("mobx-react");
8
+ const Block_1 = require("./Block");
9
+ const MaxHeightReachedIndicator_1 = __importDefault(require("./MaxHeightReachedIndicator"));
10
+ const RenderedBlocks = (0, mobx_react_1.observer)(function ({ model, }) {
11
+ const { blockDefinitions, blockState } = model;
12
+ return blockDefinitions.map(block => {
13
+ const key = `${model.id}-${block.key}`;
14
+ if (block.type === 'ContentBlock') {
15
+ const state = blockState.get(block.key);
16
+ return ((0, jsx_runtime_1.jsxs)(Block_1.ContentBlock, { block: block, children: [(state === null || state === void 0 ? void 0 : state.ReactComponent) ? ((0, jsx_runtime_1.jsx)(state.ReactComponent, { model: state })) : null, (state === null || state === void 0 ? void 0 : state.maxHeightReached) ? ((0, jsx_runtime_1.jsx)(MaxHeightReachedIndicator_1.default, { top: state.layout.getTotalHeight() - 16 })) : null] }, key));
17
+ }
18
+ else if (block.type === 'ElidedBlock') {
19
+ return (0, jsx_runtime_1.jsx)(Block_1.ElidedBlock, { width: block.widthPx }, key);
20
+ }
21
+ else if (block.type === 'InterRegionPaddingBlock') {
22
+ return ((0, jsx_runtime_1.jsx)(Block_1.InterRegionPaddingBlock, { width: block.widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }, key));
23
+ }
24
+ throw new Error(`invalid block type ${JSON.stringify(block)}`);
25
+ });
26
+ });
27
+ exports.default = RenderedBlocks;
@@ -4,6 +4,7 @@ type Coord = [number, number];
4
4
  declare const Tooltip: ({ model, clientMouseCoord, }: {
5
5
  model: {
6
6
  featureUnderMouse: Feature | undefined;
7
+ mouseoverExtraInformation: string | undefined;
7
8
  configuration: AnyConfigurationModel;
8
9
  };
9
10
  clientMouseCoord: Coord;
@@ -13,11 +13,14 @@ const TooltipContents = (0, react_1.forwardRef)(function TooltipContents2({ mess
13
13
  return ((0, jsx_runtime_1.jsx)("div", { ref: ref, children: (0, react_1.isValidElement)(message) ? (message) : message ? ((0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: String(message) })) : null }));
14
14
  });
15
15
  const Tooltip = (0, mobx_react_1.observer)(function ({ model, clientMouseCoord, }) {
16
- const { featureUnderMouse } = model;
16
+ const { featureUnderMouse, mouseoverExtraInformation } = model;
17
17
  const x = clientMouseCoord[0] + 15;
18
18
  const y = clientMouseCoord[1];
19
19
  const contents = featureUnderMouse
20
- ? (0, configuration_1.getConf)(model, 'mouseover', { feature: featureUnderMouse })
20
+ ? (0, configuration_1.getConf)(model, 'mouseover', {
21
+ feature: featureUnderMouse,
22
+ mouseoverExtraInformation,
23
+ })
21
24
  : undefined;
22
25
  return featureUnderMouse && contents ? ((0, jsx_runtime_1.jsx)(BaseTooltip_1.default, { clientPoint: { x, y }, children: (0, jsx_runtime_1.jsx)(TooltipContents, { message: contents }) })) : null;
23
26
  });
@@ -0,0 +1 @@
1
+ export type Coord = [number, number];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  export { default as baseLinearDisplayConfigSchema } from './models/configSchema';
2
2
  export type { BlockModel } from './models/serverSideRenderedBlock';
3
- export { BaseLinearDisplay } from './models/BaseLinearDisplayModel';
4
- export type { BaseLinearDisplayModel, BaseLinearDisplayStateModel, ExportSvgDisplayOptions, } from './models/BaseLinearDisplayModel';
3
+ export { BaseLinearDisplay } from './model';
4
+ export type { BaseLinearDisplayModel, BaseLinearDisplayStateModel, ExportSvgDisplayOptions, } from './model';
5
5
  export { BlockMsg, Tooltip, default as BaseLinearDisplayComponent, } from './components/BaseLinearDisplay';
6
6
  export { default as TrackHeightMixin } from './models/TrackHeightMixin';
7
7
  export { default as FeatureDensityMixin } from './models/FeatureDensityMixin';
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.TooLargeMessage = exports.FeatureDensityMixin = exports.TrackHeightMixin = exports.BaseLinearDisplayComponent = exports.Tooltip = exports.BlockMsg = exports.BaseLinearDisplay = exports.baseLinearDisplayConfigSchema = void 0;
7
7
  var configSchema_1 = require("./models/configSchema");
8
8
  Object.defineProperty(exports, "baseLinearDisplayConfigSchema", { enumerable: true, get: function () { return __importDefault(configSchema_1).default; } });
9
- var BaseLinearDisplayModel_1 = require("./models/BaseLinearDisplayModel");
10
- Object.defineProperty(exports, "BaseLinearDisplay", { enumerable: true, get: function () { return BaseLinearDisplayModel_1.BaseLinearDisplay; } });
9
+ var model_1 = require("./model");
10
+ Object.defineProperty(exports, "BaseLinearDisplay", { enumerable: true, get: function () { return model_1.BaseLinearDisplay; } });
11
11
  var BaseLinearDisplay_1 = require("./components/BaseLinearDisplay");
12
12
  Object.defineProperty(exports, "BlockMsg", { enumerable: true, get: function () { return BaseLinearDisplay_1.BlockMsg; } });
13
13
  Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return BaseLinearDisplay_1.Tooltip; } });
@@ -1,6 +1,6 @@
1
1
  import type React from 'react';
2
2
  import CompositeMap from '@jbrowse/core/util/compositeMap';
3
- import type { ExportSvgOptions } from '../../LinearGenomeView/types';
3
+ import type { ExportSvgOptions } from '../LinearGenomeView/types';
4
4
  import type { MenuItem } from '@jbrowse/core/ui';
5
5
  import type { AnyReactComponentType, Feature } from '@jbrowse/core/util';
6
6
  import type { BaseBlock } from '@jbrowse/core/util/blockTypes';
@@ -13,7 +13,17 @@ export interface Layout {
13
13
  maxY: number;
14
14
  name: string;
15
15
  }
16
- type LayoutRecord = [number, number, number, number];
16
+ type LayoutRecord = [number, number, number, number] | [
17
+ number,
18
+ number,
19
+ number,
20
+ number,
21
+ {
22
+ label?: string;
23
+ description?: string;
24
+ refName: string;
25
+ }
26
+ ];
17
27
  export interface ExportSvgDisplayOptions extends ExportSvgOptions {
18
28
  overrideHeight: number;
19
29
  theme: ThemeOptions;
@@ -61,7 +71,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
61
71
  setStatus(message: string): void;
62
72
  setLoading(newStopToken: string): void;
63
73
  setMessage(messageText: string): void;
64
- setRendered(props: import("./serverSideRenderedBlock").RenderedProps | undefined): void;
74
+ setRendered(props: import("./models/serverSideRenderedBlock").RenderedProps | undefined): void;
65
75
  setError(error: unknown): void;
66
76
  reload(): void;
67
77
  beforeDestroy(): void;
@@ -187,6 +197,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
187
197
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
188
198
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
189
199
  } & {
200
+ mouseoverExtraInformation: string | undefined;
190
201
  featureIdUnderMouse: undefined | string;
191
202
  contextMenuFeature: undefined | Feature;
192
203
  } & {
@@ -201,6 +212,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
201
212
  } & {
202
213
  readonly features: CompositeMap<string, Feature>;
203
214
  readonly featureUnderMouse: Feature | undefined;
215
+ readonly layoutFeatures: CompositeMap<string, LayoutRecord>;
204
216
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
205
217
  getFeatureByID(blockKey: string, id: string): LayoutRecord | undefined;
206
218
  searchFeatureByID(id: string): LayoutRecord | undefined;
@@ -212,6 +224,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
212
224
  clearFeatureSelection(): void;
213
225
  setFeatureIdUnderMouse(feature?: string): void;
214
226
  setContextMenuFeature(feature?: Feature): void;
227
+ setMouseoverExtraInformation(extra?: string): void;
215
228
  } & {
216
229
  reload(): Promise<void>;
217
230
  } & {
@@ -264,7 +277,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
264
277
  setStatus(message: string): void;
265
278
  setLoading(newStopToken: string): void;
266
279
  setMessage(messageText: string): void;
267
- setRendered(props: import("./serverSideRenderedBlock").RenderedProps | undefined): void;
280
+ setRendered(props: import("./models/serverSideRenderedBlock").RenderedProps | undefined): void;
268
281
  setError(error: unknown): void;
269
282
  reload(): void;
270
283
  beforeDestroy(): void;
@@ -49,11 +49,11 @@ const MenuOpen_1 = __importDefault(require("@mui/icons-material/MenuOpen"));
49
49
  const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
50
50
  const mobx_1 = require("mobx");
51
51
  const mobx_state_tree_1 = require("mobx-state-tree");
52
- const FeatureDensityMixin_1 = __importDefault(require("./FeatureDensityMixin"));
53
- const TrackHeightMixin_1 = __importDefault(require("./TrackHeightMixin"));
54
- const configSchema_1 = __importDefault(require("./configSchema"));
55
- const serverSideRenderedBlock_1 = __importDefault(require("./serverSideRenderedBlock"));
56
- const Tooltip = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('../components/Tooltip'))));
52
+ const FeatureDensityMixin_1 = __importDefault(require("./models/FeatureDensityMixin"));
53
+ const TrackHeightMixin_1 = __importDefault(require("./models/TrackHeightMixin"));
54
+ const configSchema_1 = __importDefault(require("./models/configSchema"));
55
+ const serverSideRenderedBlock_1 = __importDefault(require("./models/serverSideRenderedBlock"));
56
+ const Tooltip = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/Tooltip'))));
57
57
  function stateModelFactory() {
58
58
  return mobx_state_tree_1.types
59
59
  .compose('BaseLinearDisplay', models_1.BaseDisplay, (0, TrackHeightMixin_1.default)(), (0, FeatureDensityMixin_1.default)(), mobx_state_tree_1.types.model({
@@ -61,6 +61,7 @@ function stateModelFactory() {
61
61
  configuration: (0, configuration_1.ConfigurationReference)(configSchema_1.default),
62
62
  }))
63
63
  .volatile(() => ({
64
+ mouseoverExtraInformation: undefined,
64
65
  featureIdUnderMouse: undefined,
65
66
  contextMenuFeature: undefined,
66
67
  }))
@@ -116,6 +117,15 @@ function stateModelFactory() {
116
117
  const feat = self.featureIdUnderMouse;
117
118
  return feat ? this.features.get(feat) : undefined;
118
119
  },
120
+ get layoutFeatures() {
121
+ const featureMaps = [];
122
+ for (const block of self.blockState.values()) {
123
+ if (block.layout) {
124
+ featureMaps.push(block.layout.rectangles);
125
+ }
126
+ }
127
+ return new compositeMap_1.default(featureMaps);
128
+ },
119
129
  getFeatureOverlapping(blockKey, x, y) {
120
130
  var _a, _b;
121
131
  return (_b = (_a = self.blockState.get(blockKey)) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.getByCoord(x, y);
@@ -193,6 +203,9 @@ function stateModelFactory() {
193
203
  setContextMenuFeature(feature) {
194
204
  self.contextMenuFeature = feature;
195
205
  },
206
+ setMouseoverExtraInformation(extra) {
207
+ self.mouseoverExtraInformation = extra;
208
+ },
196
209
  }))
197
210
  .actions(self => {
198
211
  const { reload: superReload } = self;
@@ -270,11 +283,13 @@ function stateModelFactory() {
270
283
  self.setContextMenuFeature(self.features.get(f));
271
284
  }
272
285
  },
273
- onMouseMove(_, featureId) {
286
+ onMouseMove(_, featureId, extra) {
274
287
  self.setFeatureIdUnderMouse(featureId);
288
+ self.setMouseoverExtraInformation(extra);
275
289
  },
276
290
  onMouseLeave(_) {
277
291
  self.setFeatureIdUnderMouse(undefined);
292
+ self.setMouseoverExtraInformation(undefined);
278
293
  },
279
294
  onContextMenu() {
280
295
  self.setContextMenuFeature(undefined);
@@ -285,7 +300,7 @@ function stateModelFactory() {
285
300
  }))
286
301
  .actions(self => ({
287
302
  async renderSvg(opts) {
288
- const { renderBaseLinearDisplaySvg } = await Promise.resolve().then(() => __importStar(require('./renderSvg')));
303
+ const { renderBaseLinearDisplaySvg } = await Promise.resolve().then(() => __importStar(require('./models/renderSvg')));
289
304
  return renderBaseLinearDisplaySvg(self, opts);
290
305
  },
291
306
  afterAttach() {
@@ -1,2 +1,2 @@
1
- import type { BaseLinearDisplayModel } from './BaseLinearDisplayModel';
1
+ import type { BaseLinearDisplayModel } from '../model';
2
2
  export default function autorunFeatureDensityStats(self: BaseLinearDisplayModel): Promise<void>;
@@ -21,8 +21,8 @@ const baseLinearDisplayConfigSchema = (0, configuration_1.ConfigurationSchema)('
21
21
  mouseover: {
22
22
  type: 'string',
23
23
  description: 'text to display when the cursor hovers over a feature',
24
- defaultValue: `jexl:get(feature,'name')`,
25
- contextVariable: ['feature'],
24
+ defaultValue: `jexl:join('<br/>',get(feature,'_mouseOver')||get(feature,'name')||get(feature,'id'),mouseoverExtraInformation||'')`,
25
+ contextVariable: ['feature', 'mouseoverExtraInformation'],
26
26
  },
27
27
  jexlFilters: {
28
28
  type: 'stringArray',
@@ -1,5 +1,5 @@
1
- import type { BaseLinearDisplayModel } from './BaseLinearDisplayModel';
2
1
  import type { ExportSvgOptions } from '../../LinearGenomeView/types';
2
+ import type { BaseLinearDisplayModel } from '../model';
3
3
  import type { ThemeOptions } from '@mui/material';
4
4
  export declare function renderBaseLinearDisplaySvg(self: BaseLinearDisplayModel, opts: ExportSvgOptions & {
5
5
  overrideHeight: number;
@@ -171,6 +171,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
171
171
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
172
172
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
173
173
  } & {
174
+ mouseoverExtraInformation: string | undefined;
174
175
  featureIdUnderMouse: undefined | string;
175
176
  contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
176
177
  } & {
@@ -185,9 +186,22 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
185
186
  } & {
186
187
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
187
188
  readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
189
+ readonly layoutFeatures: import("@jbrowse/core/util/compositeMap").default<string, [number, number, number, number] | [number, number, number, number, {
190
+ label?: string;
191
+ description?: string;
192
+ refName: string;
193
+ }]>;
188
194
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
189
- getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
190
- searchFeatureByID(id: string): [number, number, number, number] | undefined;
195
+ getFeatureByID(blockKey: string, id: string): ([number, number, number, number] | [number, number, number, number, {
196
+ label?: string;
197
+ description?: string;
198
+ refName: string;
199
+ }]) | undefined;
200
+ searchFeatureByID(id: string): ([number, number, number, number] | [number, number, number, number, {
201
+ label?: string;
202
+ description?: string;
203
+ refName: string;
204
+ }]) | undefined;
191
205
  } & {
192
206
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
193
207
  deleteBlock(key: string): void;
@@ -196,6 +210,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
196
210
  clearFeatureSelection(): void;
197
211
  setFeatureIdUnderMouse(feature?: string): void;
198
212
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature): void;
213
+ setMouseoverExtraInformation(extra?: string): void;
199
214
  } & {
200
215
  reload(): Promise<void>;
201
216
  } & {
@@ -179,6 +179,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
179
179
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
180
180
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
181
181
  } & {
182
+ mouseoverExtraInformation: string | undefined;
182
183
  featureIdUnderMouse: undefined | string;
183
184
  contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
184
185
  } & {
@@ -193,9 +194,22 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
193
194
  } & {
194
195
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
195
196
  readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
197
+ readonly layoutFeatures: import("@jbrowse/core/util/compositeMap").default<string, [number, number, number, number] | [number, number, number, number, {
198
+ label?: string;
199
+ description?: string;
200
+ refName: string;
201
+ }]>;
196
202
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
197
- getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
198
- searchFeatureByID(id: string): [number, number, number, number] | undefined;
203
+ getFeatureByID(blockKey: string, id: string): ([number, number, number, number] | [number, number, number, number, {
204
+ label?: string;
205
+ description?: string;
206
+ refName: string;
207
+ }]) | undefined;
208
+ searchFeatureByID(id: string): ([number, number, number, number] | [number, number, number, number, {
209
+ label?: string;
210
+ description?: string;
211
+ refName: string;
212
+ }]) | undefined;
199
213
  } & {
200
214
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
201
215
  deleteBlock(key: string): void;
@@ -204,6 +218,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
204
218
  clearFeatureSelection(): void;
205
219
  setFeatureIdUnderMouse(feature?: string): void;
206
220
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature): void;
221
+ setMouseoverExtraInformation(extra?: string): void;
207
222
  } & {
208
223
  reload(): Promise<void>;
209
224
  } & {
@@ -28,7 +28,9 @@ function rightTriangle(x, _y, width, height) {
28
28
  const colorMap = {
29
29
  gneg: 'rgb(227,227,227)',
30
30
  gpos25: 'rgb(142,142,142)',
31
+ gpos33: 'rgb(142,142,142)',
31
32
  gpos50: 'rgb(85,85,85)',
33
+ gpos66: 'rgb(85,85,85)',
32
34
  gpos100: 'rgb(0,0,0)',
33
35
  gpos75: 'rgb(57,57,57)',
34
36
  gvar: 'rgb(0,0,0)',
@@ -6,7 +6,7 @@ const ui_1 = require("@jbrowse/core/ui");
6
6
  const util_1 = require("@jbrowse/core/util");
7
7
  const material_1 = require("@mui/material");
8
8
  const mobx_react_1 = require("mobx-react");
9
- const toP = (s = 0) => +(+s).toFixed(1);
9
+ const toP = (s = 0) => +s.toFixed(1);
10
10
  const RegionWidthEditorDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) {
11
11
  const { bpPerPx, width } = model;
12
12
  const [val, setVal] = (0, react_1.useState)((0, util_1.toLocale)(toP(bpPerPx * width)));
@@ -37,7 +37,7 @@ const SequenceSearchDialog = (0, mobx_react_1.observer)(function ({ model, handl
37
37
  } }), label: "Case insensitive" })] }), error ? (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "error", children: `${error}` }) : null] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
38
38
  var _a;
39
39
  if (value) {
40
- const trackId = `sequence_search_${+Date.now()}`;
40
+ const trackId = `sequence_search_${Date.now()}`;
41
41
  const session = (0, util_1.getSession)(model);
42
42
  const { assemblyManager } = session;
43
43
  const assemblyName = model.assemblyNames[0];
@@ -14,7 +14,7 @@ const mui_1 = require("tss-react/mui");
14
14
  const Gridlines_1 = __importDefault(require("./Gridlines"));
15
15
  const TrackLabelContainer_1 = __importDefault(require("./TrackLabelContainer"));
16
16
  const TrackRenderingContainer_1 = __importDefault(require("./TrackRenderingContainer"));
17
- const useStyles = (0, mui_1.makeStyles)()({
17
+ const useStyles = (0, mui_1.makeStyles)()(theme => ({
18
18
  root: {
19
19
  marginTop: 2,
20
20
  overflow: 'hidden',
@@ -24,11 +24,15 @@ const useStyles = (0, mui_1.makeStyles)()({
24
24
  background: 'none',
25
25
  },
26
26
  resizeHandle: {
27
- height: 3,
27
+ height: 4,
28
28
  boxSizing: 'border-box',
29
29
  position: 'relative',
30
+ background: 'transparent',
31
+ '&:hover': {
32
+ background: theme.palette.divider,
33
+ },
30
34
  },
31
- });
35
+ }));
32
36
  const TrackContainer = (0, mobx_react_1.observer)(function ({ model, track, }) {
33
37
  const { classes, cx } = useStyles();
34
38
  const display = track.displays[0];
@@ -24,7 +24,7 @@ const TrackLabelMenu = (0, mobx_react_1.observer)(function ({ track, }) {
24
24
  const pinned = track.pinned;
25
25
  const { isTopLevelView } = view;
26
26
  const items = [
27
- ...(isTopLevelView
27
+ ...(!isTopLevelView
28
28
  ? []
29
29
  : [
30
30
  {