@jbrowse/plugin-arc 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.
@@ -43,7 +43,7 @@ function Arc({ selectedFeatureId, region, bpPerPx, config, height: displayHeight
43
43
  const [isMouseOvered, setIsMouseOvered] = (0, react_1.useState)(false);
44
44
  const [left, right] = (0, util_1.bpSpanPx)(feature.get('start'), feature.get('end'), region, bpPerPx);
45
45
  const featureId = feature.id();
46
- const selected = selectedFeatureId && String(selectedFeatureId) === String(feature.id());
46
+ const selected = selectedFeatureId && selectedFeatureId === feature.id();
47
47
  const stroke = selected ? 'red' : (0, configuration_1.readConfObject)(config, 'color', { feature });
48
48
  const textStroke = selected ? 'red' : 'black';
49
49
  const label = (0, configuration_1.readConfObject)(config, 'label', { feature });
@@ -91,7 +91,7 @@ function SemiCircles({ selectedFeatureId, region, bpPerPx, config, onFeatureClic
91
91
  const [isMouseOvered, setIsMouseOvered] = (0, react_1.useState)(false);
92
92
  const [left, right] = (0, util_1.bpSpanPx)(feature.get('start'), feature.get('end'), region, bpPerPx);
93
93
  const featureId = feature.id();
94
- const selected = selectedFeatureId && String(selectedFeatureId) === String(feature.id());
94
+ const selected = selectedFeatureId && selectedFeatureId === feature.id();
95
95
  const stroke = selected ? 'red' : (0, configuration_1.readConfObject)(config, 'color', { feature });
96
96
  const textStroke = selected ? 'red' : 'black';
97
97
  const label = (0, configuration_1.readConfObject)(config, 'label', { feature });
@@ -172,6 +172,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
172
172
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
173
173
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
174
174
  } & {
175
+ mouseoverExtraInformation: string | undefined;
175
176
  featureIdUnderMouse: undefined | string;
176
177
  contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
177
178
  } & {
@@ -186,9 +187,22 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
186
187
  } & {
187
188
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
188
189
  readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
190
+ readonly layoutFeatures: import("@jbrowse/core/util/compositeMap").default<string, [number, number, number, number] | [number, number, number, number, {
191
+ label?: string;
192
+ description?: string;
193
+ refName: string;
194
+ }]>;
189
195
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
190
- getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
191
- searchFeatureByID(id: string): [number, number, number, number] | undefined;
196
+ getFeatureByID(blockKey: string, id: string): ([number, number, number, number] | [number, number, number, number, {
197
+ label?: string;
198
+ description?: string;
199
+ refName: string;
200
+ }]) | undefined;
201
+ searchFeatureByID(id: string): ([number, number, number, number] | [number, number, number, number, {
202
+ label?: string;
203
+ description?: string;
204
+ refName: string;
205
+ }]) | undefined;
192
206
  } & {
193
207
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
194
208
  deleteBlock(key: string): void;
@@ -197,6 +211,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
197
211
  clearFeatureSelection(): void;
198
212
  setFeatureIdUnderMouse(feature?: string): void;
199
213
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature): void;
214
+ setMouseoverExtraInformation(extra?: string): void;
200
215
  } & {
201
216
  reload(): Promise<void>;
202
217
  } & {
@@ -38,46 +38,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const jsx_runtime_1 = require("react/jsx-runtime");
40
40
  const react_1 = require("react");
41
- const ui_1 = require("@jbrowse/core/ui");
42
41
  const util_1 = require("@jbrowse/core/util");
43
42
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
44
43
  const Refresh_1 = __importDefault(require("@mui/icons-material/Refresh"));
45
44
  const Report_1 = __importDefault(require("@mui/icons-material/Report"));
46
45
  const material_1 = require("@mui/material");
47
46
  const mobx_react_1 = require("mobx-react");
48
- const mui_1 = require("tss-react/mui");
47
+ const LoadingBar_1 = __importDefault(require("./LoadingBar"));
49
48
  const ErrorMessageStackTraceDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@jbrowse/core/ui/ErrorMessageStackTraceDialog'))));
50
- const useStyles = (0, mui_1.makeStyles)()(theme => ({
51
- loading: {
52
- backgroundColor: theme.palette.background.default,
53
- backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${theme.palette.action.disabledBackground} 5px, ${theme.palette.action.disabledBackground} 10px)`,
54
- position: 'absolute',
55
- bottom: 0,
56
- height: 50,
57
- width: 300,
58
- right: 0,
59
- pointerEvents: 'none',
60
- textAlign: 'center',
61
- },
62
- }));
49
+ function ErrorActions({ model }) {
50
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Reload", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "data-testid": "reload_button", onClick: () => {
51
+ model.reload();
52
+ }, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Show stack trace", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
53
+ (0, util_1.getSession)(model).queueDialog(onClose => [
54
+ ErrorMessageStackTraceDialog,
55
+ {
56
+ onClose,
57
+ error: model.error,
58
+ },
59
+ ]);
60
+ }, children: (0, jsx_runtime_1.jsx)(Report_1.default, {}) }) })] }));
61
+ }
63
62
  const BaseDisplayComponent = (0, mobx_react_1.observer)(function ({ model, children, }) {
64
63
  const { error, regionTooLarge } = model;
65
- return error ? ((0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BlockMsg, { message: `${error}`, severity: "error", action: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Reload", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "data-testid": "reload_button", onClick: () => {
66
- model.reload();
67
- }, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Show stack trace", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
68
- (0, util_1.getSession)(model).queueDialog(onClose => [
69
- ErrorMessageStackTraceDialog,
70
- { onClose, error: model.error },
71
- ]);
72
- }, children: (0, jsx_runtime_1.jsx)(Report_1.default, {}) }) })] }) })) : regionTooLarge ? (model.regionCannotBeRendered()) : ((0, jsx_runtime_1.jsx)(DataDisplay, { model: model, children: children }));
64
+ return error ? ((0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BlockMsg, { message: `${error}`, severity: "error", action: (0, jsx_runtime_1.jsx)(ErrorActions, { model: model }) })) : regionTooLarge ? (model.regionCannotBeRendered()) : ((0, jsx_runtime_1.jsx)(DataDisplay, { model: model, children: children }));
73
65
  });
74
66
  const DataDisplay = (0, mobx_react_1.observer)(function ({ model, children, }) {
75
67
  const { loading } = model;
76
- return ((0, jsx_runtime_1.jsxs)("div", { children: [children, loading ? (0, jsx_runtime_1.jsx)(LoadingBar, { model: model }) : null] }));
77
- });
78
- const LoadingBar = (0, mobx_react_1.observer)(function ({ model, }) {
79
- const { classes } = useStyles();
80
- const { message } = model;
81
- return ((0, jsx_runtime_1.jsx)("div", { className: classes.loading, children: (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { message: message }) }));
68
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [children, loading ? (0, jsx_runtime_1.jsx)(LoadingBar_1.default, { model: model }) : null] }));
82
69
  });
83
70
  exports.default = BaseDisplayComponent;
@@ -0,0 +1,5 @@
1
+ import type { LinearArcDisplayModel } from '../model';
2
+ declare const LoadingBar: ({ model, }: {
3
+ model: LinearArcDisplayModel;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default LoadingBar;
@@ -0,0 +1,25 @@
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 mui_1 = require("tss-react/mui");
7
+ const useStyles = (0, mui_1.makeStyles)()(theme => ({
8
+ loading: {
9
+ backgroundColor: theme.palette.background.default,
10
+ backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${theme.palette.action.disabledBackground} 5px, ${theme.palette.action.disabledBackground} 10px)`,
11
+ position: 'absolute',
12
+ bottom: 0,
13
+ height: 50,
14
+ width: 300,
15
+ right: 0,
16
+ pointerEvents: 'none',
17
+ textAlign: 'center',
18
+ },
19
+ }));
20
+ const LoadingBar = (0, mobx_react_1.observer)(function ({ model, }) {
21
+ const { classes } = useStyles();
22
+ const { message } = model;
23
+ return ((0, jsx_runtime_1.jsx)("div", { className: classes.loading, children: (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { message: message }) }));
24
+ });
25
+ exports.default = LoadingBar;
@@ -8,7 +8,7 @@ function Arc({ selectedFeatureId, region, bpPerPx, config, height: displayHeight
8
8
  const [isMouseOvered, setIsMouseOvered] = useState(false);
9
9
  const [left, right] = bpSpanPx(feature.get('start'), feature.get('end'), region, bpPerPx);
10
10
  const featureId = feature.id();
11
- const selected = selectedFeatureId && String(selectedFeatureId) === String(feature.id());
11
+ const selected = selectedFeatureId && selectedFeatureId === feature.id();
12
12
  const stroke = selected ? 'red' : readConfObject(config, 'color', { feature });
13
13
  const textStroke = selected ? 'red' : 'black';
14
14
  const label = readConfObject(config, 'label', { feature });
@@ -56,7 +56,7 @@ function SemiCircles({ selectedFeatureId, region, bpPerPx, config, onFeatureClic
56
56
  const [isMouseOvered, setIsMouseOvered] = useState(false);
57
57
  const [left, right] = bpSpanPx(feature.get('start'), feature.get('end'), region, bpPerPx);
58
58
  const featureId = feature.id();
59
- const selected = selectedFeatureId && String(selectedFeatureId) === String(feature.id());
59
+ const selected = selectedFeatureId && selectedFeatureId === feature.id();
60
60
  const stroke = selected ? 'red' : readConfObject(config, 'color', { feature });
61
61
  const textStroke = selected ? 'red' : 'black';
62
62
  const label = readConfObject(config, 'label', { feature });
@@ -172,6 +172,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
172
172
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
173
173
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
174
174
  } & {
175
+ mouseoverExtraInformation: string | undefined;
175
176
  featureIdUnderMouse: undefined | string;
176
177
  contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
177
178
  } & {
@@ -186,9 +187,22 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
186
187
  } & {
187
188
  readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
188
189
  readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
190
+ readonly layoutFeatures: import("@jbrowse/core/util/compositeMap").default<string, [number, number, number, number] | [number, number, number, number, {
191
+ label?: string;
192
+ description?: string;
193
+ refName: string;
194
+ }]>;
189
195
  getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
190
- getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
191
- searchFeatureByID(id: string): [number, number, number, number] | undefined;
196
+ getFeatureByID(blockKey: string, id: string): ([number, number, number, number] | [number, number, number, number, {
197
+ label?: string;
198
+ description?: string;
199
+ refName: string;
200
+ }]) | undefined;
201
+ searchFeatureByID(id: string): ([number, number, number, number] | [number, number, number, number, {
202
+ label?: string;
203
+ description?: string;
204
+ refName: string;
205
+ }]) | undefined;
192
206
  } & {
193
207
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
194
208
  deleteBlock(key: string): void;
@@ -197,6 +211,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
197
211
  clearFeatureSelection(): void;
198
212
  setFeatureIdUnderMouse(feature?: string): void;
199
213
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature): void;
214
+ setMouseoverExtraInformation(extra?: string): void;
200
215
  } & {
201
216
  reload(): Promise<void>;
202
217
  } & {
@@ -1,45 +1,32 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { lazy } from 'react';
3
- import { LoadingEllipses } from '@jbrowse/core/ui';
4
3
  import { getSession } from '@jbrowse/core/util';
5
4
  import { BlockMsg } from '@jbrowse/plugin-linear-genome-view';
6
5
  import RefreshIcon from '@mui/icons-material/Refresh';
7
6
  import ReportIcon from '@mui/icons-material/Report';
8
7
  import { IconButton, Tooltip } from '@mui/material';
9
8
  import { observer } from 'mobx-react';
10
- import { makeStyles } from 'tss-react/mui';
9
+ import LoadingBar from './LoadingBar';
11
10
  const ErrorMessageStackTraceDialog = lazy(() => import('@jbrowse/core/ui/ErrorMessageStackTraceDialog'));
12
- const useStyles = makeStyles()(theme => ({
13
- loading: {
14
- backgroundColor: theme.palette.background.default,
15
- backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${theme.palette.action.disabledBackground} 5px, ${theme.palette.action.disabledBackground} 10px)`,
16
- position: 'absolute',
17
- bottom: 0,
18
- height: 50,
19
- width: 300,
20
- right: 0,
21
- pointerEvents: 'none',
22
- textAlign: 'center',
23
- },
24
- }));
11
+ function ErrorActions({ model }) {
12
+ return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "Reload", children: _jsx(IconButton, { "data-testid": "reload_button", onClick: () => {
13
+ model.reload();
14
+ }, children: _jsx(RefreshIcon, {}) }) }), _jsx(Tooltip, { title: "Show stack trace", children: _jsx(IconButton, { onClick: () => {
15
+ getSession(model).queueDialog(onClose => [
16
+ ErrorMessageStackTraceDialog,
17
+ {
18
+ onClose,
19
+ error: model.error,
20
+ },
21
+ ]);
22
+ }, children: _jsx(ReportIcon, {}) }) })] }));
23
+ }
25
24
  const BaseDisplayComponent = observer(function ({ model, children, }) {
26
25
  const { error, regionTooLarge } = model;
27
- return error ? (_jsx(BlockMsg, { message: `${error}`, severity: "error", action: _jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "Reload", children: _jsx(IconButton, { "data-testid": "reload_button", onClick: () => {
28
- model.reload();
29
- }, children: _jsx(RefreshIcon, {}) }) }), _jsx(Tooltip, { title: "Show stack trace", children: _jsx(IconButton, { onClick: () => {
30
- getSession(model).queueDialog(onClose => [
31
- ErrorMessageStackTraceDialog,
32
- { onClose, error: model.error },
33
- ]);
34
- }, children: _jsx(ReportIcon, {}) }) })] }) })) : regionTooLarge ? (model.regionCannotBeRendered()) : (_jsx(DataDisplay, { model: model, children: children }));
26
+ return error ? (_jsx(BlockMsg, { message: `${error}`, severity: "error", action: _jsx(ErrorActions, { model: model }) })) : regionTooLarge ? (model.regionCannotBeRendered()) : (_jsx(DataDisplay, { model: model, children: children }));
35
27
  });
36
28
  const DataDisplay = observer(function ({ model, children, }) {
37
29
  const { loading } = model;
38
30
  return (_jsxs("div", { children: [children, loading ? _jsx(LoadingBar, { model: model }) : null] }));
39
31
  });
40
- const LoadingBar = observer(function ({ model, }) {
41
- const { classes } = useStyles();
42
- const { message } = model;
43
- return (_jsx("div", { className: classes.loading, children: _jsx(LoadingEllipses, { message: message }) }));
44
- });
45
32
  export default BaseDisplayComponent;
@@ -0,0 +1,5 @@
1
+ import type { LinearArcDisplayModel } from '../model';
2
+ declare const LoadingBar: ({ model, }: {
3
+ model: LinearArcDisplayModel;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default LoadingBar;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LoadingEllipses } from '@jbrowse/core/ui';
3
+ import { observer } from 'mobx-react';
4
+ import { makeStyles } from 'tss-react/mui';
5
+ const useStyles = makeStyles()(theme => ({
6
+ loading: {
7
+ backgroundColor: theme.palette.background.default,
8
+ backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${theme.palette.action.disabledBackground} 5px, ${theme.palette.action.disabledBackground} 10px)`,
9
+ position: 'absolute',
10
+ bottom: 0,
11
+ height: 50,
12
+ width: 300,
13
+ right: 0,
14
+ pointerEvents: 'none',
15
+ textAlign: 'center',
16
+ },
17
+ }));
18
+ const LoadingBar = observer(function ({ model, }) {
19
+ const { classes } = useStyles();
20
+ const { message } = model;
21
+ return (_jsx("div", { className: classes.loading, children: _jsx(LoadingEllipses, { message: message }) }));
22
+ });
23
+ export default LoadingBar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-arc",
3
- "version": "3.6.4",
3
+ "version": "3.7.0",
4
4
  "description": "JBrowse 2 arc adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -36,9 +36,9 @@
36
36
  "clean": "rimraf dist esm *.tsbuildinfo"
37
37
  },
38
38
  "dependencies": {
39
- "@jbrowse/core": "^3.6.4",
40
- "@jbrowse/plugin-linear-genome-view": "^3.6.4",
41
- "@jbrowse/plugin-wiggle": "^3.6.4",
39
+ "@jbrowse/core": "^3.7.0",
40
+ "@jbrowse/plugin-linear-genome-view": "^3.7.0",
41
+ "@jbrowse/plugin-wiggle": "^3.7.0",
42
42
  "@mui/material": "^7.0.0",
43
43
  "mobx": "^6.0.0",
44
44
  "mobx-react": "^9.0.0",
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "3db8e50ce2bd9c081efbf6c2e7ae5f342380a25a"
58
+ "gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
59
59
  }