@jbrowse/plugin-linear-genome-view 3.6.5 → 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 (63) 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/RegionWidthEditorDialog.js +1 -1
  26. package/dist/LinearGenomeView/components/SequenceSearchDialog.js +1 -1
  27. package/dist/LinearGenomeView/components/TrackContainer.js +7 -3
  28. package/dist/LinearGenomeView/components/useRangeSelect.js +10 -14
  29. package/dist/LinearGenomeView/model.js +1 -1
  30. package/dist/LinearGenomeView/util.js +1 -1
  31. package/dist/index.d.ts +17 -2
  32. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -1
  33. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +3 -18
  34. package/esm/BaseLinearDisplay/components/BlockMsg.js +2 -0
  35. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -5
  36. package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -37
  37. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +3 -0
  38. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +24 -0
  39. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +8 -0
  40. package/esm/BaseLinearDisplay/components/MenuPage.js +24 -0
  41. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +9 -0
  42. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +22 -0
  43. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +1 -0
  44. package/esm/BaseLinearDisplay/components/Tooltip.js +5 -2
  45. package/esm/BaseLinearDisplay/components/types.d.ts +1 -0
  46. package/esm/BaseLinearDisplay/components/types.js +1 -0
  47. package/esm/BaseLinearDisplay/index.d.ts +2 -2
  48. package/esm/BaseLinearDisplay/index.js +1 -1
  49. package/esm/BaseLinearDisplay/{models/BaseLinearDisplayModel.d.ts → model.d.ts} +17 -4
  50. package/esm/BaseLinearDisplay/{models/BaseLinearDisplayModel.js → model.js} +22 -7
  51. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +1 -1
  52. package/esm/BaseLinearDisplay/models/configSchema.js +2 -2
  53. package/esm/BaseLinearDisplay/models/renderSvg.d.ts +1 -1
  54. package/esm/LinearBareDisplay/model.d.ts +17 -2
  55. package/esm/LinearBasicDisplay/model.d.ts +17 -2
  56. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +1 -1
  57. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +1 -1
  58. package/esm/LinearGenomeView/components/TrackContainer.js +7 -3
  59. package/esm/LinearGenomeView/components/useRangeSelect.js +11 -15
  60. package/esm/LinearGenomeView/model.js +1 -1
  61. package/esm/LinearGenomeView/util.js +1 -1
  62. package/esm/index.d.ts +17 -2
  63. package/package.json +3 -3
@@ -4,7 +4,7 @@ import { Dialog } from '@jbrowse/core/ui';
4
4
  import { toLocale } from '@jbrowse/core/util';
5
5
  import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
6
6
  import { observer } from 'mobx-react';
7
- const toP = (s = 0) => +(+s).toFixed(1);
7
+ const toP = (s = 0) => +s.toFixed(1);
8
8
  const RegionWidthEditorDialog = observer(function ({ model, handleClose, }) {
9
9
  const { bpPerPx, width } = model;
10
10
  const [val, setVal] = useState(toLocale(toP(bpPerPx * width)));
@@ -35,7 +35,7 @@ const SequenceSearchDialog = observer(function ({ model, handleClose, }) {
35
35
  } }), label: "Case insensitive" })] }), error ? _jsx(Typography, { color: "error", children: `${error}` }) : null] }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: () => {
36
36
  var _a;
37
37
  if (value) {
38
- const trackId = `sequence_search_${+Date.now()}`;
38
+ const trackId = `sequence_search_${Date.now()}`;
39
39
  const session = getSession(model);
40
40
  const { assemblyManager } = session;
41
41
  const assemblyName = model.assemblyNames[0];
@@ -9,7 +9,7 @@ import { makeStyles } from 'tss-react/mui';
9
9
  import Gridlines from './Gridlines';
10
10
  import TrackLabelContainer from './TrackLabelContainer';
11
11
  import TrackRenderingContainer from './TrackRenderingContainer';
12
- const useStyles = makeStyles()({
12
+ const useStyles = makeStyles()(theme => ({
13
13
  root: {
14
14
  marginTop: 2,
15
15
  overflow: 'hidden',
@@ -19,11 +19,15 @@ const useStyles = makeStyles()({
19
19
  background: 'none',
20
20
  },
21
21
  resizeHandle: {
22
- height: 3,
22
+ height: 4,
23
23
  boxSizing: 'border-box',
24
24
  position: 'relative',
25
+ background: 'transparent',
26
+ '&:hover': {
27
+ background: theme.palette.divider,
28
+ },
25
29
  },
26
- });
30
+ }));
27
31
  const TrackContainer = observer(function ({ model, track, }) {
28
32
  const { classes, cx } = useStyles();
29
33
  const display = track.displays[0];
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react';
1
+ import { useCallback, useEffect, useState } from 'react';
2
2
  import { getRelativeX } from './util';
3
3
  export function useRangeSelect(ref, model, shiftOnly) {
4
4
  const [startX, setStartX] = useState();
@@ -6,6 +6,11 @@ export function useRangeSelect(ref, model, shiftOnly) {
6
6
  const [anchorPosition, setAnchorPosition] = useState();
7
7
  const [guideX, setGuideX] = useState();
8
8
  const mouseDragging = startX !== undefined && anchorPosition === undefined;
9
+ const handleClose = useCallback(() => {
10
+ setAnchorPosition(undefined);
11
+ setStartX(undefined);
12
+ setCurrentX(undefined);
13
+ }, []);
9
14
  useEffect(() => {
10
15
  function computeOffsets(offsetX) {
11
16
  if (startX === undefined) {
@@ -28,6 +33,10 @@ export function useRangeSelect(ref, model, shiftOnly) {
28
33
  if (startX !== undefined && ref.current) {
29
34
  const { clientX, clientY } = event;
30
35
  const offsetX = getRelativeX(event, ref.current);
36
+ if (Math.abs(offsetX - startX) <= 3) {
37
+ handleClose();
38
+ return;
39
+ }
31
40
  setAnchorPosition({
32
41
  offsetX,
33
42
  clientX,
@@ -49,15 +58,7 @@ export function useRangeSelect(ref, model, shiftOnly) {
49
58
  };
50
59
  }
51
60
  return () => { };
52
- }, [startX, mouseDragging, model, ref]);
53
- useEffect(() => {
54
- if (!mouseDragging &&
55
- currentX !== undefined &&
56
- startX !== undefined &&
57
- Math.abs(currentX - startX) <= 3) {
58
- handleClose();
59
- }
60
- }, [mouseDragging, currentX, startX]);
61
+ }, [startX, mouseDragging, model, ref, handleClose]);
61
62
  function mouseDown(event) {
62
63
  if (shiftOnly && !event.shiftKey) {
63
64
  return;
@@ -84,11 +85,6 @@ export function useRangeSelect(ref, model, shiftOnly) {
84
85
  function mouseOut() {
85
86
  setGuideX(undefined);
86
87
  }
87
- function handleClose() {
88
- setAnchorPosition(undefined);
89
- setStartX(undefined);
90
- setCurrentX(undefined);
91
- }
92
88
  function handleMenuItemClick(_, callback) {
93
89
  callback();
94
90
  handleClose();
@@ -647,7 +647,7 @@ export function stateModelFactory(pluginManager) {
647
647
  onClick: self.horizontallyFlip,
648
648
  },
649
649
  {
650
- label: 'Color by CDS',
650
+ label: 'Color by CDS and draw amino acids',
651
651
  type: 'checkbox',
652
652
  checked: self.colorByCDS,
653
653
  icon: PaletteIcon,
@@ -2,7 +2,7 @@ import { assembleLocString, parseLocString } from '@jbrowse/core/util';
2
2
  export function chooseGridPitch(scale, minMajorPitchPx, minMinorPitchPx) {
3
3
  scale = Math.abs(scale);
4
4
  const minMajorPitchBp = minMajorPitchPx * scale;
5
- const majorMagnitude = Number.parseInt(Number(minMajorPitchBp).toExponential().split(/e/i)[1], 10);
5
+ const majorMagnitude = +minMajorPitchBp.toExponential().split(/e/i)[1];
6
6
  let majorPitch = 10 ** majorMagnitude;
7
7
  while (majorPitch < minMajorPitchBp) {
8
8
  majorPitch *= 2;
package/esm/index.d.ts CHANGED
@@ -176,6 +176,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
176
176
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
177
177
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
178
178
  } & {
179
+ mouseoverExtraInformation: string | undefined;
179
180
  featureIdUnderMouse: undefined | string;
180
181
  contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
181
182
  } & {
@@ -190,9 +191,22 @@ export default class LinearGenomeViewPlugin extends Plugin {
190
191
  } & {
191
192
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
192
193
  readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
194
+ readonly layoutFeatures: import("@jbrowse/core/util/compositeMap").default<string, [number, number, number, number] | [number, number, number, number, {
195
+ label?: string;
196
+ description?: string;
197
+ refName: string;
198
+ }]>;
193
199
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
194
- getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
195
- searchFeatureByID(id: string): [number, number, number, number] | undefined;
200
+ getFeatureByID(blockKey: string, id: string): ([number, number, number, number] | [number, number, number, number, {
201
+ label?: string;
202
+ description?: string;
203
+ refName: string;
204
+ }]) | undefined;
205
+ searchFeatureByID(id: string): ([number, number, number, number] | [number, number, number, number, {
206
+ label?: string;
207
+ description?: string;
208
+ refName: string;
209
+ }]) | undefined;
196
210
  } & {
197
211
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
198
212
  deleteBlock(key: string): void;
@@ -201,6 +215,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
201
215
  clearFeatureSelection(): void;
202
216
  setFeatureIdUnderMouse(feature?: string): void;
203
217
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature): void;
218
+ setMouseoverExtraInformation(extra?: string): void;
204
219
  } & {
205
220
  reload(): Promise<void>;
206
221
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "3.6.5",
3
+ "version": "3.7.0",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -38,7 +38,7 @@
38
38
  "useSrc": "node ../../scripts/useSrc.js"
39
39
  },
40
40
  "dependencies": {
41
- "@jbrowse/core": "^3.6.5",
41
+ "@jbrowse/core": "^3.7.0",
42
42
  "@mui/icons-material": "^7.0.0",
43
43
  "@mui/material": "^7.0.0",
44
44
  "@types/file-saver": "^2.0.1",
@@ -57,5 +57,5 @@
57
57
  "access": "public"
58
58
  },
59
59
  "module": "esm/index.js",
60
- "gitHead": "354d0a87b757b4d84f824b47507662f6f3a1693f"
60
+ "gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
61
61
  }