@jbrowse/plugin-linear-genome-view 5.0.0-beta.13 → 5.0.0-beta.16

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/esm/FeatureTrack/configSchema.d.ts +2 -1
  2. package/esm/FeatureTrack/configSchema.js +2 -1
  3. package/esm/LinearGenomeView/afterAttach.js +1 -23
  4. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -2
  5. package/esm/LinearGenomeView/components/ExportSvgDialog.js +31 -7
  6. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -3
  7. package/esm/LinearGenomeView/components/HeaderPanControls.js +4 -2
  8. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  9. package/esm/LinearGenomeView/components/HighlightBand.js +4 -2
  10. package/esm/LinearGenomeView/components/HighlightChip.d.ts +3 -2
  11. package/esm/LinearGenomeView/components/HighlightChip.js +4 -2
  12. package/esm/LinearGenomeView/components/LinearGenomeView.js +5 -12
  13. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +4 -5
  14. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +3 -2
  15. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +4 -2
  16. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +3 -2
  17. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +4 -4
  18. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +4 -4
  19. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +3 -2
  20. package/esm/LinearGenomeView/components/SearchPanelForm.js +4 -2
  21. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +4 -9
  22. package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -4
  23. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +3 -8
  24. package/esm/LinearGenomeView/components/SearchResultsTable.js +4 -32
  25. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +3 -2
  26. package/esm/LinearGenomeView/components/StrandCheckboxes.js +4 -2
  27. package/esm/LinearGenomeView/components/TrackContainer.js +1 -1
  28. package/esm/LinearGenomeView/components/TrackLabelMenu.js +8 -12
  29. package/esm/LinearGenomeView/components/useRangeSelect.js +3 -2
  30. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +3 -1
  31. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +4 -2
  32. package/esm/LinearGenomeView/components/useSideScroll.js +11 -12
  33. package/esm/LinearGenomeView/lazyDialogs.d.ts +17 -2
  34. package/esm/LinearGenomeView/menuItems.js +32 -24
  35. package/esm/LinearGenomeView/model.d.ts +197 -151
  36. package/esm/LinearGenomeView/model.js +203 -201
  37. package/esm/LinearGenomeView/rExport/exportLinearView.d.ts +13 -0
  38. package/esm/LinearGenomeView/rExport/exportLinearView.js +98 -0
  39. package/esm/LinearGenomeView/rExport/rScript.d.ts +75 -0
  40. package/esm/LinearGenomeView/rExport/rScript.js +465 -0
  41. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +3 -6
  42. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +1 -2
  43. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +2 -2
  44. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +1 -2
  45. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +4 -4
  46. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +1 -2
  47. package/esm/LinearGenomeView/svgcomponents/SVGView.js +3 -3
  48. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +22 -20
  49. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +42 -29
  50. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +6 -11
  51. package/esm/LinearGenomeView/svgcomponents/util.d.ts +2 -1
  52. package/esm/LinearGenomeView/util.d.ts +42 -0
  53. package/esm/LinearGenomeView/util.js +81 -0
  54. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +2 -2
  55. package/esm/displayKitTests/perRegionTestEnv.d.ts +45 -12
  56. package/esm/index.d.ts +4 -2
  57. package/esm/index.js +3 -1
  58. package/esm/searchUtils.js +1 -0
  59. package/esm/shared/RubberbandSpan.d.ts +3 -2
  60. package/esm/shared/RubberbandSpan.js +4 -2
  61. package/esm/shared/coordLabels.d.ts +6 -6
  62. package/esm/shared/coordLabels.js +7 -6
  63. package/package.json +9 -9
package/esm/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export default class LinearGenomeViewPlugin extends Plugin {
5
5
  /**
6
6
  * #config LinearGenomeViewConfigSchema
7
7
  * #category root
8
+ * Sets defaults for every linear genome view, on the root config under
9
+ * `configuration.LinearGenomeViewPlugin`.
8
10
  */
9
11
  configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
10
12
  readonly trackLabels: {
@@ -19,7 +21,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
19
21
  configure(pluginManager: PluginManager): void;
20
22
  }
21
23
  export { DisplayChromeOverlayProvider, DisplayUIProvider, FloatingLegend, TrackControlProvider, plainChromeOverlays, plainTrackControl, useTrackControlMenu, } from '@jbrowse/display-ui';
22
- export type { DisplayBackgroundProgressModel, DisplayChromeOverlays, DisplayErrorBarModel, DisplayLoadingOverlayModel, LegendItem, LegendSection, TooLargeMessageModel, TrackControlComponent, TrackControlIcon, TrackControlMenu, TrackControlOption, TrackControlProps, } from '@jbrowse/display-ui';
24
+ export type { BackgroundProgressProps, DisplayChromeOverlays, ErrorBarProps, LegendItem, LegendSection, LoadingProps, RenderErrorProps, TooLargeProps, TrackControlComponent, TrackControlIcon, TrackControlMenu, TrackControlOption, TrackControlProps, } from '@jbrowse/display-ui';
23
25
  export { HighlightChip, type LinearGenomeViewModel, type LinearGenomeViewStateModel, installLinkedViewSync, stateModelFactory as linearGenomeViewStateModelFactory, } from './LinearGenomeView/index.ts';
24
26
  export { default as SearchBox } from './LinearGenomeView/components/SearchBox.tsx';
25
27
  export { default as HeaderSearchBoxRow } from './LinearGenomeView/components/HeaderSearchBoxRow.tsx';
@@ -32,7 +34,7 @@ export { fetchResults, SearchResultsNotFoundError } from './searchUtils.ts';
32
34
  export type { LaunchLinearGenomeViewArgs } from './LaunchLinearGenomeView/index.ts';
33
35
  export type { BpOffset, ExportSvgOptions, HighlightInput, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, ViewTrackLabelMode, VolatileGuide, } from './LinearGenomeView/types.ts';
34
36
  export type { ScalebarRefNameLabel } from './LinearGenomeView/util.ts';
35
- export type { HighlightRegion } from './LinearGenomeView/model.ts';
37
+ export type { HighlightRegion, SearchPickerRow, SearchPickerState, } from './LinearGenomeView/model.ts';
36
38
  export type { RegionsOrientation } from './LinearGenomeView/util.ts';
37
39
  export type { RegionEdit } from './LinearGenomeView/util.ts';
38
40
  export { makeTicks } from './LinearGenomeView/util.ts';
package/esm/index.js CHANGED
@@ -13,11 +13,13 @@ export default class LinearGenomeViewPlugin extends Plugin {
13
13
  /**
14
14
  * #config LinearGenomeViewConfigSchema
15
15
  * #category root
16
+ * Sets defaults for every linear genome view, on the root config under
17
+ * `configuration.LinearGenomeViewPlugin`.
16
18
  */
17
19
  configurationSchema = ConfigurationSchema('LinearGenomeViewConfigSchema', {
18
20
  /**
19
21
  * #slot configuration.LinearGenomeViewPlugin.trackLabels
20
- * where a track's name is drawn: `offset` gives it its own line above the
22
+ * The placement of a track's name: `offset` puts it on a line above the
21
23
  * data, `overlapping` floats it over the top of the data to save vertical
22
24
  * space, `hidden` omits it. The view menu's "Track labels" submenu sets the
23
25
  * same thing per session
@@ -170,6 +170,7 @@ export function notifySearchFailure(session, e) {
170
170
  // otherwise tell "showing it" from "asked you which one".
171
171
  export async function handleSelectedRegion({ input, model, assemblyName, grow, showHitTrack, }) {
172
172
  const { assemblyManager, textSearchManager } = getSession(model);
173
+ model.closeSearchPicker();
173
174
  // resolves only once regions/aliases are loaded, which isValidRefName needs
174
175
  // (it throws otherwise). A load failure is not this function's to report:
175
176
  // swallow it and let the input fall through to the text-search path below
@@ -4,7 +4,7 @@
4
4
  * single view reads one coordinate per edge and the multi-level rubberband reads
5
5
  * one per level.
6
6
  */
7
- export default function RubberbandSpan({ left, width, viewWidth, stickyTop, leftLabel, rightLabel, size, }: {
7
+ declare const RubberbandSpan: ({ left, width, viewWidth, stickyTop, leftLabel, rightLabel, size, }: {
8
8
  left: number;
9
9
  width: number;
10
10
  viewWidth: number;
@@ -12,4 +12,5 @@ export default function RubberbandSpan({ left, width, viewWidth, stickyTop, left
12
12
  leftLabel: React.ReactNode;
13
13
  rightLabel: React.ReactNode;
14
14
  size?: React.ReactNode;
15
- }): import("react").JSX.Element;
15
+ }) => import("react").JSX.Element;
16
+ export default RubberbandSpan;
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { alpha } from '@jbrowse/core/ui/palette';
3
3
  import { makeStyles } from '@jbrowse/core/util/tss-react';
4
4
  import { Typography } from '@mui/material';
5
+ import { observer } from 'mobx-react';
5
6
  import { LABEL_WIDTH, SpanEdgeLabels } from './coordLabels.js';
6
7
  const useStyles = makeStyles()(theme => ({
7
8
  rubberband: {
@@ -23,7 +24,7 @@ const useStyles = makeStyles()(theme => ({
23
24
  * single view reads one coordinate per edge and the multi-level rubberband reads
24
25
  * one per level.
25
26
  */
26
- export default function RubberbandSpan({ left, width, viewWidth, stickyTop, leftLabel, rightLabel, size, }) {
27
+ const RubberbandSpan = observer(function RubberbandSpan({ left, width, viewWidth, stickyTop, leftLabel, rightLabel, size, }) {
27
28
  const { classes } = useStyles();
28
29
  // a label only moves inside its edge when the span can hold it, so a sliver of
29
30
  // a selection at a view border keeps both labels outside and takes the clip
@@ -31,4 +32,5 @@ export default function RubberbandSpan({ left, width, viewWidth, stickyTop, left
31
32
  return (_jsxs("div", { className: classes.rubberband, style: { transform: `translateX(${left}px)`, width }, children: [_jsx(SpanEdgeLabels, { stickyTop: stickyTop, left: leftLabel, right: rightLabel, insideLeft: fitsInside && left < LABEL_WIDTH, insideRight: fitsInside && left + width > viewWidth - LABEL_WIDTH }), size ? (_jsx(Typography, { variant: "h6", className: classes.rubberbandText, style: stickyTop === undefined
32
33
  ? undefined
33
34
  : { position: 'sticky', top: stickyTop }, children: size })) : null] }));
34
- }
35
+ });
36
+ export default RubberbandSpan;
@@ -1,11 +1,11 @@
1
1
  export declare const LABEL_WIDTH = 100;
2
2
  /** A red vertical line at `coordX` with `children` labelled above it. */
3
- export declare function VerticalGuideLine({ coordX, viewWidth, stickyTop, children, }: {
3
+ export declare const VerticalGuideLine: ({ coordX, viewWidth, stickyTop, children, }: {
4
4
  coordX: number;
5
5
  viewWidth: number;
6
6
  stickyTop: string | undefined;
7
7
  children: React.ReactNode;
8
- }): import("react").JSX.Element;
8
+ }) => import("react").JSX.Element;
9
9
  /**
10
10
  * The bp coordinate under a vertical guide, drawn just above the top of the
11
11
  * guide line so it covers neither the line nor the cursor hovering the scalebar
@@ -26,22 +26,22 @@ export declare function VerticalGuideLine({ coordX, viewWidth, stickyTop, childr
26
26
  * measured once per hover, not per mousemove — only `coordX` changes as the
27
27
  * mouse moves, and that needs no measurement.
28
28
  */
29
- export declare function GuideLabel({ coordX, viewWidth, stickyTop, children, }: {
29
+ export declare const GuideLabel: ({ coordX, viewWidth, stickyTop, children, }: {
30
30
  coordX: number;
31
31
  viewWidth: number;
32
32
  stickyTop: string | undefined;
33
33
  children: React.ReactNode;
34
- }): import("react").JSX.Element;
34
+ }) => import("react").JSX.Element;
35
35
  /**
36
36
  * The bp coordinates of a rubberband selection, one label just outside each edge
37
37
  * of the span. Renders inside the span, so the edges are its own box. A label
38
38
  * with no room outside its edge flips inside instead, which is why the span it
39
39
  * has to fit in is a prop.
40
40
  */
41
- export declare function SpanEdgeLabels({ stickyTop, left, right, insideLeft, insideRight, }: {
41
+ export declare const SpanEdgeLabels: ({ stickyTop, left, right, insideLeft, insideRight, }: {
42
42
  stickyTop: string | undefined;
43
43
  left: React.ReactNode;
44
44
  right: React.ReactNode;
45
45
  insideLeft: boolean;
46
46
  insideRight: boolean;
47
- }): import("react").JSX.Element;
47
+ }) => import("react").JSX.Element;
@@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from 'react';
3
3
  import { alpha } from '@jbrowse/core/ui/palette';
4
4
  import { MUI_TOOLTIP_Z_INDEX } from '@jbrowse/core/ui/zIndexes';
5
5
  import { makeStyles } from '@jbrowse/core/util/tss-react';
6
+ import { observer } from 'mobx-react';
6
7
  import { createPortal } from 'react-dom';
7
8
  // roughly how wide a coordinate label is. the guide clamps itself half of this
8
9
  // from either border, and a rubberband label that would hang off a border goes
@@ -62,10 +63,10 @@ const useStyles = makeStyles()(theme => ({
62
63
  },
63
64
  }));
64
65
  /** A red vertical line at `coordX` with `children` labelled above it. */
65
- export function VerticalGuideLine({ coordX, viewWidth, stickyTop, children, }) {
66
+ export const VerticalGuideLine = observer(function VerticalGuideLine({ coordX, viewWidth, stickyTop, children, }) {
66
67
  const { classes } = useStyles();
67
68
  return (_jsxs(_Fragment, { children: [_jsx(GuideLabel, { coordX: coordX, viewWidth: viewWidth, stickyTop: stickyTop, children: children }), _jsx("div", { className: classes.guideLine, style: { transform: `translateX(${coordX}px)` } })] }));
68
- }
69
+ });
69
70
  function anchorStyle(stickyTop) {
70
71
  return stickyTop === undefined
71
72
  ? { position: 'relative' }
@@ -91,7 +92,7 @@ function anchorStyle(stickyTop) {
91
92
  * measured once per hover, not per mousemove — only `coordX` changes as the
92
93
  * mouse moves, and that needs no measurement.
93
94
  */
94
- export function GuideLabel({ coordX, viewWidth, stickyTop, children, }) {
95
+ export const GuideLabel = observer(function GuideLabel({ coordX, viewWidth, stickyTop, children, }) {
95
96
  const { classes, cx } = useStyles();
96
97
  const anchorRef = useRef(null);
97
98
  const [anchorPos, setAnchorPos] = useState();
@@ -120,14 +121,14 @@ export function GuideLabel({ coordX, viewWidth, stickyTop, children, }) {
120
121
  bottom: anchorPos.viewportHeight - anchorPos.top + LABEL_GAP,
121
122
  }, children: children }), document.body)
122
123
  : null] }));
123
- }
124
+ });
124
125
  /**
125
126
  * The bp coordinates of a rubberband selection, one label just outside each edge
126
127
  * of the span. Renders inside the span, so the edges are its own box. A label
127
128
  * with no room outside its edge flips inside instead, which is why the span it
128
129
  * has to fit in is a prop.
129
130
  */
130
- export function SpanEdgeLabels({ stickyTop, left, right, insideLeft, insideRight, }) {
131
+ export const SpanEdgeLabels = observer(function SpanEdgeLabels({ stickyTop, left, right, insideLeft, insideRight, }) {
131
132
  const { classes, cx } = useStyles();
132
133
  return (_jsxs("div", { className: classes.anchor, style: anchorStyle(stickyTop), children: [_jsx("div", { className: cx(classes.label, classes.spanLabel, insideLeft ? classes.insideLeftEdge : classes.leftOfEdge), children: left }), _jsx("div", { className: cx(classes.label, classes.spanLabel, insideRight ? classes.insideRightEdge : classes.rightOfEdge), children: right })] }));
133
- }
134
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "5.0.0-beta.13",
3
+ "version": "5.0.0-beta.16",
4
4
  "type": "module",
5
5
  "description": "JBrowse 2 linear genome view",
6
6
  "keywords": [
@@ -21,15 +21,15 @@
21
21
  "esm"
22
22
  ],
23
23
  "dependencies": {
24
- "@jbrowse/mobx-state-tree": "^6.7.0",
25
- "@mui/icons-material": "^9.4.0",
26
- "@mui/material": "^9.4.0",
24
+ "@jbrowse/mobx-state-tree": "^6.9.0",
25
+ "@mui/icons-material": "^9.5.0",
26
+ "@mui/material": "^9.5.0",
27
27
  "mobx": "^7.0.6",
28
28
  "mobx-react": "^10.0.2",
29
- "@jbrowse/core": "^5.0.0-beta.13",
30
- "@jbrowse/render-core": "^5.0.0-beta.13",
31
- "@jbrowse/display-kit": "^5.0.0-beta.13",
32
- "@jbrowse/display-ui": "^5.0.0-beta.13"
29
+ "@jbrowse/core": "^5.0.0-beta.16",
30
+ "@jbrowse/display-kit": "^5.0.0-beta.16",
31
+ "@jbrowse/display-ui": "^5.0.0-beta.16",
32
+ "@jbrowse/render-core": "^5.0.0-beta.16"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=19.0.0",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "sideEffects": false,
42
42
  "devDependencies": {
43
- "@jbrowse/display-test-utils": "^5.0.0-beta.13"
43
+ "@jbrowse/display-test-utils": "^5.0.0-beta.16"
44
44
  },
45
45
  "scripts": {
46
46
  "prebuild": "pnpm clean",