@jbrowse/plugin-linear-genome-view 3.4.0 → 3.5.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.
@@ -206,7 +206,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
206
206
  } & {
207
207
  addBlock(key: string, block: BaseBlock): void;
208
208
  deleteBlock(key: string): void;
209
- selectFeature(feature: Feature): Promise<void>;
209
+ selectFeature(feature: Feature): void;
210
210
  navToFeature(feature: Feature): void;
211
211
  clearFeatureSelection(): void;
212
212
  setFeatureIdUnderMouse(feature?: string): void;
@@ -138,7 +138,7 @@ function stateModelFactory() {
138
138
  deleteBlock(key) {
139
139
  self.blockState.delete(key);
140
140
  },
141
- async selectFeature(feature) {
141
+ selectFeature(feature) {
142
142
  const session = (0, util_1.getSession)(self);
143
143
  if ((0, util_1.isSessionModelWithWidgets)(session)) {
144
144
  const { rpcManager } = session;
@@ -146,15 +146,23 @@ function stateModelFactory() {
146
146
  const track = (0, util_1.getContainingTrack)(self);
147
147
  const view = (0, util_1.getContainingView)(self);
148
148
  const adapterConfig = (0, configuration_1.getConf)(track, 'adapter');
149
- const descriptions = await rpcManager.call(sessionId, 'CoreGetMetadata', {
150
- adapterConfig,
151
- });
152
- session.showWidget(session.addWidget('BaseFeatureWidget', 'baseFeature', {
153
- featureData: feature.toJSON(),
154
- view,
155
- track,
156
- descriptions,
157
- }));
149
+ (async () => {
150
+ try {
151
+ const descriptions = await rpcManager.call(sessionId, 'CoreGetMetadata', {
152
+ adapterConfig,
153
+ });
154
+ session.showWidget(session.addWidget('BaseFeatureWidget', 'baseFeature', {
155
+ featureData: feature.toJSON(),
156
+ view,
157
+ track,
158
+ descriptions,
159
+ }));
160
+ }
161
+ catch (e) {
162
+ console.error(e);
163
+ (0, util_1.getSession)(e).notifyError(`${e}`, e);
164
+ }
165
+ })();
158
166
  }
159
167
  if ((0, util_1.isSelectionContainer)(session)) {
160
168
  session.setSelection(feature);
@@ -205,11 +213,7 @@ function stateModelFactory() {
205
213
  icon: MenuOpen_1.default,
206
214
  onClick: () => {
207
215
  if (self.contextMenuFeature) {
208
- self
209
- .selectFeature(self.contextMenuFeature)
210
- .catch((e) => {
211
- (0, util_1.getSession)(e).notifyError(`${e}`, e);
212
- });
216
+ self.selectFeature(self.contextMenuFeature);
213
217
  }
214
218
  },
215
219
  },
@@ -240,9 +244,7 @@ function stateModelFactory() {
240
244
  else {
241
245
  const feature = self.features.get(f);
242
246
  if (feature) {
243
- self.selectFeature(feature).catch((e) => {
244
- (0, util_1.getSession)(e).notifyError(`${e}`, e);
245
- });
247
+ self.selectFeature(feature);
246
248
  }
247
249
  }
248
250
  },
@@ -190,7 +190,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
190
190
  } & {
191
191
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
192
192
  deleteBlock(key: string): void;
193
- selectFeature(feature: import("@jbrowse/core/util").Feature): Promise<void>;
193
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
194
194
  navToFeature(feature: import("@jbrowse/core/util").Feature): void;
195
195
  clearFeatureSelection(): void;
196
196
  setFeatureIdUnderMouse(feature?: string): void;
@@ -198,7 +198,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
198
198
  } & {
199
199
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
200
200
  deleteBlock(key: string): void;
201
- selectFeature(feature: import("@jbrowse/core/util").Feature): Promise<void>;
201
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
202
202
  navToFeature(feature: import("@jbrowse/core/util").Feature): void;
203
203
  clearFeatureSelection(): void;
204
204
  setFeatureIdUnderMouse(feature?: string): void;
@@ -16,9 +16,6 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
16
16
  color: theme.palette.text.primary,
17
17
  margin: consts_1.SPACING,
18
18
  },
19
- buttonSpacer: {
20
- marginRight: theme.spacing(2),
21
- },
22
19
  }));
23
20
  function HeaderPanControls({ model }) {
24
21
  const { classes } = useStyles();
@@ -17,6 +17,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
17
17
  position: 'absolute',
18
18
  right: 0,
19
19
  background: theme.palette.background.paper,
20
+ zIndex: 2,
20
21
  },
21
22
  focusedBackground: {
22
23
  background: (0, material_1.alpha)(theme.palette.secondary.light, 0.2),
@@ -17,6 +17,7 @@ const TrackLabelDragHandle_1 = __importDefault(require("./TrackLabelDragHandle")
17
17
  const TrackLabelMenu_1 = __importDefault(require("./TrackLabelMenu"));
18
18
  const useStyles = (0, mui_1.makeStyles)()(theme => ({
19
19
  root: {
20
+ zIndex: 200,
20
21
  background: (0, material_1.alpha)(theme.palette.background.paper, 0.8),
21
22
  '&:hover': {
22
23
  background: theme.palette.background.paper,
@@ -22,16 +22,9 @@ const TrackLabelMenu = (0, mobx_react_1.observer)(function ({ track, }) {
22
22
  const trackConf = track.configuration;
23
23
  const minimized = track.minimized;
24
24
  const pinned = track.pinned;
25
- let lgvHasParentView;
26
- try {
27
- (0, util_1.getContainingView)(view);
28
- lgvHasParentView = true;
29
- }
30
- catch (error) {
31
- lgvHasParentView = false;
32
- }
25
+ const { isTopLevelView } = view;
33
26
  const items = [
34
- ...(lgvHasParentView
27
+ ...(isTopLevelView
35
28
  ? []
36
29
  : [
37
30
  {
@@ -58,7 +58,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
58
58
  readonly width: number;
59
59
  readonly interRegionPaddingWidth: number;
60
60
  readonly assemblyNames: string[];
61
- readonly stickyViewHeaders: boolean;
61
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
62
+ readonly stickyViewHeaders: boolean | undefined;
62
63
  readonly rubberbandTop: number;
63
64
  readonly pinnedTracksTop: number;
64
65
  } & {
@@ -136,10 +136,14 @@ function stateModelFactory(pluginManager) {
136
136
  ...new Set(self.displayedRegions.map(region => region.assemblyName)),
137
137
  ];
138
138
  },
139
+ get isTopLevelView() {
140
+ const session = (0, util_1.getSession)(self);
141
+ return session.views.find(r => r.id === self.id);
142
+ },
139
143
  get stickyViewHeaders() {
140
144
  const session = (0, util_1.getSession)(self);
141
145
  return (0, product_core_1.isSessionWithMultipleViews)(session)
142
- ? session.stickyViewHeaders
146
+ ? this.isTopLevelView && session.stickyViewHeaders
143
147
  : false;
144
148
  },
145
149
  get rubberbandTop() {
package/dist/index.d.ts CHANGED
@@ -195,7 +195,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
195
195
  } & {
196
196
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
197
197
  deleteBlock(key: string): void;
198
- selectFeature(feature: import("@jbrowse/core/util").Feature): Promise<void>;
198
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
199
199
  navToFeature(feature: import("@jbrowse/core/util").Feature): void;
200
200
  clearFeatureSelection(): void;
201
201
  setFeatureIdUnderMouse(feature?: string): void;
@@ -206,7 +206,7 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
206
206
  } & {
207
207
  addBlock(key: string, block: BaseBlock): void;
208
208
  deleteBlock(key: string): void;
209
- selectFeature(feature: Feature): Promise<void>;
209
+ selectFeature(feature: Feature): void;
210
210
  navToFeature(feature: Feature): void;
211
211
  clearFeatureSelection(): void;
212
212
  setFeatureIdUnderMouse(feature?: string): void;
@@ -99,7 +99,7 @@ function stateModelFactory() {
99
99
  deleteBlock(key) {
100
100
  self.blockState.delete(key);
101
101
  },
102
- async selectFeature(feature) {
102
+ selectFeature(feature) {
103
103
  const session = getSession(self);
104
104
  if (isSessionModelWithWidgets(session)) {
105
105
  const { rpcManager } = session;
@@ -107,15 +107,23 @@ function stateModelFactory() {
107
107
  const track = getContainingTrack(self);
108
108
  const view = getContainingView(self);
109
109
  const adapterConfig = getConf(track, 'adapter');
110
- const descriptions = await rpcManager.call(sessionId, 'CoreGetMetadata', {
111
- adapterConfig,
112
- });
113
- session.showWidget(session.addWidget('BaseFeatureWidget', 'baseFeature', {
114
- featureData: feature.toJSON(),
115
- view,
116
- track,
117
- descriptions,
118
- }));
110
+ (async () => {
111
+ try {
112
+ const descriptions = await rpcManager.call(sessionId, 'CoreGetMetadata', {
113
+ adapterConfig,
114
+ });
115
+ session.showWidget(session.addWidget('BaseFeatureWidget', 'baseFeature', {
116
+ featureData: feature.toJSON(),
117
+ view,
118
+ track,
119
+ descriptions,
120
+ }));
121
+ }
122
+ catch (e) {
123
+ console.error(e);
124
+ getSession(e).notifyError(`${e}`, e);
125
+ }
126
+ })();
119
127
  }
120
128
  if (isSelectionContainer(session)) {
121
129
  session.setSelection(feature);
@@ -166,11 +174,7 @@ function stateModelFactory() {
166
174
  icon: MenuOpenIcon,
167
175
  onClick: () => {
168
176
  if (self.contextMenuFeature) {
169
- self
170
- .selectFeature(self.contextMenuFeature)
171
- .catch((e) => {
172
- getSession(e).notifyError(`${e}`, e);
173
- });
177
+ self.selectFeature(self.contextMenuFeature);
174
178
  }
175
179
  },
176
180
  },
@@ -201,9 +205,7 @@ function stateModelFactory() {
201
205
  else {
202
206
  const feature = self.features.get(f);
203
207
  if (feature) {
204
- self.selectFeature(feature).catch((e) => {
205
- getSession(e).notifyError(`${e}`, e);
206
- });
208
+ self.selectFeature(feature);
207
209
  }
208
210
  }
209
211
  },
@@ -190,7 +190,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
190
190
  } & {
191
191
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
192
192
  deleteBlock(key: string): void;
193
- selectFeature(feature: import("@jbrowse/core/util").Feature): Promise<void>;
193
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
194
194
  navToFeature(feature: import("@jbrowse/core/util").Feature): void;
195
195
  clearFeatureSelection(): void;
196
196
  setFeatureIdUnderMouse(feature?: string): void;
@@ -198,7 +198,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
198
198
  } & {
199
199
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
200
200
  deleteBlock(key: string): void;
201
- selectFeature(feature: import("@jbrowse/core/util").Feature): Promise<void>;
201
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
202
202
  navToFeature(feature: import("@jbrowse/core/util").Feature): void;
203
203
  clearFeatureSelection(): void;
204
204
  setFeatureIdUnderMouse(feature?: string): void;
@@ -10,9 +10,6 @@ const useStyles = makeStyles()(theme => ({
10
10
  color: theme.palette.text.primary,
11
11
  margin: SPACING,
12
12
  },
13
- buttonSpacer: {
14
- marginRight: theme.spacing(2),
15
- },
16
13
  }));
17
14
  export default function HeaderPanControls({ model }) {
18
15
  const { classes } = useStyles();
@@ -12,6 +12,7 @@ const useStyles = makeStyles()(theme => ({
12
12
  position: 'absolute',
13
13
  right: 0,
14
14
  background: theme.palette.background.paper,
15
+ zIndex: 2,
15
16
  },
16
17
  focusedBackground: {
17
18
  background: alpha(theme.palette.secondary.light, 0.2),
@@ -12,6 +12,7 @@ import TrackLabelDragHandle from './TrackLabelDragHandle';
12
12
  import TrackLabelMenu from './TrackLabelMenu';
13
13
  const useStyles = makeStyles()(theme => ({
14
14
  root: {
15
+ zIndex: 200,
15
16
  background: alpha(theme.palette.background.paper, 0.8),
16
17
  '&:hover': {
17
18
  background: theme.palette.background.paper,
@@ -17,16 +17,9 @@ const TrackLabelMenu = observer(function ({ track, }) {
17
17
  const trackConf = track.configuration;
18
18
  const minimized = track.minimized;
19
19
  const pinned = track.pinned;
20
- let lgvHasParentView;
21
- try {
22
- getContainingView(view);
23
- lgvHasParentView = true;
24
- }
25
- catch (error) {
26
- lgvHasParentView = false;
27
- }
20
+ const { isTopLevelView } = view;
28
21
  const items = [
29
- ...(lgvHasParentView
22
+ ...(isTopLevelView
30
23
  ? []
31
24
  : [
32
25
  {
@@ -58,7 +58,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
58
58
  readonly width: number;
59
59
  readonly interRegionPaddingWidth: number;
60
60
  readonly assemblyNames: string[];
61
- readonly stickyViewHeaders: boolean;
61
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
62
+ readonly stickyViewHeaders: boolean | undefined;
62
63
  readonly rubberbandTop: number;
63
64
  readonly pinnedTracksTop: number;
64
65
  } & {
@@ -96,10 +96,14 @@ export function stateModelFactory(pluginManager) {
96
96
  ...new Set(self.displayedRegions.map(region => region.assemblyName)),
97
97
  ];
98
98
  },
99
+ get isTopLevelView() {
100
+ const session = getSession(self);
101
+ return session.views.find(r => r.id === self.id);
102
+ },
99
103
  get stickyViewHeaders() {
100
104
  const session = getSession(self);
101
105
  return isSessionWithMultipleViews(session)
102
- ? session.stickyViewHeaders
106
+ ? this.isTopLevelView && session.stickyViewHeaders
103
107
  : false;
104
108
  },
105
109
  get rubberbandTop() {
package/esm/index.d.ts CHANGED
@@ -195,7 +195,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
195
195
  } & {
196
196
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
197
197
  deleteBlock(key: string): void;
198
- selectFeature(feature: import("@jbrowse/core/util").Feature): Promise<void>;
198
+ selectFeature(feature: import("@jbrowse/core/util").Feature): void;
199
199
  navToFeature(feature: import("@jbrowse/core/util").Feature): void;
200
200
  clearFeatureSelection(): void;
201
201
  setFeatureIdUnderMouse(feature?: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "3.4.0",
3
+ "version": "3.5.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.4.0",
41
+ "@jbrowse/core": "^3.5.0",
42
42
  "@mui/icons-material": "^7.0.0",
43
43
  "@mui/material": "^7.0.0",
44
44
  "@types/file-saver": "^2.0.1",
@@ -58,5 +58,5 @@
58
58
  "access": "public"
59
59
  },
60
60
  "module": "esm/index.js",
61
- "gitHead": "a9f1ac35fc2dd810bae92cdaf1fc19995bee4413"
61
+ "gitHead": "8a8aa0aab2229dece106a5715a767e649e2fe92b"
62
62
  }