@jbrowse/plugin-linear-genome-view 2.11.0 → 2.11.2

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 (73) hide show
  1. package/dist/BaseLinearDisplay/components/LinearBlocks.js +7 -7
  2. package/dist/BaseLinearDisplay/components/Tooltip.js +1 -0
  3. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +17 -1
  4. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +21 -0
  5. package/dist/BaseLinearDisplay/models/configSchema.d.ts +10 -0
  6. package/dist/BaseLinearDisplay/models/configSchema.js +15 -3
  7. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -0
  8. package/dist/BasicTrack/index.d.ts +1 -2
  9. package/dist/BasicTrack/index.js +3 -2
  10. package/dist/FeatureTrack/index.d.ts +1 -2
  11. package/dist/FeatureTrack/index.js +3 -2
  12. package/dist/LaunchLinearGenomeView/index.d.ts +1 -2
  13. package/dist/LaunchLinearGenomeView/index.js +3 -2
  14. package/dist/LinearBareDisplay/configSchema.d.ts +5 -0
  15. package/dist/LinearBareDisplay/index.d.ts +1 -2
  16. package/dist/LinearBareDisplay/index.js +3 -2
  17. package/dist/LinearBareDisplay/model.d.ts +17 -2
  18. package/dist/LinearBasicDisplay/components/AddFiltersDialog.d.ts +10 -0
  19. package/dist/LinearBasicDisplay/components/AddFiltersDialog.js +94 -0
  20. package/dist/LinearBasicDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +7 -7
  21. package/dist/LinearBasicDisplay/configSchema.d.ts +5 -0
  22. package/dist/LinearBasicDisplay/index.d.ts +1 -2
  23. package/dist/LinearBasicDisplay/index.js +3 -2
  24. package/dist/LinearBasicDisplay/model.d.ts +56 -21
  25. package/dist/LinearBasicDisplay/model.js +36 -5
  26. package/dist/LinearGenomeView/components/Cytobands.js +11 -12
  27. package/dist/LinearGenomeView/components/Gridlines.js +3 -4
  28. package/dist/LinearGenomeView/components/Highlight.js +20 -21
  29. package/dist/LinearGenomeView/components/OverviewScalebar.js +1 -2
  30. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.js +2 -1
  31. package/dist/LinearGenomeView/components/Scalebar.js +4 -5
  32. package/dist/LinearGenomeView/model.d.ts +1 -0
  33. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +1 -1
  34. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +1 -1
  35. package/dist/index.d.ts +39 -0
  36. package/esm/BaseLinearDisplay/components/LinearBlocks.js +7 -7
  37. package/esm/BaseLinearDisplay/components/Tooltip.js +1 -0
  38. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +17 -1
  39. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +21 -0
  40. package/esm/BaseLinearDisplay/models/configSchema.d.ts +10 -0
  41. package/esm/BaseLinearDisplay/models/configSchema.js +15 -3
  42. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -0
  43. package/esm/BasicTrack/index.d.ts +1 -2
  44. package/esm/BasicTrack/index.js +2 -2
  45. package/esm/FeatureTrack/index.d.ts +1 -2
  46. package/esm/FeatureTrack/index.js +2 -2
  47. package/esm/LaunchLinearGenomeView/index.d.ts +1 -2
  48. package/esm/LaunchLinearGenomeView/index.js +2 -2
  49. package/esm/LinearBareDisplay/configSchema.d.ts +5 -0
  50. package/esm/LinearBareDisplay/index.d.ts +1 -2
  51. package/esm/LinearBareDisplay/index.js +2 -2
  52. package/esm/LinearBareDisplay/model.d.ts +17 -2
  53. package/esm/LinearBasicDisplay/components/AddFiltersDialog.d.ts +10 -0
  54. package/esm/LinearBasicDisplay/components/AddFiltersDialog.js +69 -0
  55. package/esm/LinearBasicDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +7 -7
  56. package/esm/LinearBasicDisplay/configSchema.d.ts +5 -0
  57. package/esm/LinearBasicDisplay/index.d.ts +1 -2
  58. package/esm/LinearBasicDisplay/index.js +2 -2
  59. package/esm/LinearBasicDisplay/model.d.ts +56 -21
  60. package/esm/LinearBasicDisplay/model.js +37 -6
  61. package/esm/LinearGenomeView/components/Cytobands.js +11 -12
  62. package/esm/LinearGenomeView/components/Gridlines.js +3 -4
  63. package/esm/LinearGenomeView/components/Highlight.js +20 -21
  64. package/esm/LinearGenomeView/components/OverviewScalebar.js +1 -2
  65. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +2 -1
  66. package/esm/LinearGenomeView/components/Scalebar.js +4 -5
  67. package/esm/LinearGenomeView/model.d.ts +1 -0
  68. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +1 -1
  69. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +2 -2
  70. package/esm/index.d.ts +39 -0
  71. package/package.json +2 -2
  72. /package/dist/LinearBasicDisplay/components/{SetMaxHeight.d.ts → SetMaxHeightDialog.d.ts} +0 -0
  73. /package/esm/LinearBasicDisplay/components/{SetMaxHeight.d.ts → SetMaxHeightDialog.d.ts} +0 -0
@@ -2,6 +2,7 @@
2
2
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
3
  import { MenuItem } from '@jbrowse/core/ui';
4
4
  import { Instance } from 'mobx-state-tree';
5
+ import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
5
6
  /**
6
7
  * #stateModel LinearBasicDisplay
7
8
  * #category display
@@ -50,11 +51,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
50
51
  model: {
51
52
  error?: unknown;
52
53
  reload: () => void;
53
- message: import("react").ReactNode;
54
- filled?: boolean | undefined;
55
- status?: string | undefined; /**
56
- * #getter
54
+ message: import("react").ReactNode; /**
55
+ * #property
57
56
  */
57
+ filled?: boolean | undefined;
58
+ status?: string | undefined;
58
59
  reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
59
60
  };
60
61
  }) => import("react").JSX.Element | undefined;
@@ -63,7 +64,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
63
64
  doReload(): void;
64
65
  afterAttach(): void;
65
66
  setStatus(message: string): void;
66
- setLoading(abortController: AbortController): void;
67
+ setLoading(abortController: AbortController): void; /**
68
+ * #getter
69
+ */
67
70
  setMessage(messageText: string): void;
68
71
  setRendered(props: {
69
72
  reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -94,10 +97,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
94
97
  };
95
98
  mouseover: {
96
99
  type: string;
97
- description: string;
100
+ description: string; /**
101
+ * #property
102
+ */
98
103
  defaultValue: string;
99
104
  contextVariable: string[];
100
105
  };
106
+ jexlFilters: {
107
+ type: string;
108
+ description: string;
109
+ defaultValue: never[];
110
+ };
101
111
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
102
112
  } & {
103
113
  /**
@@ -124,6 +134,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
124
134
  * #property
125
135
  */
126
136
  configuration: AnyConfigurationSchemaType;
137
+ /**
138
+ * #property
139
+ */
140
+ jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
127
141
  }, {
128
142
  rendererTypeName: string;
129
143
  error: unknown;
@@ -140,7 +154,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
140
154
  message: string | undefined;
141
155
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
142
156
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
143
- type: import("mobx-state-tree").ISimpleType<string>;
157
+ type: import("mobx-state-tree").ISimpleType<string>; /**
158
+ * #property
159
+ */
144
160
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
145
161
  }, {
146
162
  rendererTypeName: string;
@@ -166,11 +182,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
166
182
  }, {
167
183
  rendererTypeName: string;
168
184
  error: unknown;
169
- message: string | undefined; /**
170
- * #action
171
- */
185
+ message: string | undefined;
172
186
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
173
- }> | null;
187
+ }> | null; /**
188
+ * #getter
189
+ */
174
190
  readonly adapterConfig: any;
175
191
  readonly parentTrack: any;
176
192
  renderProps(): any;
@@ -208,13 +224,13 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
208
224
  setCurrStatsBpPerPx(n: number): void;
209
225
  setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
210
226
  getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
211
- setFeatureDensityStatsP(arg: any): void; /**
212
- * #method
213
- */
227
+ setFeatureDensityStatsP(arg: any): void;
214
228
  setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
215
229
  clearFeatureDensityStats(): void;
216
230
  } & {
217
- readonly regionTooLarge: boolean;
231
+ readonly regionTooLarge: boolean; /**
232
+ * #method
233
+ */
218
234
  readonly regionTooLargeReason: string;
219
235
  } & {
220
236
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
@@ -240,6 +256,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
240
256
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
241
257
  deleteBlock(key: string): void;
242
258
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
259
+ navToFeature(feature: import("@jbrowse/core/util").Feature): void;
243
260
  clearFeatureSelection(): void;
244
261
  setFeatureIdUnderMouse(feature?: string | undefined): void;
245
262
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
@@ -253,6 +270,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
253
270
  renderSvg(opts: import("../BaseLinearDisplay").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
254
271
  afterAttach(): void;
255
272
  } & {
273
+ /**
274
+ * #getter
275
+ */
276
+ readonly activeFilters: any;
256
277
  /**
257
278
  * #getter
258
279
  */
@@ -283,6 +304,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
283
304
  setSubschema(slotName: string, data: unknown): any;
284
305
  } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
285
306
  } & {
307
+ /**
308
+ * #action
309
+ */
310
+ setJexlFilters(f?: string[]): void;
286
311
  /**
287
312
  * #action
288
313
  */
@@ -309,6 +334,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
309
334
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
310
335
  setSubschema(slotName: string, data: unknown): any;
311
336
  } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
337
+ filters: SerializableFilterChain;
312
338
  };
313
339
  /**
314
340
  * #method
@@ -355,11 +381,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
355
381
  model: {
356
382
  error?: unknown;
357
383
  reload: () => void;
358
- message: import("react").ReactNode;
359
- filled?: boolean | undefined;
360
- status?: string | undefined; /**
361
- * #getter
384
+ message: import("react").ReactNode; /**
385
+ * #property
362
386
  */
387
+ filled?: boolean | undefined;
388
+ status?: string | undefined;
363
389
  reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
364
390
  };
365
391
  }) => import("react").JSX.Element | undefined;
@@ -368,7 +394,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
368
394
  doReload(): void;
369
395
  afterAttach(): void;
370
396
  setStatus(message: string): void;
371
- setLoading(abortController: AbortController): void;
397
+ setLoading(abortController: AbortController): void; /**
398
+ * #getter
399
+ */
372
400
  setMessage(messageText: string): void;
373
401
  setRendered(props: {
374
402
  reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -399,10 +427,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
399
427
  };
400
428
  mouseover: {
401
429
  type: string;
402
- description: string;
430
+ description: string; /**
431
+ * #property
432
+ */
403
433
  defaultValue: string;
404
434
  contextVariable: string[];
405
435
  };
436
+ jexlFilters: {
437
+ type: string;
438
+ description: string;
439
+ defaultValue: never[];
440
+ };
406
441
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
407
442
  }>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
408
443
  type: string;
@@ -1,12 +1,14 @@
1
1
  import { lazy } from 'react';
2
2
  import { getConf, ConfigurationReference, } from '@jbrowse/core/configuration';
3
3
  import { getSession } from '@jbrowse/core/util';
4
- import { types, getEnv } from 'mobx-state-tree';
4
+ import { types, getEnv, cast } from 'mobx-state-tree';
5
5
  // icons
6
6
  import VisibilityIcon from '@mui/icons-material/Visibility';
7
7
  // locals
8
8
  import { BaseLinearDisplay } from '../BaseLinearDisplay';
9
- const SetMaxHeightDialog = lazy(() => import('./components/SetMaxHeight'));
9
+ import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
10
+ const SetMaxHeightDialog = lazy(() => import('./components/SetMaxHeightDialog'));
11
+ const AddFiltersDialog = lazy(() => import('./components/AddFiltersDialog'));
10
12
  /**
11
13
  * #stateModel LinearBasicDisplay
12
14
  * #category display
@@ -43,8 +45,21 @@ function stateModelFactory(configSchema) {
43
45
  * #property
44
46
  */
45
47
  configuration: ConfigurationReference(configSchema),
48
+ /**
49
+ * #property
50
+ */
51
+ jexlFilters: types.maybe(types.array(types.string)),
46
52
  }))
47
53
  .views(self => ({
54
+ /**
55
+ * #getter
56
+ */
57
+ get activeFilters() {
58
+ var _a;
59
+ // config jexlFilters are deferred evaluated so they are prepended with
60
+ // jexl at runtime rather than being stored with jexl in the config
61
+ return ((_a = self.jexlFilters) !== null && _a !== void 0 ? _a : getConf(self, 'jexlFilters').map((r) => `jexl:${r}`));
62
+ },
48
63
  /**
49
64
  * #getter
50
65
  */
@@ -97,6 +112,12 @@ function stateModelFactory(configSchema) {
97
112
  },
98
113
  }))
99
114
  .actions(self => ({
115
+ /**
116
+ * #action
117
+ */
118
+ setJexlFilters(f) {
119
+ self.jexlFilters = cast(f);
120
+ },
100
121
  /**
101
122
  * #action
102
123
  */
@@ -129,12 +150,13 @@ function stateModelFactory(configSchema) {
129
150
  * #method
130
151
  */
131
152
  renderProps() {
132
- const config = self.rendererConfig;
133
153
  const superProps = superRenderProps();
134
- const superPropsOmit = superProps;
135
154
  return {
136
- ...superPropsOmit,
137
- config,
155
+ ...superProps,
156
+ config: self.rendererConfig,
157
+ filters: new SerializableFilterChain({
158
+ filters: self.activeFilters,
159
+ }),
138
160
  };
139
161
  },
140
162
  /**
@@ -179,6 +201,15 @@ function stateModelFactory(configSchema) {
179
201
  ]);
180
202
  },
181
203
  },
204
+ {
205
+ label: 'Edit filters',
206
+ onClick: () => {
207
+ getSession(self).queueDialog(handleClose => [
208
+ AddFiltersDialog,
209
+ { model: self, handleClose },
210
+ ]);
211
+ },
212
+ },
182
213
  ];
183
214
  },
184
215
  };
@@ -3,6 +3,7 @@ import { observer } from 'mobx-react';
3
3
  // locals
4
4
  import { HEADER_OVERVIEW_HEIGHT } from '..';
5
5
  import { getCytobands } from './util';
6
+ import { getFillProps } from '@jbrowse/core/util';
6
7
  // rounded rect from https://stackoverflow.com/a/45889603/2129219
7
8
  // prettier-ignore
8
9
  function rightRoundedRect(x, y, width, height, radius) {
@@ -63,28 +64,26 @@ const Cytobands = observer(function ({ overview, block, assembly, }) {
63
64
  const e = overview.bpToPx({ refName, coord: end }) || 0;
64
65
  const l = Math.min(s, e);
65
66
  const w = Math.abs(e - s);
66
- const c = colorMap[type];
67
+ const c = colorMap[type] || 'black';
67
68
  if (type === 'acen' && !centromereSeen) {
68
69
  centromereSeen = true; // the next acen entry is drawn with different right triangle
69
- const tri = reversed
70
- ? rightTriangle(s - w, 0, w, h)
71
- : leftTriangle(s, 0, w, h);
72
- return React.createElement("polygon", { key: k, points: tri, fill: c });
70
+ return (React.createElement("polygon", { key: k, points: reversed
71
+ ? rightTriangle(s - w, 0, w, h)
72
+ : leftTriangle(s, 0, w, h), ...getFillProps(c) }));
73
73
  }
74
74
  else if (type === 'acen' && centromereSeen) {
75
- const tri = reversed
76
- ? leftTriangle(s - w, 0, w, h)
77
- : rightTriangle(s, 0, w, h);
78
- return React.createElement("polygon", { key: k, points: tri, fill: c });
75
+ return (React.createElement("polygon", { key: k, points: reversed
76
+ ? leftTriangle(s - w, 0, w, h)
77
+ : rightTriangle(s, 0, w, h), ...getFillProps(c) }));
79
78
  }
80
79
  else if (lcap === index) {
81
- return React.createElement("path", { key: k, d: leftRoundedRect(l, 0, w, h, 8), fill: c });
80
+ return (React.createElement("path", { key: k, d: leftRoundedRect(l, 0, w, h, 8), ...getFillProps(c) }));
82
81
  }
83
82
  else if (rcap === index) {
84
- return React.createElement("path", { key: k, d: rightRoundedRect(l, 0, w, h, 8), fill: c });
83
+ return (React.createElement("path", { key: k, d: rightRoundedRect(l, 0, w, h, 8), ...getFillProps(c) }));
85
84
  }
86
85
  else {
87
- return React.createElement("rect", { key: k, x: l, y: 0, width: w, height: h, fill: c });
86
+ return (React.createElement("rect", { key: k, x: l, y: 0, width: w, height: h, ...getFillProps(c) }));
88
87
  }
89
88
  })));
90
89
  });
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ContentBlock, ElidedBlock, InterRegionPaddingBlock, } from '@jbrowse/core/util/blockTypes';
3
2
  import { makeStyles } from 'tss-react/mui';
4
3
  import { observer } from 'mobx-react';
5
4
  import { ContentBlock as ContentBlockComponent, ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from '../../BaseLinearDisplay/components/Block';
@@ -45,13 +44,13 @@ const RenderedVerticalGuides = observer(({ model }) => {
45
44
  const { staticBlocks, bpPerPx } = model;
46
45
  return (React.createElement(React.Fragment, null, staticBlocks.map((block, index) => {
47
46
  const k = `${block.key}-${index}`;
48
- if (block instanceof ContentBlock) {
47
+ if (block.type === 'ContentBlock') {
49
48
  return React.createElement(RenderedBlockLines, { key: k, block: block, bpPerPx: bpPerPx });
50
49
  }
51
- else if (block instanceof ElidedBlock) {
50
+ else if (block.type === 'ElidedBlock') {
52
51
  return React.createElement(ElidedBlockComponent, { key: k, width: block.widthPx });
53
52
  }
54
- else if (block instanceof InterRegionPaddingBlock) {
53
+ else if (block.type === 'InterRegionPaddingBlock') {
55
54
  return (React.createElement(InterRegionPaddingBlockComponent, { key: k, width: block.widthPx, boundary: block.variant === 'boundary' }));
56
55
  }
57
56
  return null;
@@ -33,26 +33,6 @@ const Highlight = observer(function Highlight({ model, highlight, }) {
33
33
  const dismissHighlight = () => {
34
34
  model.removeHighlight(highlight);
35
35
  };
36
- const menuItems = [
37
- {
38
- label: 'Dismiss highlight',
39
- icon: CloseIcon,
40
- onClick: () => dismissHighlight(),
41
- },
42
- {
43
- label: 'Bookmark highlighted region',
44
- icon: BookmarkIcon,
45
- onClick: () => {
46
- let bookmarkWidget = session.widgets.get('GridBookmark');
47
- if (!bookmarkWidget) {
48
- bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
49
- }
50
- // @ts-ignore
51
- bookmarkWidget.addBookmark(highlight);
52
- dismissHighlight();
53
- },
54
- },
55
- ];
56
36
  function handleClose() {
57
37
  setOpen(false);
58
38
  }
@@ -90,7 +70,26 @@ const Highlight = observer(function Highlight({ model, highlight, }) {
90
70
  React.createElement(Menu, { anchorEl: anchorEl.current, onMenuItemClick: (_event, callback) => {
91
71
  callback(session);
92
72
  handleClose();
93
- }, open: open, onClose: handleClose, menuItems: menuItems }))) : null;
73
+ }, open: open, onClose: handleClose, menuItems: [
74
+ {
75
+ label: 'Dismiss highlight',
76
+ icon: CloseIcon,
77
+ onClick: () => dismissHighlight(),
78
+ },
79
+ {
80
+ label: 'Bookmark highlighted region',
81
+ icon: BookmarkIcon,
82
+ onClick: () => {
83
+ let bookmarkWidget = session.widgets.get('GridBookmark');
84
+ if (!bookmarkWidget) {
85
+ bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
86
+ }
87
+ // @ts-ignore
88
+ bookmarkWidget.addBookmark(highlight);
89
+ dismissHighlight();
90
+ },
91
+ },
92
+ ] }))) : null;
94
93
  });
95
94
  const HighlightGroup = observer(function HighlightGroup({ model, }) {
96
95
  return model.highlight.map((highlight, idx) => (React.createElement(Highlight, { key: JSON.stringify(highlight) + '-' + idx, model: model, highlight: highlight })));
@@ -5,7 +5,6 @@ import { observer } from 'mobx-react';
5
5
  // core
6
6
  import Base1DView from '@jbrowse/core/util/Base1DViewModel';
7
7
  import { getEnv, getSession, getTickDisplayStr } from '@jbrowse/core/util';
8
- import { ContentBlock } from '@jbrowse/core/util/blockTypes';
9
8
  // locals
10
9
  import { HEADER_BAR_HEIGHT, HEADER_OVERVIEW_HEIGHT, } from '..';
11
10
  import { chooseGridPitch } from '../util';
@@ -148,7 +147,7 @@ const Scalebar = observer(function ({ model, scale, overview, }) {
148
147
  borderColor: color,
149
148
  } }),
150
149
  overviewVisibleRegions.map((block, idx) => {
151
- return !(block instanceof ContentBlock) ? (React.createElement("div", { key: `${JSON.stringify(block)}-${idx}`, className: classes.scalebarContig, style: {
150
+ return !(block.type === 'ContentBlock') ? (React.createElement("div", { key: `${JSON.stringify(block)}-${idx}`, className: classes.scalebarContig, style: {
152
151
  width: block.widthPx,
153
152
  left: block.offsetPx,
154
153
  backgroundColor: '#999',
@@ -3,6 +3,7 @@ import { useTheme, alpha } from '@mui/material';
3
3
  import { observer } from 'mobx-react';
4
4
  // locals
5
5
  import { HEADER_BAR_HEIGHT } from '..';
6
+ import { getFillProps, getStrokeProps } from '@jbrowse/core/util';
6
7
  const OverviewScalebarPolygon = observer(function ({ model, overview, useOffset = true, }) {
7
8
  const theme = useTheme();
8
9
  const multiplier = Number(useOffset);
@@ -36,6 +37,6 @@ const OverviewScalebarPolygon = observer(function ({ model, overview, useOffset
36
37
  [topRight, 0],
37
38
  [topLeft, 0],
38
39
  ];
39
- return (React.createElement("polygon", { points: points.toString(), fill: alpha(polygonColor, 0.3), stroke: alpha(polygonColor, 0.8) }));
40
+ return (React.createElement("polygon", { points: points.toString(), ...getFillProps(alpha(polygonColor, 0.3)), ...getStrokeProps(alpha(polygonColor, 0.8)) }));
40
41
  });
41
42
  export default OverviewScalebarPolygon;
@@ -1,6 +1,5 @@
1
1
  import { Paper, Typography } from '@mui/material';
2
2
  import { makeStyles } from 'tss-react/mui';
3
- import { ContentBlock, ElidedBlock, InterRegionPaddingBlock, } from '@jbrowse/core/util/blockTypes';
4
3
  import { observer } from 'mobx-react';
5
4
  import React from 'react';
6
5
  import { ContentBlock as ContentBlockComponent, ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from '../../BaseLinearDisplay/components/Block';
@@ -56,7 +55,7 @@ const RenderedRefNameLabels = observer(({ model }) => {
56
55
  }
57
56
  });
58
57
  return (React.createElement(React.Fragment, null, model.staticBlocks.map((block, index) => {
59
- return block instanceof ContentBlock &&
58
+ return block.type === 'ContentBlock' &&
60
59
  (block.isLeftEndOfDisplayedRegion || index === lastLeftBlock) ? (React.createElement(Typography, { key: `refLabel-${block.key}-${index}`, style: {
61
60
  left: index === lastLeftBlock
62
61
  ? Math.max(0, -model.offsetPx)
@@ -83,13 +82,13 @@ const RenderedScalebarLabels = observer(({ model }) => {
83
82
  return (React.createElement(React.Fragment, null, staticBlocks.map((block, idx) => {
84
83
  const { key, widthPx } = block;
85
84
  const k = `${key}-${idx}`;
86
- if (block instanceof ContentBlock) {
85
+ if (block.type === 'ContentBlock') {
87
86
  return React.createElement(RenderedBlockTicks, { key: k, block: block, bpPerPx: bpPerPx });
88
87
  }
89
- else if (block instanceof ElidedBlock) {
88
+ else if (block.type === 'ElidedBlock') {
90
89
  return React.createElement(ElidedBlockComponent, { key: k, width: widthPx });
91
90
  }
92
- else if (block instanceof InterRegionPaddingBlock) {
91
+ else if (block.type === 'InterRegionPaddingBlock') {
93
92
  return (React.createElement(InterRegionPaddingBlockComponent, { key: k, width: widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }));
94
93
  }
95
94
  return null;
@@ -364,6 +364,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
364
364
  getSelectedRegions(leftOffset?: BpOffset, rightOffset?: BpOffset): {
365
365
  start: number;
366
366
  end: number;
367
+ type: string;
367
368
  regionNumber?: number | undefined;
368
369
  reversed?: boolean | undefined;
369
370
  refName: string;
@@ -42,7 +42,7 @@ export default function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight
42
42
  React.createElement("text", { x: 0, y: 0, dominantBaseline: "hanging", fontSize: fontSize, fill: c }, assemblyName),
43
43
  showCytobands ? (React.createElement("g", { transform: `translate(0 ${rulerHeight})` },
44
44
  React.createElement(Cytobands, { overview: overview, assembly: assembly, block: block }),
45
- React.createElement("rect", { stroke: "red", fill: "rgb(255,0,0,0.1)", width: Math.max(lastOverviewPx - firstOverviewPx, 0.5), height: HEADER_OVERVIEW_HEIGHT - 1, x: firstOverviewPx, y: 0.5 }),
45
+ React.createElement("rect", { stroke: "red", fill: "rgb(255,0,0)", fillOpacity: 0.1, width: Math.max(lastOverviewPx - firstOverviewPx, 0.5), height: HEADER_OVERVIEW_HEIGHT - 1, x: firstOverviewPx, y: 0.5 }),
46
46
  React.createElement("g", { transform: `translate(0,${HEADER_OVERVIEW_HEIGHT})` },
47
47
  React.createElement(OverviewScalebarPolygon, { overview: overview, model: model, useOffset: false })))) : null,
48
48
  React.createElement("g", { transform: `translate(0 ${fontSize + y})` },
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { useTheme } from '@mui/material';
3
- import { coarseStripHTML } from '@jbrowse/core/util';
3
+ import { coarseStripHTML, stripAlpha } from '@jbrowse/core/util';
4
4
  export default function SVGTrackLabel({ trackLabels, trackName, fontSize, trackLabelOffset, x, }) {
5
5
  const theme = useTheme();
6
- const fill = theme.palette.text.primary;
6
+ const fill = stripAlpha(theme.palette.text.primary);
7
7
  const xoff = trackLabels === 'overlay' ? 5 : 0;
8
8
  const yoff = trackLabels === 'offset' ? 5 : 0;
9
9
  const name = coarseStripHTML(trackName);
package/esm/index.d.ts CHANGED
@@ -143,6 +143,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
143
143
  defaultValue: string;
144
144
  contextVariable: string[];
145
145
  };
146
+ jexlFilters: {
147
+ type: string;
148
+ description: string;
149
+ defaultValue: never[];
150
+ };
146
151
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>>;
147
152
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
148
153
  rendererTypeName: string;
@@ -258,6 +263,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
258
263
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
259
264
  deleteBlock(key: string): void;
260
265
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
266
+ navToFeature(feature: import("@jbrowse/core/util").Feature): void;
261
267
  clearFeatureSelection(): void;
262
268
  setFeatureIdUnderMouse(feature?: string | undefined): void;
263
269
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
@@ -355,6 +361,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
355
361
  defaultValue: string;
356
362
  contextVariable: string[];
357
363
  };
364
+ jexlFilters: {
365
+ type: string;
366
+ description: string;
367
+ defaultValue: never[];
368
+ };
358
369
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
359
370
  }, {
360
371
  rendererTypeName: string;
@@ -470,6 +481,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
470
481
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
471
482
  deleteBlock(key: string): void;
472
483
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
484
+ navToFeature(feature: import("@jbrowse/core/util").Feature): void;
473
485
  clearFeatureSelection(): void;
474
486
  setFeatureIdUnderMouse(feature?: string | undefined): void;
475
487
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
@@ -567,6 +579,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
567
579
  defaultValue: string;
568
580
  contextVariable: string[];
569
581
  };
582
+ jexlFilters: {
583
+ type: string;
584
+ description: string;
585
+ defaultValue: never[];
586
+ };
570
587
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
571
588
  }>>, {
572
589
  type: string;
@@ -664,6 +681,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
664
681
  defaultValue: string;
665
682
  contextVariable: string[];
666
683
  };
684
+ jexlFilters: {
685
+ type: string;
686
+ description: string;
687
+ defaultValue: never[];
688
+ };
667
689
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
668
690
  }, {
669
691
  rendererTypeName: string;
@@ -779,6 +801,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
779
801
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
780
802
  deleteBlock(key: string): void;
781
803
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
804
+ navToFeature(feature: import("@jbrowse/core/util").Feature): void;
782
805
  clearFeatureSelection(): void;
783
806
  setFeatureIdUnderMouse(feature?: string | undefined): void;
784
807
  setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
@@ -876,6 +899,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
876
899
  defaultValue: string;
877
900
  contextVariable: string[];
878
901
  };
902
+ jexlFilters: {
903
+ type: string;
904
+ description: string;
905
+ defaultValue: never[];
906
+ };
879
907
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
880
908
  }>>, {
881
909
  type: string;
@@ -908,6 +936,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
908
936
  defaultValue: string;
909
937
  contextVariable: string[];
910
938
  };
939
+ jexlFilters: {
940
+ type: string;
941
+ description: string;
942
+ defaultValue: never[];
943
+ };
911
944
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
912
945
  SearchBox: ({ model, showHelp, }: {
913
946
  showHelp?: boolean | undefined;
@@ -1039,6 +1072,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1039
1072
  getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
1040
1073
  start: number;
1041
1074
  end: number;
1075
+ type: string;
1042
1076
  regionNumber?: number | undefined;
1043
1077
  reversed?: boolean | undefined;
1044
1078
  refName: string;
@@ -1368,6 +1402,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1368
1402
  getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
1369
1403
  start: number;
1370
1404
  end: number;
1405
+ type: string;
1371
1406
  regionNumber?: number | undefined;
1372
1407
  reversed?: boolean | undefined;
1373
1408
  refName: string;
@@ -1737,6 +1772,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
1737
1772
  getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
1738
1773
  start: number;
1739
1774
  end: number;
1775
+ type: string;
1740
1776
  regionNumber?: number | undefined;
1741
1777
  reversed?: boolean | undefined;
1742
1778
  refName: string;
@@ -2066,6 +2102,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
2066
2102
  getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
2067
2103
  start: number;
2068
2104
  end: number;
2105
+ type: string;
2069
2106
  regionNumber?: number | undefined;
2070
2107
  reversed?: boolean | undefined;
2071
2108
  refName: string;
@@ -2435,6 +2472,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
2435
2472
  getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
2436
2473
  start: number;
2437
2474
  end: number;
2475
+ type: string;
2438
2476
  regionNumber?: number | undefined;
2439
2477
  reversed?: boolean | undefined;
2440
2478
  refName: string;
@@ -2764,6 +2802,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
2764
2802
  getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
2765
2803
  start: number;
2766
2804
  end: number;
2805
+ type: string;
2767
2806
  regionNumber?: number | undefined;
2768
2807
  reversed?: boolean | undefined;
2769
2808
  refName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "2.11.0",
3
+ "version": "2.11.2",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -63,5 +63,5 @@
63
63
  "access": "public"
64
64
  },
65
65
  "module": "esm/index.js",
66
- "gitHead": "3d43a820b9274a6160aa4dc15616147f390d9094"
66
+ "gitHead": "511048cb6965f0bf624c96de244e7fd47fce17d6"
67
67
  }