@jbrowse/plugin-sv-inspector 3.7.0 → 4.0.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.
@@ -1,18 +1,11 @@
1
1
  export default function LaunchSvInspectorViewF(pluginManager) {
2
2
  pluginManager.addToExtensionPoint('LaunchView-SvInspectorView', async ({ session, assembly, uri, fileType, }) => {
3
- var _a, _b;
4
- const view = session.addView('SvInspectorView');
5
- const exts = uri.split('.');
6
- let ext = (_a = exts.pop()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
7
- if (ext === 'GZ') {
8
- ext = (_b = exts.pop()) === null || _b === void 0 ? void 0 : _b.toUpperCase();
9
- }
10
- view.spreadsheetView.importWizard.setFileType(fileType || ext || '');
11
- view.spreadsheetView.importWizard.setSelectedAssemblyName(assembly);
12
- view.spreadsheetView.importWizard.setFileSource({
13
- uri,
14
- locationType: 'UriLocation',
3
+ session.addView('SvInspectorView', {
4
+ init: {
5
+ assembly,
6
+ uri,
7
+ fileType,
8
+ },
15
9
  });
16
- await view.spreadsheetView.importWizard.import(assembly);
17
10
  });
18
11
  }
@@ -0,0 +1 @@
1
+ export { BreakpointSplitViewChoiceDialog as default } from '@jbrowse/sv-core';
@@ -0,0 +1 @@
1
+ export { BreakpointSplitViewChoiceDialog as default } from '@jbrowse/sv-core';
@@ -1,4 +1,4 @@
1
- import type { SvInspectorViewModel } from '../model';
1
+ import type { SvInspectorViewModel } from '../model.ts';
2
2
  declare const CircularViewOptions: ({ svInspector, }: {
3
3
  svInspector: SvInspectorViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
2
3
  import { Checkbox, FormControlLabel } from '@mui/material';
3
4
  import { observer } from 'mobx-react';
4
- import { makeStyles } from 'tss-react/mui';
5
5
  const useStyles = makeStyles()(theme => ({
6
6
  circularViewOptions: {
7
7
  padding: theme.spacing(1),
8
8
  },
9
9
  }));
10
- const CircularViewOptions = observer(function ({ svInspector, }) {
10
+ const CircularViewOptions = observer(function CircularViewOptions({ svInspector, }) {
11
11
  const { classes } = useStyles();
12
12
  return (_jsx("div", { className: classes.circularViewOptions, style: { height: svInspector.circularViewOptionsBarHeight }, children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: svInspector.onlyDisplayRelevantRegionsInCircularView, onChange: e => {
13
13
  svInspector.setOnlyDisplayRelevantRegionsInCircularView(e.target.checked);
@@ -1,4 +1,4 @@
1
- import type { SvInspectorViewModel } from '../model';
1
+ import type { SvInspectorViewModel } from '../model.ts';
2
2
  declare const SvInspectorView: ({ model, }: {
3
3
  model: SvInspectorViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { ResizeHandle } from '@jbrowse/core/ui';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
4
  import { observer } from 'mobx-react';
4
- import { makeStyles } from 'tss-react/mui';
5
- import CircularViewOptions from './CircularViewOptions';
5
+ import CircularViewOptions from "./CircularViewOptions.js";
6
6
  const useStyles = makeStyles()(theme => ({
7
7
  resizeHandleVert: {
8
8
  background: theme.palette.action.selected,
@@ -16,9 +16,6 @@ const useStyles = makeStyles()(theme => ({
16
16
  boxSizing: 'border-box',
17
17
  borderTop: '1px solid #fafafa',
18
18
  },
19
- viewControls: {
20
- margin: 0,
21
- },
22
19
  viewsContainer: {
23
20
  display: 'flex',
24
21
  },
@@ -26,7 +23,7 @@ const useStyles = makeStyles()(theme => ({
26
23
  overflow: 'hidden',
27
24
  },
28
25
  }));
29
- const SvInspectorView = observer(function ({ model, }) {
26
+ const SvInspectorView = observer(function SvInspectorView({ model, }) {
30
27
  const { classes } = useStyles();
31
28
  const { SpreadsheetViewReactComponent, CircularViewReactComponent, showCircularView, } = model;
32
29
  return (_jsxs("div", { className: classes.container, children: [_jsxs("div", { className: classes.viewsContainer, children: [_jsx("div", { style: {
@@ -1,30 +1,32 @@
1
1
  import { lazy } from 'react';
2
2
  import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
3
3
  import { getContainingView, getSession } from '@jbrowse/core/util';
4
- import { navToMultiLevelBreak } from '@jbrowse/sv-core';
5
- import { getParent } from 'mobx-state-tree';
6
- import stateModelFactory from './model';
4
+ import { getParent } from '@jbrowse/mobx-state-tree';
5
+ import stateModelFactory from "./model.js";
6
+ const BreakpointSplitViewChoiceDialog = lazy(() => import("./BreakpointSplitViewChoiceDialog.js"));
7
7
  function defaultOnChordClick(feature, chordTrack) {
8
- ;
9
- (async () => {
10
- const session = getSession(chordTrack);
11
- try {
12
- session.setSelection(feature);
13
- const view = getContainingView(chordTrack);
14
- const parentView = getParent(view);
15
- const stableViewId = `${parentView.id}_spawned`;
16
- await navToMultiLevelBreak({
17
- assemblyName: view.assemblyNames[0],
8
+ const session = getSession(chordTrack);
9
+ try {
10
+ session.setSelection(feature);
11
+ const view = getContainingView(chordTrack);
12
+ const parentView = getParent(view);
13
+ const stableViewId = `${parentView.id}_spawned`;
14
+ const assemblyName = view.assemblyNames[0];
15
+ session.queueDialog(handleClose => [
16
+ BreakpointSplitViewChoiceDialog,
17
+ {
18
+ handleClose,
18
19
  session,
19
- stableViewId,
20
20
  feature,
21
- });
22
- }
23
- catch (e) {
24
- console.error(e);
25
- session.notifyError(`${e}`, e);
26
- }
27
- })();
21
+ stableViewId,
22
+ assemblyName,
23
+ },
24
+ ]);
25
+ }
26
+ catch (e) {
27
+ console.error(e);
28
+ session.notifyError(`${e}`, e);
29
+ }
28
30
  }
29
31
  export default function SvInspectorViewF(pluginManager) {
30
32
  pluginManager.jexl.addFunction('defaultOnChordClick', defaultOnChordClick);
@@ -34,7 +36,7 @@ export default function SvInspectorViewF(pluginManager) {
34
36
  name: 'SvInspectorView',
35
37
  displayName: 'SV inspector',
36
38
  stateModel,
37
- ReactComponent: lazy(() => import('./components/SvInspectorView')),
39
+ ReactComponent: lazy(() => import("./components/SvInspectorView.js")),
38
40
  });
39
41
  });
40
42
  }