@jbrowse/plugin-linear-genome-view 2.10.3 → 2.11.1

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 (80) hide show
  1. package/dist/BaseLinearDisplay/components/Tooltip.js +1 -0
  2. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -1
  3. package/dist/BasicTrack/index.d.ts +1 -2
  4. package/dist/BasicTrack/index.js +3 -2
  5. package/dist/FeatureTrack/index.d.ts +1 -2
  6. package/dist/FeatureTrack/index.js +3 -2
  7. package/dist/LaunchLinearGenomeView/index.d.ts +1 -2
  8. package/dist/LaunchLinearGenomeView/index.js +17 -8
  9. package/dist/LinearBareDisplay/index.d.ts +1 -2
  10. package/dist/LinearBareDisplay/index.js +3 -2
  11. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
  12. package/dist/LinearBasicDisplay/index.d.ts +1 -2
  13. package/dist/LinearBasicDisplay/index.js +3 -2
  14. package/dist/LinearGenomeView/components/Cytobands.d.ts +1 -125
  15. package/dist/LinearGenomeView/components/Cytobands.js +11 -12
  16. package/dist/LinearGenomeView/components/ExportSvgDialog.js +9 -5
  17. package/dist/LinearGenomeView/components/Highlight.d.ts +3 -3
  18. package/dist/LinearGenomeView/components/Highlight.js +21 -17
  19. package/dist/LinearGenomeView/components/MiniControls.js +13 -15
  20. package/dist/LinearGenomeView/components/OverviewHighlight.d.ts +1 -1
  21. package/dist/LinearGenomeView/components/OverviewHighlight.js +20 -11
  22. package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
  23. package/dist/LinearGenomeView/components/OverviewScalebar.js +4 -1
  24. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +1 -1
  25. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.js +2 -1
  26. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +9 -9
  27. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +28 -35
  28. package/dist/LinearGenomeView/components/Rubberband.d.ts +1 -1
  29. package/dist/LinearGenomeView/components/SearchBox.d.ts +1 -1
  30. package/dist/LinearGenomeView/components/SearchResultsTable.js +1 -1
  31. package/dist/LinearGenomeView/components/TrackContainer.js +10 -23
  32. package/dist/LinearGenomeView/components/TrackLabel.js +33 -6
  33. package/dist/LinearGenomeView/components/ZoomControls.js +4 -4
  34. package/dist/LinearGenomeView/model.d.ts +67 -7
  35. package/dist/LinearGenomeView/model.js +102 -16
  36. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +1 -1
  37. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
  38. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +1 -1
  39. package/dist/index.d.ts +159 -21
  40. package/esm/BaseLinearDisplay/components/Tooltip.js +1 -0
  41. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -1
  42. package/esm/BasicTrack/index.d.ts +1 -2
  43. package/esm/BasicTrack/index.js +2 -2
  44. package/esm/FeatureTrack/index.d.ts +1 -2
  45. package/esm/FeatureTrack/index.js +2 -2
  46. package/esm/LaunchLinearGenomeView/index.d.ts +1 -2
  47. package/esm/LaunchLinearGenomeView/index.js +16 -8
  48. package/esm/LinearBareDisplay/index.d.ts +1 -2
  49. package/esm/LinearBareDisplay/index.js +2 -2
  50. package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
  51. package/esm/LinearBasicDisplay/index.d.ts +1 -2
  52. package/esm/LinearBasicDisplay/index.js +2 -2
  53. package/esm/LinearGenomeView/components/Cytobands.d.ts +1 -125
  54. package/esm/LinearGenomeView/components/Cytobands.js +11 -12
  55. package/esm/LinearGenomeView/components/ExportSvgDialog.js +9 -5
  56. package/esm/LinearGenomeView/components/Highlight.d.ts +3 -3
  57. package/esm/LinearGenomeView/components/Highlight.js +21 -17
  58. package/esm/LinearGenomeView/components/MiniControls.js +14 -16
  59. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.js +20 -11
  61. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
  62. package/esm/LinearGenomeView/components/OverviewScalebar.js +5 -2
  63. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +1 -1
  64. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +2 -1
  65. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +9 -9
  66. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +28 -35
  67. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  68. package/esm/LinearGenomeView/components/SearchBox.d.ts +1 -1
  69. package/esm/LinearGenomeView/components/SearchResultsTable.js +1 -1
  70. package/esm/LinearGenomeView/components/TrackContainer.js +10 -23
  71. package/esm/LinearGenomeView/components/TrackLabel.js +33 -6
  72. package/esm/LinearGenomeView/components/TracksContainer.js +2 -2
  73. package/esm/LinearGenomeView/components/ZoomControls.js +4 -4
  74. package/esm/LinearGenomeView/model.d.ts +67 -7
  75. package/esm/LinearGenomeView/model.js +103 -17
  76. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +1 -1
  77. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
  78. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +2 -2
  79. package/esm/index.d.ts +159 -21
  80. package/package.json +2 -2
@@ -40,6 +40,7 @@ const Tooltip = (0, mobx_react_1.observer)(function ({ model, clientMouseCoord,
40
40
  const y = clientMouseCoord[1];
41
41
  const { refs, floatingStyles, context } = (0, react_2.useFloating)({
42
42
  placement: 'right',
43
+ strategy: 'fixed',
43
44
  });
44
45
  const clientPoint = (0, react_2.useClientPoint)(context, { x, y });
45
46
  const { getFloatingProps } = (0, react_2.useInteractions)([clientPoint]);
@@ -102,7 +102,6 @@ const blockState = mobx_state_tree_1.types
102
102
  renderInProgress = undefined;
103
103
  },
104
104
  setError(error) {
105
- console.error(error);
106
105
  if (renderInProgress && !renderInProgress.signal.aborted) {
107
106
  renderInProgress.abort();
108
107
  }
@@ -1,3 +1,2 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const _default: (pm: PluginManager) => void;
3
- export default _default;
2
+ export default function BasicTrackF(pm: PluginManager): void;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
7
7
  const configSchema_1 = __importDefault(require("./configSchema"));
8
- exports.default = (pm) => {
8
+ function BasicTrackF(pm) {
9
9
  pm.addTrackType(() => {
10
10
  const configSchema = (0, configSchema_1.default)(pm);
11
11
  return new pluggableElementTypes_1.TrackType({
@@ -14,4 +14,5 @@ exports.default = (pm) => {
14
14
  stateModel: (0, pluggableElementTypes_1.createBaseTrackModel)(pm, 'BasicTrack', configSchema),
15
15
  });
16
16
  });
17
- };
17
+ }
18
+ exports.default = BasicTrackF;
@@ -1,3 +1,2 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const _default: (pm: PluginManager) => void;
3
- export default _default;
2
+ export default function FeatureTrackF(pm: PluginManager): void;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
7
7
  const configSchema_1 = __importDefault(require("./configSchema"));
8
- exports.default = (pm) => {
8
+ function FeatureTrackF(pm) {
9
9
  pm.addTrackType(() => {
10
10
  const configSchema = (0, configSchema_1.default)(pm);
11
11
  return new pluggableElementTypes_1.TrackType({
@@ -15,4 +15,5 @@ exports.default = (pm) => {
15
15
  stateModel: (0, pluggableElementTypes_1.createBaseTrackModel)(pm, 'FeatureTrack', configSchema),
16
16
  });
17
17
  });
18
- };
18
+ }
19
+ exports.default = FeatureTrackF;
@@ -1,3 +1,2 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const _default: (pluginManager: PluginManager) => void;
3
- export default _default;
2
+ export default function LaunchLinearGenomeViewF(pluginManager: PluginManager): void;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const util_1 = require("@jbrowse/core/util");
4
4
  const searchUtils_1 = require("../searchUtils");
5
- exports.default = (pluginManager) => {
5
+ function LaunchLinearGenomeViewF(pluginManager) {
6
6
  pluginManager.addToExtensionPoint('LaunchView-LinearGenomeView',
7
7
  // @ts-expect-error
8
8
  async ({ session, assembly, loc, tracks = [], tracklist, nav, highlight, }) => {
@@ -25,11 +25,19 @@ exports.default = (pluginManager) => {
25
25
  view.setHideHeader(!nav);
26
26
  }
27
27
  if (highlight !== undefined) {
28
- const location = (0, util_1.parseLocString)(highlight, refName => isValidRefName(refName, assembly));
29
- if ((location === null || location === void 0 ? void 0 : location.start) !== undefined && (location === null || location === void 0 ? void 0 : location.end) !== undefined) {
30
- location.assemblyName = assembly;
31
- view.setHighlight(location);
32
- }
28
+ highlight.forEach(async (h) => {
29
+ if (h) {
30
+ const parsedLocString = (0, util_1.parseLocString)(h, refName => isValidRefName(refName, assembly));
31
+ const location = {
32
+ ...parsedLocString,
33
+ assemblyName: assembly,
34
+ };
35
+ if ((location === null || location === void 0 ? void 0 : location.start) !== undefined &&
36
+ (location === null || location === void 0 ? void 0 : location.end) !== undefined) {
37
+ view.addToHighlights(location);
38
+ }
39
+ }
40
+ });
33
41
  }
34
42
  await (0, searchUtils_1.handleSelectedRegion)({ input: loc, model: view, assembly: asm });
35
43
  const idsNotFound = [];
@@ -39,11 +47,12 @@ exports.default = (pluginManager) => {
39
47
  }
40
48
  }
41
49
  catch (e) {
42
- session.notify(`${e}`, 'error');
50
+ session.notifyError(`${e}`, e);
43
51
  throw e;
44
52
  }
45
53
  });
46
- };
54
+ }
55
+ exports.default = LaunchLinearGenomeViewF;
47
56
  function tryTrack(model, trackId, idsNotFound) {
48
57
  try {
49
58
  model.showTrack(trackId);
@@ -1,5 +1,4 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const _default: (pluginManager: PluginManager) => void;
3
- export default _default;
2
+ export default function LinearBareDisplayF(pluginManager: PluginManager): void;
4
3
  export { configSchemaFactory } from './configSchema';
5
4
  export { stateModelFactory } from './model';
@@ -6,7 +6,7 @@ const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
6
6
  const configSchema_1 = require("./configSchema");
7
7
  const model_1 = require("./model");
8
8
  const BaseLinearDisplay_1 = require("../BaseLinearDisplay/");
9
- exports.default = (pluginManager) => {
9
+ function LinearBareDisplayF(pluginManager) {
10
10
  pluginManager.addDisplayType(() => {
11
11
  const configSchema = (0, configSchema_1.configSchemaFactory)(pluginManager);
12
12
  return new pluggableElementTypes_1.DisplayType({
@@ -19,7 +19,8 @@ exports.default = (pluginManager) => {
19
19
  ReactComponent: BaseLinearDisplay_1.BaseLinearDisplayComponent,
20
20
  });
21
21
  });
22
- };
22
+ }
23
+ exports.default = LinearBareDisplayF;
23
24
  var configSchema_2 = require("./configSchema");
24
25
  Object.defineProperty(exports, "configSchemaFactory", { enumerable: true, get: function () { return configSchema_2.configSchemaFactory; } });
25
26
  var model_2 = require("./model");
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  declare const SetMaxHeightDialog: ({ model, handleClose, }: {
3
3
  model: {
4
- maxHeight?: number | undefined;
4
+ maxHeight?: number;
5
5
  setMaxHeight: (arg?: number) => void;
6
6
  };
7
7
  handleClose: () => void;
@@ -1,5 +1,4 @@
1
1
  import PluginManager from '@jbrowse/core/PluginManager';
2
- declare const _default: (pluginManager: PluginManager) => void;
3
- export default _default;
2
+ export default function LinearBasicDisplay(pluginManager: PluginManager): void;
4
3
  export { default as modelFactory } from './model';
5
4
  export { default as configSchema } from './configSchema';
@@ -9,7 +9,7 @@ const BaseLinearDisplay_1 = require("../BaseLinearDisplay");
9
9
  // locals
10
10
  const configSchema_1 = __importDefault(require("./configSchema"));
11
11
  const model_1 = __importDefault(require("./model"));
12
- exports.default = (pluginManager) => {
12
+ function LinearBasicDisplay(pluginManager) {
13
13
  pluginManager.addDisplayType(() => {
14
14
  const config = (0, configSchema_1.default)(pluginManager);
15
15
  return new pluggableElementTypes_1.DisplayType({
@@ -22,7 +22,8 @@ exports.default = (pluginManager) => {
22
22
  ReactComponent: BaseLinearDisplay_1.BaseLinearDisplayComponent,
23
23
  });
24
24
  });
25
- };
25
+ }
26
+ exports.default = LinearBasicDisplay;
26
27
  var model_2 = require("./model");
27
28
  Object.defineProperty(exports, "modelFactory", { enumerable: true, get: function () { return __importDefault(model_2).default; } });
28
29
  var configSchema_2 = require("./configSchema");
@@ -4,131 +4,7 @@ import { ContentBlock } from '@jbrowse/core/util/blockTypes';
4
4
  import { Assembly } from '@jbrowse/core/assemblyManager/assembly';
5
5
  declare const Cytobands: ({ overview, block, assembly, }: {
6
6
  overview: Base1DViewModel;
7
- assembly?: ({
8
- configuration: any;
9
- } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
10
- error: unknown;
11
- loaded: boolean;
12
- loadingP: Promise<void> | undefined;
13
- volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
14
- refNameAliases: {
15
- [x: string]: string | undefined;
16
- } | undefined;
17
- lowerCaseRefNameAliases: {
18
- [x: string]: string | undefined;
19
- } | undefined;
20
- cytobands: import("@jbrowse/core/util").Feature[] | undefined;
21
- } & {
22
- getConf(arg: string): any;
23
- } & {
24
- readonly initialized: boolean;
25
- readonly name: string;
26
- readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
27
- readonly aliases: string[];
28
- readonly displayName: string | undefined;
29
- hasName(name: string): boolean;
30
- readonly allAliases: string[];
31
- readonly allRefNames: string[] | undefined;
32
- readonly lowerCaseRefNames: string[] | undefined;
33
- readonly allRefNamesWithLowerCase: string[] | undefined;
34
- readonly rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
35
- readonly refNameColors: string[];
36
- } & {
37
- readonly refNames: string[] | undefined;
38
- } & {
39
- getCanonicalRefName(refName: string): string | undefined;
40
- getRefNameColor(refName: string): string | undefined;
41
- isValidRefName(refName: string): boolean;
42
- } & {
43
- setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: import("@jbrowse/core/assemblyManager/assembly").Loading): void;
44
- setError(e: unknown): void;
45
- setRegions(regions: import("@jbrowse/core/util").Region[]): void;
46
- setRefNameAliases(aliases: {
47
- [x: string]: string | undefined;
48
- }, lcAliases: {
49
- [x: string]: string | undefined;
50
- }): void;
51
- setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
52
- setLoadingP(p?: Promise<void> | undefined): void;
53
- load(): Promise<void>;
54
- loadPre(): Promise<void>;
55
- } & {
56
- getAdapterMapEntry(adapterConf: {
57
- [x: string]: unknown;
58
- }, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
59
- getRefNameMapForAdapter(adapterConf: {
60
- [x: string]: unknown;
61
- }, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
62
- [x: string]: string | undefined;
63
- }>;
64
- getReverseRefNameMapForAdapter(adapterConf: {
65
- [x: string]: unknown;
66
- }, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
67
- [x: string]: string | undefined;
68
- }>;
69
- } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
70
- configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
71
- }, {
72
- error: unknown;
73
- loaded: boolean;
74
- loadingP: Promise<void> | undefined;
75
- volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
76
- refNameAliases: {
77
- [x: string]: string | undefined;
78
- } | undefined;
79
- lowerCaseRefNameAliases: {
80
- [x: string]: string | undefined;
81
- } | undefined;
82
- cytobands: import("@jbrowse/core/util").Feature[] | undefined;
83
- } & {
84
- getConf(arg: string): any;
85
- } & {
86
- readonly initialized: boolean;
87
- readonly name: string;
88
- readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
89
- readonly aliases: string[];
90
- readonly displayName: string | undefined;
91
- hasName(name: string): boolean;
92
- readonly allAliases: string[];
93
- readonly allRefNames: string[] | undefined;
94
- readonly lowerCaseRefNames: string[] | undefined;
95
- readonly allRefNamesWithLowerCase: string[] | undefined;
96
- readonly rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
97
- readonly refNameColors: string[];
98
- } & {
99
- readonly refNames: string[] | undefined;
100
- } & {
101
- getCanonicalRefName(refName: string): string | undefined;
102
- getRefNameColor(refName: string): string | undefined;
103
- isValidRefName(refName: string): boolean;
104
- } & {
105
- setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: import("@jbrowse/core/assemblyManager/assembly").Loading): void;
106
- setError(e: unknown): void;
107
- setRegions(regions: import("@jbrowse/core/util").Region[]): void;
108
- setRefNameAliases(aliases: {
109
- [x: string]: string | undefined;
110
- }, lcAliases: {
111
- [x: string]: string | undefined;
112
- }): void;
113
- setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
114
- setLoadingP(p?: Promise<void> | undefined): void;
115
- load(): Promise<void>;
116
- loadPre(): Promise<void>;
117
- } & {
118
- getAdapterMapEntry(adapterConf: {
119
- [x: string]: unknown;
120
- }, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
121
- getRefNameMapForAdapter(adapterConf: {
122
- [x: string]: unknown;
123
- }, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
124
- [x: string]: string | undefined;
125
- }>;
126
- getReverseRefNameMapForAdapter(adapterConf: {
127
- [x: string]: unknown;
128
- }, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
129
- [x: string]: string | undefined;
130
- }>;
131
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
7
+ assembly?: Assembly;
132
8
  block: ContentBlock;
133
9
  }) => React.JSX.Element;
134
10
  export default Cytobands;
@@ -8,6 +8,7 @@ const mobx_react_1 = require("mobx-react");
8
8
  // locals
9
9
  const __1 = require("..");
10
10
  const util_1 = require("./util");
11
+ const util_2 = require("@jbrowse/core/util");
11
12
  // rounded rect from https://stackoverflow.com/a/45889603/2129219
12
13
  // prettier-ignore
13
14
  function rightRoundedRect(x, y, width, height, radius) {
@@ -68,28 +69,26 @@ const Cytobands = (0, mobx_react_1.observer)(function ({ overview, block, assemb
68
69
  const e = overview.bpToPx({ refName, coord: end }) || 0;
69
70
  const l = Math.min(s, e);
70
71
  const w = Math.abs(e - s);
71
- const c = colorMap[type];
72
+ const c = colorMap[type] || 'black';
72
73
  if (type === 'acen' && !centromereSeen) {
73
74
  centromereSeen = true; // the next acen entry is drawn with different right triangle
74
- const tri = reversed
75
- ? rightTriangle(s - w, 0, w, h)
76
- : leftTriangle(s, 0, w, h);
77
- return react_1.default.createElement("polygon", { key: k, points: tri, fill: c });
75
+ return (react_1.default.createElement("polygon", { key: k, points: reversed
76
+ ? rightTriangle(s - w, 0, w, h)
77
+ : leftTriangle(s, 0, w, h), ...(0, util_2.getFillProps)(c) }));
78
78
  }
79
79
  else if (type === 'acen' && centromereSeen) {
80
- const tri = reversed
81
- ? leftTriangle(s - w, 0, w, h)
82
- : rightTriangle(s, 0, w, h);
83
- return react_1.default.createElement("polygon", { key: k, points: tri, fill: c });
80
+ return (react_1.default.createElement("polygon", { key: k, points: reversed
81
+ ? leftTriangle(s - w, 0, w, h)
82
+ : rightTriangle(s, 0, w, h), ...(0, util_2.getFillProps)(c) }));
84
83
  }
85
84
  else if (lcap === index) {
86
- return react_1.default.createElement("path", { key: k, d: leftRoundedRect(l, 0, w, h, 8), fill: c });
85
+ return (react_1.default.createElement("path", { key: k, d: leftRoundedRect(l, 0, w, h, 8), ...(0, util_2.getFillProps)(c) }));
87
86
  }
88
87
  else if (rcap === index) {
89
- return react_1.default.createElement("path", { key: k, d: rightRoundedRect(l, 0, w, h, 8), fill: c });
88
+ return (react_1.default.createElement("path", { key: k, d: rightRoundedRect(l, 0, w, h, 8), ...(0, util_2.getFillProps)(c) }));
90
89
  }
91
90
  else {
92
- return react_1.default.createElement("rect", { key: k, x: l, y: 0, width: w, height: h, fill: c });
91
+ return (react_1.default.createElement("rect", { key: k, x: l, y: 0, width: w, height: h, ...(0, util_2.getFillProps)(c) }));
93
92
  }
94
93
  })));
95
94
  });
@@ -35,6 +35,10 @@ function LoadingMessage() {
35
35
  function useSvgLocal(key, val) {
36
36
  return (0, util_1.useLocalStorage)('svg-' + key, val);
37
37
  }
38
+ function TextField2({ children, ...rest }) {
39
+ return (react_1.default.createElement("div", null,
40
+ react_1.default.createElement(material_1.TextField, { ...rest }, children)));
41
+ }
38
42
  function ExportSvgDialog({ model, handleClose, }) {
39
43
  const session = (0, util_1.getSession)(model);
40
44
  const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
@@ -47,15 +51,13 @@ function ExportSvgDialog({ model, handleClose, }) {
47
51
  return (react_1.default.createElement(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG" },
48
52
  react_1.default.createElement(material_1.DialogContent, null,
49
53
  error ? (react_1.default.createElement(ui_1.ErrorMessage, { error: error })) : loading ? (react_1.default.createElement(LoadingMessage, null)) : null,
50
- react_1.default.createElement(material_1.TextField, { helperText: "filename", value: filename, onChange: event => setFilename(event.target.value) }),
51
- react_1.default.createElement("br", null),
52
- react_1.default.createElement(material_1.TextField, { select: true, label: "Track label positioning", variant: "outlined", style: { width: 150 }, value: trackLabels, onChange: event => setTrackLabels(event.target.value) },
54
+ react_1.default.createElement(TextField2, { helperText: "filename", value: filename, onChange: event => setFilename(event.target.value) }),
55
+ react_1.default.createElement(TextField2, { select: true, label: "Track label positioning", variant: "outlined", style: { width: 150 }, value: trackLabels, onChange: event => setTrackLabels(event.target.value) },
53
56
  react_1.default.createElement(material_1.MenuItem, { value: "offset" }, "Offset"),
54
57
  react_1.default.createElement(material_1.MenuItem, { value: "overlay" }, "Overlay"),
55
58
  react_1.default.createElement(material_1.MenuItem, { value: "left" }, "Left"),
56
59
  react_1.default.createElement(material_1.MenuItem, { value: "none" }, "None")),
57
- react_1.default.createElement("br", null),
58
- session.allThemes ? (react_1.default.createElement(material_1.TextField, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => setThemeName(event.target.value) }, Object.entries(session.allThemes()).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key },
60
+ session.allThemes ? (react_1.default.createElement(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => setThemeName(event.target.value) }, Object.entries(session.allThemes()).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key },
59
61
  // @ts-expect-error
60
62
  val.name || '(Unknown name)'))))) : null,
61
63
  offscreenCanvas ? (react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => setRasterizeLayers(val => !val) }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (react_1.default.createElement(material_1.Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
@@ -76,6 +78,8 @@ function ExportSvgDialog({ model, handleClose, }) {
76
78
  catch (e) {
77
79
  console.error(e);
78
80
  setError(e);
81
+ }
82
+ finally {
79
83
  setLoading(false);
80
84
  }
81
85
  } }, "Submit"))));
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { LinearGenomeViewModel } from '../model';
3
3
  type LGV = LinearGenomeViewModel;
4
- declare const Highlight: ({ model }: {
4
+ declare const HighlightGroup: ({ model, }: {
5
5
  model: LGV;
6
- }) => React.JSX.Element | null;
7
- export default Highlight;
6
+ }) => React.JSX.Element[];
7
+ export default HighlightGroup;
@@ -38,28 +38,28 @@ const Link_1 = __importDefault(require("@mui/icons-material/Link"));
38
38
  const Close_1 = __importDefault(require("@mui/icons-material/Close"));
39
39
  const Bookmark_1 = __importDefault(require("@mui/icons-material/Bookmark"));
40
40
  const useStyles = (0, mui_1.makeStyles)()(theme => {
41
- var _a, _b, _c, _d, _e, _f;
41
+ var _a, _b;
42
42
  return ({
43
43
  highlight: {
44
44
  height: '100%',
45
45
  position: 'absolute',
46
- background: `${(0, colord_1.colord)((_b = (_a = theme.palette.quaternary) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
46
+ overflow: 'hidden',
47
+ background: `${(0, colord_1.colord)((_b = (_a = theme.palette.highlight) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
47
48
  .alpha(0.35)
48
49
  .toRgbString()}`,
49
- borderLeft: `1px solid ${(_d = (_c = theme.palette.quaternary) === null || _c === void 0 ? void 0 : _c.main) !== null && _d !== void 0 ? _d : 'goldenrod'}`,
50
- borderRight: `1px solid ${(_f = (_e = theme.palette.quaternary) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : 'goldenrod'}`,
51
50
  },
52
51
  });
53
52
  });
54
- const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
55
- var _a, _b;
53
+ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model, highlight, }) {
54
+ var _a, _b, _c;
56
55
  const { classes } = useStyles();
57
56
  const [open, setOpen] = (0, react_1.useState)(false);
58
57
  const anchorEl = (0, react_1.useRef)(null);
59
- const color = (_b = (_a = (0, material_1.useTheme)().palette.quaternary) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod';
58
+ const color = (_b = (_a = (0, material_1.useTheme)().palette.highlight) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod';
60
59
  const session = (0, util_1.getSession)(model);
60
+ const { assemblyManager } = session;
61
61
  const dismissHighlight = () => {
62
- model.setHighlight(undefined);
62
+ model.removeHighlight(highlight);
63
63
  };
64
64
  const menuItems = [
65
65
  {
@@ -76,7 +76,7 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
76
76
  bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
77
77
  }
78
78
  // @ts-ignore
79
- bookmarkWidget.addBookmark(model.highlight);
79
+ bookmarkWidget.addBookmark(highlight);
80
80
  dismissHighlight();
81
81
  },
82
82
  },
@@ -84,9 +84,6 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
84
84
  function handleClose() {
85
85
  setOpen(false);
86
86
  }
87
- if (!model.highlight) {
88
- return null;
89
- }
90
87
  // coords
91
88
  const mapCoords = (r) => {
92
89
  const s = model.bpToPx({
@@ -104,19 +101,26 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
104
101
  }
105
102
  : undefined;
106
103
  };
107
- const h = mapCoords(model.highlight);
108
- return (react_1.default.createElement(react_1.default.Fragment, null, h ? (react_1.default.createElement("div", { className: classes.highlight, style: {
104
+ const asm = assemblyManager.get(highlight === null || highlight === void 0 ? void 0 : highlight.assemblyName);
105
+ const h = mapCoords({
106
+ ...highlight,
107
+ refName: (_c = asm === null || asm === void 0 ? void 0 : asm.getCanonicalRefName(highlight.refName)) !== null && _c !== void 0 ? _c : highlight.refName,
108
+ });
109
+ return h ? (react_1.default.createElement("div", { className: classes.highlight, style: {
109
110
  left: h.left,
110
111
  width: h.width,
111
112
  } },
112
113
  react_1.default.createElement(material_1.Tooltip, { title: 'Highlighted from URL parameter', arrow: true },
113
- react_1.default.createElement(material_1.IconButton, { ref: anchorEl, onClick: () => setOpen(true) },
114
+ react_1.default.createElement(material_1.IconButton, { ref: anchorEl, onClick: () => setOpen(true), style: { zIndex: 3 } },
114
115
  react_1.default.createElement(Link_1.default, { fontSize: "small", sx: {
115
116
  color: `${(0, colord_1.colord)(color).darken(0.2).toRgbString()}`,
116
117
  } }))),
117
118
  react_1.default.createElement(ui_1.Menu, { anchorEl: anchorEl.current, onMenuItemClick: (_event, callback) => {
118
119
  callback(session);
119
120
  handleClose();
120
- }, open: open, onClose: handleClose, menuItems: menuItems }))) : null));
121
+ }, open: open, onClose: handleClose, menuItems: menuItems }))) : null;
122
+ });
123
+ const HighlightGroup = (0, mobx_react_1.observer)(function HighlightGroup({ model, }) {
124
+ return model.highlight.map((highlight, idx) => (react_1.default.createElement(Highlight, { key: JSON.stringify(highlight) + '-' + idx, model: model, highlight: highlight })));
121
125
  });
122
- exports.default = Highlight;
126
+ exports.default = HighlightGroup;
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  const mobx_react_1 = require("mobx-react");
8
8
  const material_1 = require("@mui/material");
9
+ const CascadingMenuButton_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenuButton"));
10
+ const mui_1 = require("tss-react/mui");
11
+ const util_1 = require("@jbrowse/core/util");
9
12
  // icons
10
13
  const ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
11
14
  const ZoomOut_1 = __importDefault(require("@mui/icons-material/ZoomOut"));
12
15
  const KeyboardArrowDown_1 = __importDefault(require("@mui/icons-material/KeyboardArrowDown"));
13
- const CascadingMenuButton_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenuButton"));
14
- const mui_1 = require("tss-react/mui");
15
- const util_1 = require("@jbrowse/core/util");
16
16
  const useStyles = (0, mui_1.makeStyles)()(theme => ({
17
17
  background: {
18
18
  position: 'absolute',
@@ -21,22 +21,20 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
21
21
  background: theme.palette.background.paper,
22
22
  },
23
23
  focusedBackground: {
24
- background: theme.palette.secondary.light,
25
- svg: {
26
- fill: theme.palette.secondary.contrastText,
27
- },
24
+ background: (0, material_1.alpha)(theme.palette.secondary.light, 0.2),
28
25
  },
29
26
  }));
30
27
  const MiniControls = (0, mobx_react_1.observer)(function ({ model, }) {
31
- const { classes, cx } = useStyles();
28
+ const { classes } = useStyles();
32
29
  const { id, bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor, hideHeader } = model;
33
30
  const { focusedViewId } = (0, util_1.getSession)(model);
34
- return hideHeader ? (react_1.default.createElement(material_1.Paper, { className: cx(classes.background, focusedViewId === id ? classes.focusedBackground : undefined) },
35
- react_1.default.createElement(CascadingMenuButton_1.default, { menuItems: model.menuItems() },
36
- react_1.default.createElement(KeyboardArrowDown_1.default, { fontSize: "small" })),
37
- react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_out", onClick: () => model.zoom(bpPerPx * 2), disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1 },
38
- react_1.default.createElement(ZoomOut_1.default, { fontSize: "small" })),
39
- react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(bpPerPx / 2), disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1 },
40
- react_1.default.createElement(ZoomIn_1.default, { fontSize: "small" })))) : null;
31
+ return hideHeader ? (react_1.default.createElement(material_1.Paper, { className: classes.background },
32
+ react_1.default.createElement(material_1.Paper, { className: focusedViewId === id ? classes.focusedBackground : undefined },
33
+ react_1.default.createElement(CascadingMenuButton_1.default, { menuItems: model.menuItems() },
34
+ react_1.default.createElement(KeyboardArrowDown_1.default, { fontSize: "small" })),
35
+ react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_out", onClick: () => model.zoom(bpPerPx * 2), disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1 },
36
+ react_1.default.createElement(ZoomOut_1.default, { fontSize: "small" })),
37
+ react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(bpPerPx / 2), disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1 },
38
+ react_1.default.createElement(ZoomIn_1.default, { fontSize: "small" }))))) : null;
41
39
  });
42
40
  exports.default = MiniControls;
@@ -5,5 +5,5 @@ type LGV = LinearGenomeViewModel;
5
5
  declare const OverviewHighlight: ({ model, overview, }: {
6
6
  model: LGV;
7
7
  overview: Base1DViewModel;
8
- }) => React.JSX.Element | null;
8
+ }) => React.JSX.Element[];
9
9
  export default OverviewHighlight;
@@ -7,23 +7,26 @@ const react_1 = __importDefault(require("react"));
7
7
  const mobx_react_1 = require("mobx-react");
8
8
  const mui_1 = require("tss-react/mui");
9
9
  const colord_1 = require("@jbrowse/core/util/colord");
10
+ const util_1 = require("@jbrowse/core/util");
10
11
  const useStyles = (0, mui_1.makeStyles)()(theme => {
11
12
  var _a, _b, _c, _d, _e, _f;
12
13
  return ({
13
14
  highlight: {
14
15
  height: '100%',
15
16
  position: 'absolute',
16
- background: `${(0, colord_1.colord)((_b = (_a = theme.palette.quaternary) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
17
+ background: `${(0, colord_1.colord)((_b = (_a = theme.palette.highlight) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
17
18
  .alpha(0.35)
18
19
  .toRgbString()}`,
19
- borderLeft: `1px solid ${(_d = (_c = theme.palette.quaternary) === null || _c === void 0 ? void 0 : _c.main) !== null && _d !== void 0 ? _d : 'goldenrod'}`,
20
- borderRight: `1px solid ${(_f = (_e = theme.palette.quaternary) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : 'goldenrod'}`,
20
+ borderLeft: `1px solid ${(_d = (_c = theme.palette.highlight) === null || _c === void 0 ? void 0 : _c.main) !== null && _d !== void 0 ? _d : 'goldenrod'}`,
21
+ borderRight: `1px solid ${(_f = (_e = theme.palette.highlight) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : 'goldenrod'}`,
21
22
  },
22
23
  });
23
24
  });
24
25
  const OverviewHighlight = (0, mobx_react_1.observer)(function OverviewHighlight({ model, overview, }) {
25
26
  const { classes } = useStyles();
26
27
  const { cytobandOffset } = model;
28
+ const session = (0, util_1.getSession)(model);
29
+ const { assemblyManager } = session;
27
30
  // coords
28
31
  const mapCoords = (r) => {
29
32
  const s = overview.bpToPx({
@@ -41,13 +44,19 @@ const OverviewHighlight = (0, mobx_react_1.observer)(function OverviewHighlight(
41
44
  }
42
45
  : undefined;
43
46
  };
44
- if (!model.highlight) {
45
- return null;
46
- }
47
- const h = mapCoords(model.highlight);
48
- return (react_1.default.createElement(react_1.default.Fragment, null, h ? (react_1.default.createElement("div", { className: classes.highlight, style: {
49
- width: h.width,
50
- left: h.left,
51
- } })) : null));
47
+ return model.highlight
48
+ .map(h => {
49
+ var _a;
50
+ const asm = assemblyManager.get(h === null || h === void 0 ? void 0 : h.assemblyName);
51
+ return mapCoords({
52
+ ...h,
53
+ refName: (_a = asm === null || asm === void 0 ? void 0 : asm.getCanonicalRefName(h.refName)) !== null && _a !== void 0 ? _a : h.refName,
54
+ });
55
+ })
56
+ .filter(util_1.notEmpty)
57
+ .map(({ left, width }, idx) => (react_1.default.createElement("div", { key: `${left}_${width}_${idx}`, className: classes.highlight, style: {
58
+ width: width,
59
+ left: left,
60
+ } })));
52
61
  });
53
62
  exports.default = OverviewHighlight;
@@ -5,6 +5,6 @@ type LGV = LinearGenomeViewModel;
5
5
  declare const OverviewRubberband: ({ model, overview, ControlComponent, }: {
6
6
  model: LGV;
7
7
  overview: Base1DViewModel;
8
- ControlComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
8
+ ControlComponent?: React.ReactElement;
9
9
  }) => React.JSX.Element;
10
10
  export default OverviewRubberband;