@jbrowse/plugin-sv-inspector 2.17.0 → 2.18.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 (35) hide show
  1. package/dist/LaunchSvInspectorView/index.d.ts +1 -1
  2. package/dist/LaunchSvInspectorView/index.js +1 -3
  3. package/dist/SvInspectorView/components/CircularViewOptions.d.ts +1 -1
  4. package/dist/SvInspectorView/components/CircularViewOptions.js +1 -1
  5. package/dist/SvInspectorView/components/SvInspectorView.d.ts +1 -1
  6. package/dist/SvInspectorView/components/SvInspectorView.js +1 -1
  7. package/dist/SvInspectorView/index.d.ts +1 -1
  8. package/dist/SvInspectorView/index.js +26 -13
  9. package/dist/SvInspectorView/model.d.ts +772 -0
  10. package/dist/SvInspectorView/{models/SvInspectorView.js → model.js} +50 -161
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +1 -3
  13. package/esm/LaunchSvInspectorView/index.d.ts +1 -1
  14. package/esm/LaunchSvInspectorView/index.js +1 -3
  15. package/esm/SvInspectorView/components/CircularViewOptions.d.ts +1 -1
  16. package/esm/SvInspectorView/components/CircularViewOptions.js +1 -1
  17. package/esm/SvInspectorView/components/SvInspectorView.d.ts +1 -1
  18. package/esm/SvInspectorView/components/SvInspectorView.js +1 -1
  19. package/esm/SvInspectorView/index.d.ts +1 -1
  20. package/esm/SvInspectorView/index.js +25 -12
  21. package/esm/SvInspectorView/model.d.ts +772 -0
  22. package/esm/SvInspectorView/{models/SvInspectorView.js → model.js} +50 -161
  23. package/esm/index.d.ts +1 -1
  24. package/esm/index.js +2 -4
  25. package/package.json +4 -4
  26. package/dist/SvInspectorView/models/SvInspectorView.d.ts +0 -1010
  27. package/dist/SvInspectorView/models/adhocFeatureUtils.d.ts +0 -44
  28. package/dist/SvInspectorView/models/adhocFeatureUtils.js +0 -96
  29. package/dist/SvInspectorView/models/breakpointSplitViewFromTableRow.d.ts +0 -4
  30. package/dist/SvInspectorView/models/breakpointSplitViewFromTableRow.js +0 -48
  31. package/esm/SvInspectorView/models/SvInspectorView.d.ts +0 -1010
  32. package/esm/SvInspectorView/models/adhocFeatureUtils.d.ts +0 -44
  33. package/esm/SvInspectorView/models/adhocFeatureUtils.js +0 -90
  34. package/esm/SvInspectorView/models/breakpointSplitViewFromTableRow.d.ts +0 -4
  35. package/esm/SvInspectorView/models/breakpointSplitViewFromTableRow.js +0 -42
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LaunchSvInspectorViewF(pluginManager: PluginManager): void;
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = LaunchSvInspectorViewF;
4
4
  function LaunchSvInspectorViewF(pluginManager) {
5
- pluginManager.addToExtensionPoint('LaunchView-SvInspectorView',
6
- // @ts-expect-error
7
- async ({ session, assembly, uri, fileType, }) => {
5
+ pluginManager.addToExtensionPoint('LaunchView-SvInspectorView', async ({ session, assembly, uri, fileType, }) => {
8
6
  var _a, _b;
9
7
  const view = session.addView('SvInspectorView');
10
8
  const exts = uri.split('.');
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SvInspectorViewModel } from '../models/SvInspectorView';
2
+ import type { SvInspectorViewModel } from '../model';
3
3
  declare const CircularViewOptions: ({ svInspector, }: {
4
4
  svInspector: SvInspectorViewModel;
5
5
  }) => React.JSX.Element;
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
- const mobx_react_1 = require("mobx-react");
8
7
  const material_1 = require("@mui/material");
8
+ const mobx_react_1 = require("mobx-react");
9
9
  const mui_1 = require("tss-react/mui");
10
10
  const useStyles = (0, mui_1.makeStyles)()(theme => ({
11
11
  circularViewOptions: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SvInspectorViewModel } from '../models/SvInspectorView';
2
+ import type { SvInspectorViewModel } from '../model';
3
3
  declare const SvInspectorView: ({ model, }: {
4
4
  model: SvInspectorViewModel;
5
5
  }) => React.JSX.Element;
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
+ const ui_1 = require("@jbrowse/core/ui");
7
8
  const mobx_react_1 = require("mobx-react");
8
9
  const mui_1 = require("tss-react/mui");
9
- const ui_1 = require("@jbrowse/core/ui");
10
10
  const CircularViewOptions_1 = __importDefault(require("./CircularViewOptions"));
11
11
  const useStyles = (0, mui_1.makeStyles)()(theme => ({
12
12
  resizeHandleVert: {
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function SvInspectorViewF(pluginManager: PluginManager): void;
@@ -5,24 +5,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = SvInspectorViewF;
7
7
  const ViewType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/ViewType"));
8
- const SvInspectorView_1 = __importDefault(require("./components/SvInspectorView"));
9
- const SvInspectorView_2 = __importDefault(require("./models/SvInspectorView"));
10
8
  const util_1 = require("@jbrowse/core/util");
11
- function defaultOnChordClick(feature, chordTrack, pluginManager) {
12
- const session = (0, util_1.getSession)(chordTrack);
13
- session.setSelection(feature);
14
- const view = (0, util_1.getContainingView)(chordTrack);
15
- const viewType = pluginManager.getViewType('BreakpointSplitView');
16
- const viewSnapshot = viewType.snapshotFromBreakendFeature(feature, view);
17
- // try to center the offsetPx
18
- viewSnapshot.views[0].offsetPx -= view.width / 2 + 100;
19
- viewSnapshot.views[1].offsetPx -= view.width / 2 + 100;
20
- session.addView('BreakpointSplitView', viewSnapshot);
9
+ const sv_core_1 = require("@jbrowse/sv-core");
10
+ const mobx_state_tree_1 = require("mobx-state-tree");
11
+ const SvInspectorView_1 = __importDefault(require("./components/SvInspectorView"));
12
+ const model_1 = __importDefault(require("./model"));
13
+ function defaultOnChordClick(feature, chordTrack) {
14
+ ;
15
+ (async () => {
16
+ const session = (0, util_1.getSession)(chordTrack);
17
+ try {
18
+ session.setSelection(feature);
19
+ const view = (0, util_1.getContainingView)(chordTrack);
20
+ const parentView = (0, mobx_state_tree_1.getParent)(view);
21
+ const stableViewId = `${parentView.id}_spawned`;
22
+ await (0, sv_core_1.navToMultiLevelBreak)({
23
+ assemblyName: view.assemblyNames[0],
24
+ session,
25
+ stableViewId,
26
+ feature,
27
+ });
28
+ }
29
+ catch (e) {
30
+ console.error(e);
31
+ session.notifyError(`${e}`, e);
32
+ }
33
+ })();
21
34
  }
22
35
  function SvInspectorViewF(pluginManager) {
23
36
  pluginManager.jexl.addFunction('defaultOnChordClick', defaultOnChordClick);
24
37
  pluginManager.addViewType(() => {
25
- const stateModel = (0, SvInspectorView_2.default)(pluginManager);
38
+ const stateModel = (0, model_1.default)(pluginManager);
26
39
  return new ViewType_1.default({
27
40
  name: 'SvInspectorView',
28
41
  displayName: 'SV inspector',