@jbrowse/plugin-linear-comparative-view 2.6.2 → 2.6.3

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.
@@ -86,21 +86,11 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
86
86
  };
87
87
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
88
88
  } & {
89
- type: import("mobx-state-tree").ISimpleType<"LinearPileupDisplay">;
90
89
  configuration: AnyConfigurationSchemaType;
91
- showSoftClipping: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
92
90
  featureHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
93
91
  noSpacing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
94
92
  fadeLikelihood: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
95
93
  trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
96
- mismatchAlpha: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
97
- sortedBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
98
- type: import("mobx-state-tree").ISimpleType<string>;
99
- pos: import("mobx-state-tree").ISimpleType<number>;
100
- tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
101
- refName: import("mobx-state-tree").ISimpleType<string>;
102
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
103
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
104
94
  colorBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
105
95
  type: import("mobx-state-tree").ISimpleType<string>;
106
96
  tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -250,45 +240,30 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
250
240
  afterAttach(): void;
251
241
  } & {
252
242
  colorTagMap: import("mobx").ObservableMap<string, string>;
253
- modificationTagMap: import("mobx").ObservableMap<string, string>; /**
254
- * #property
255
- */
256
243
  featureUnderMouseVolatile: Feature | undefined;
257
- currSortBpPerPx: number;
258
- modificationsReady: boolean;
259
- sortReady: boolean;
260
244
  tagsReady: boolean;
261
245
  } & {
262
246
  readonly autorunReady: boolean;
263
247
  } & {
264
- setModificationsReady(flag: boolean): void;
265
248
  setTagsReady(flag: boolean): void;
266
- setSortReady(flag: boolean): void;
267
- setCurrSortBpPerPx(n: number): void;
268
249
  setMaxHeight(n: number): void;
269
250
  setFeatureHeight(n?: number | undefined): void;
270
251
  setNoSpacing(flag?: boolean | undefined): void;
271
252
  setColorScheme(colorScheme: {
272
253
  type: string;
273
254
  tag?: string | undefined;
255
+ extra?: import("@jbrowse/plugin-alignments/src/shared/color").ExtraColorBy | undefined;
274
256
  }): void;
275
- updateModificationColorMap(uniqueModifications: string[]): void;
276
257
  updateColorTagMap(uniqueTag: string[]): void;
277
258
  setFeatureUnderMouse(feat?: Feature | undefined): void;
278
259
  selectFeature(feature: Feature): void;
279
- clearSelected(): void;
280
260
  copyFeatureToClipboard(feature: Feature): void;
281
- toggleSoftClipping(): void;
282
- toggleMismatchAlpha(): void;
283
261
  setConfig(conf: {
284
262
  [x: string]: any;
285
263
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
286
264
  setSubschema(slotName: string, data: unknown): any;
287
265
  } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>): void;
288
- setSortedBy(type: string, tag?: string | undefined): void;
289
- setFilterBy(filter: import("@jbrowse/plugin-alignments/src/LinearPileupDisplay/model").Filter): void;
290
- } & {
291
- reload(): void;
266
+ setFilterBy(filter: import("@jbrowse/plugin-alignments/src/LinearPileupDisplay/SharedLinearPileupDisplayMixin").Filter): void;
292
267
  } & {
293
268
  readonly rendererConfig: {
294
269
  [x: string]: any;
@@ -298,9 +273,8 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
298
273
  } & {
299
274
  readonly maxHeight: any;
300
275
  readonly featureHeightSetting: any;
301
- readonly mismatchAlphaSetting: any;
302
276
  readonly featureUnderMouse: Feature | undefined;
303
- readonly renderReady: boolean;
277
+ renderReady(): boolean;
304
278
  } & {
305
279
  readonly rendererTypeName: string;
306
280
  contextMenuItems(): ({
@@ -316,66 +290,31 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
316
290
  })[];
317
291
  readonly DisplayBlurb: (props: import("@jbrowse/plugin-alignments/src/LinearPileupDisplay/components/LinearPileupDisplayBlurb").LinearPileupDisplayBlurbProps) => import("react").JSX.Element | null;
318
292
  renderPropsPre(): any;
319
- renderProps(): any;
320
- trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
293
+ colorSchemeSubMenuItems(): {
321
294
  label: string;
322
- icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
323
- muiName: string;
324
- };
325
- type: string;
326
- checked: boolean;
327
295
  onClick: () => void;
328
- disabled?: undefined;
329
- subMenu?: undefined;
330
- } | {
331
- label: string;
332
- icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
333
- muiName: string;
334
- };
335
- disabled: boolean;
336
- subMenu: {
337
- label: string;
338
- onClick: () => void;
339
- }[];
340
- type?: undefined;
341
- checked?: undefined;
342
- onClick?: undefined;
343
- } | {
344
- label: string;
345
- icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
346
- muiName: string;
347
- };
348
- subMenu: {
349
- label: string;
350
- onClick: () => void;
351
- }[];
352
- type?: undefined;
353
- checked?: undefined;
354
- onClick?: undefined;
355
- disabled?: undefined;
356
- } | {
296
+ }[];
297
+ trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
357
298
  label: string;
358
299
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
359
300
  muiName: string;
360
301
  };
361
302
  onClick: () => void;
362
- type?: undefined;
363
- checked?: undefined;
364
- disabled?: undefined;
365
- subMenu?: undefined;
366
- } | {
367
- label: string;
368
- type: string;
369
- checked: any;
370
- onClick: () => void;
371
- icon?: undefined;
372
- disabled?: undefined;
373
- subMenu?: undefined;
374
303
  })[];
304
+ } & {
305
+ renderProps(): any;
375
306
  } & {
376
307
  afterAttach(): void;
377
308
  } & {
378
309
  contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
310
+ } & {
311
+ trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
312
+ label: string;
313
+ subMenu: {
314
+ label: string;
315
+ onClick: () => void;
316
+ }[];
317
+ })[];
379
318
  } & {
380
319
  afterCreate(): void;
381
320
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
@@ -114,7 +114,7 @@ async function navToSynteny(feature, self) {
114
114
  */
115
115
  function stateModelFactory(schema) {
116
116
  return mobx_state_tree_1.types
117
- .compose('LGVSyntenyDisplay', (0, plugin_alignments_1.linearPileupDisplayStateModelFactory)(schema), mobx_state_tree_1.types.model({
117
+ .compose('LGVSyntenyDisplay', (0, plugin_alignments_1.SharedLinearPileupDisplayMixin)(schema), mobx_state_tree_1.types.model({
118
118
  /**
119
119
  * #property
120
120
  */
@@ -142,11 +142,30 @@ function stateModelFactory(schema) {
142
142
  ];
143
143
  },
144
144
  };
145
+ })
146
+ .views(self => {
147
+ const { trackMenuItems: superTrackMenuItems, colorSchemeSubMenuItems: superColorSchemeSubMenuItems, } = self;
148
+ return {
149
+ trackMenuItems() {
150
+ return [
151
+ ...superTrackMenuItems(),
152
+ {
153
+ label: 'Color scheme',
154
+ subMenu: [...superColorSchemeSubMenuItems()],
155
+ },
156
+ ];
157
+ },
158
+ };
145
159
  })
146
160
  .actions(self => ({
147
161
  afterCreate() {
148
- // use color by strand to help indicate inversions better
149
- self.setColorScheme({ type: 'strand' });
162
+ // use color by stand to help indicate inversions better on first load, otherwise use selected orientation
163
+ if (self.colorBy) {
164
+ self.setColorScheme({ ...self.colorBy });
165
+ }
166
+ else {
167
+ self.setColorScheme({ type: 'strand' });
168
+ }
150
169
  },
151
170
  }));
152
171
  }
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  const material_1 = require("@mui/material");
8
+ const color_1 = __importDefault(require("color"));
8
9
  function SVGBackground({ width, height, shift, }) {
9
10
  const theme = (0, material_1.useTheme)();
10
- return (react_1.default.createElement("rect", { width: width + shift * 2, height: height, fill: theme.palette.background.default }));
11
+ return (react_1.default.createElement("rect", { width: width + shift * 2, height: height, fill: (0, color_1.default)(theme.palette.background.default).hex() }));
11
12
  }
12
13
  exports.default = SVGBackground;
@@ -86,21 +86,11 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
86
86
  };
87
87
  }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
88
88
  } & {
89
- type: import("mobx-state-tree").ISimpleType<"LinearPileupDisplay">;
90
89
  configuration: AnyConfigurationSchemaType;
91
- showSoftClipping: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
92
90
  featureHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
93
91
  noSpacing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
94
92
  fadeLikelihood: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
95
93
  trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
96
- mismatchAlpha: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
97
- sortedBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
98
- type: import("mobx-state-tree").ISimpleType<string>;
99
- pos: import("mobx-state-tree").ISimpleType<number>;
100
- tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
101
- refName: import("mobx-state-tree").ISimpleType<string>;
102
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
103
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
104
94
  colorBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
105
95
  type: import("mobx-state-tree").ISimpleType<string>;
106
96
  tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -250,45 +240,30 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
250
240
  afterAttach(): void;
251
241
  } & {
252
242
  colorTagMap: import("mobx").ObservableMap<string, string>;
253
- modificationTagMap: import("mobx").ObservableMap<string, string>; /**
254
- * #property
255
- */
256
243
  featureUnderMouseVolatile: Feature | undefined;
257
- currSortBpPerPx: number;
258
- modificationsReady: boolean;
259
- sortReady: boolean;
260
244
  tagsReady: boolean;
261
245
  } & {
262
246
  readonly autorunReady: boolean;
263
247
  } & {
264
- setModificationsReady(flag: boolean): void;
265
248
  setTagsReady(flag: boolean): void;
266
- setSortReady(flag: boolean): void;
267
- setCurrSortBpPerPx(n: number): void;
268
249
  setMaxHeight(n: number): void;
269
250
  setFeatureHeight(n?: number | undefined): void;
270
251
  setNoSpacing(flag?: boolean | undefined): void;
271
252
  setColorScheme(colorScheme: {
272
253
  type: string;
273
254
  tag?: string | undefined;
255
+ extra?: import("@jbrowse/plugin-alignments/src/shared/color").ExtraColorBy | undefined;
274
256
  }): void;
275
- updateModificationColorMap(uniqueModifications: string[]): void;
276
257
  updateColorTagMap(uniqueTag: string[]): void;
277
258
  setFeatureUnderMouse(feat?: Feature | undefined): void;
278
259
  selectFeature(feature: Feature): void;
279
- clearSelected(): void;
280
260
  copyFeatureToClipboard(feature: Feature): void;
281
- toggleSoftClipping(): void;
282
- toggleMismatchAlpha(): void;
283
261
  setConfig(conf: {
284
262
  [x: string]: any;
285
263
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
286
264
  setSubschema(slotName: string, data: unknown): any;
287
265
  } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>): void;
288
- setSortedBy(type: string, tag?: string | undefined): void;
289
- setFilterBy(filter: import("@jbrowse/plugin-alignments/src/LinearPileupDisplay/model").Filter): void;
290
- } & {
291
- reload(): void;
266
+ setFilterBy(filter: import("@jbrowse/plugin-alignments/src/LinearPileupDisplay/SharedLinearPileupDisplayMixin").Filter): void;
292
267
  } & {
293
268
  readonly rendererConfig: {
294
269
  [x: string]: any;
@@ -298,9 +273,8 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
298
273
  } & {
299
274
  readonly maxHeight: any;
300
275
  readonly featureHeightSetting: any;
301
- readonly mismatchAlphaSetting: any;
302
276
  readonly featureUnderMouse: Feature | undefined;
303
- readonly renderReady: boolean;
277
+ renderReady(): boolean;
304
278
  } & {
305
279
  readonly rendererTypeName: string;
306
280
  contextMenuItems(): ({
@@ -316,66 +290,31 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
316
290
  })[];
317
291
  readonly DisplayBlurb: (props: import("@jbrowse/plugin-alignments/src/LinearPileupDisplay/components/LinearPileupDisplayBlurb").LinearPileupDisplayBlurbProps) => import("react").JSX.Element | null;
318
292
  renderPropsPre(): any;
319
- renderProps(): any;
320
- trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
293
+ colorSchemeSubMenuItems(): {
321
294
  label: string;
322
- icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
323
- muiName: string;
324
- };
325
- type: string;
326
- checked: boolean;
327
295
  onClick: () => void;
328
- disabled?: undefined;
329
- subMenu?: undefined;
330
- } | {
331
- label: string;
332
- icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
333
- muiName: string;
334
- };
335
- disabled: boolean;
336
- subMenu: {
337
- label: string;
338
- onClick: () => void;
339
- }[];
340
- type?: undefined;
341
- checked?: undefined;
342
- onClick?: undefined;
343
- } | {
344
- label: string;
345
- icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
346
- muiName: string;
347
- };
348
- subMenu: {
349
- label: string;
350
- onClick: () => void;
351
- }[];
352
- type?: undefined;
353
- checked?: undefined;
354
- onClick?: undefined;
355
- disabled?: undefined;
356
- } | {
296
+ }[];
297
+ trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
357
298
  label: string;
358
299
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
359
300
  muiName: string;
360
301
  };
361
302
  onClick: () => void;
362
- type?: undefined;
363
- checked?: undefined;
364
- disabled?: undefined;
365
- subMenu?: undefined;
366
- } | {
367
- label: string;
368
- type: string;
369
- checked: any;
370
- onClick: () => void;
371
- icon?: undefined;
372
- disabled?: undefined;
373
- subMenu?: undefined;
374
303
  })[];
304
+ } & {
305
+ renderProps(): any;
375
306
  } & {
376
307
  afterAttach(): void;
377
308
  } & {
378
309
  contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
310
+ } & {
311
+ trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
312
+ label: string;
313
+ subMenu: {
314
+ label: string;
315
+ onClick: () => void;
316
+ }[];
317
+ })[];
379
318
  } & {
380
319
  afterCreate(): void;
381
320
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
@@ -1,6 +1,6 @@
1
1
  import { ConfigurationReference, } from '@jbrowse/core/configuration';
2
2
  import { getSession, getContainingTrack, getContainingView, } from '@jbrowse/core/util';
3
- import { MismatchParser, linearPileupDisplayStateModelFactory, } from '@jbrowse/plugin-alignments';
3
+ import { MismatchParser, SharedLinearPileupDisplayMixin, } from '@jbrowse/plugin-alignments';
4
4
  import { types } from 'mobx-state-tree';
5
5
  import { when } from 'mobx';
6
6
  const { parseCigar } = MismatchParser;
@@ -112,7 +112,7 @@ async function navToSynteny(feature, self) {
112
112
  */
113
113
  function stateModelFactory(schema) {
114
114
  return types
115
- .compose('LGVSyntenyDisplay', linearPileupDisplayStateModelFactory(schema), types.model({
115
+ .compose('LGVSyntenyDisplay', SharedLinearPileupDisplayMixin(schema), types.model({
116
116
  /**
117
117
  * #property
118
118
  */
@@ -140,11 +140,30 @@ function stateModelFactory(schema) {
140
140
  ];
141
141
  },
142
142
  };
143
+ })
144
+ .views(self => {
145
+ const { trackMenuItems: superTrackMenuItems, colorSchemeSubMenuItems: superColorSchemeSubMenuItems, } = self;
146
+ return {
147
+ trackMenuItems() {
148
+ return [
149
+ ...superTrackMenuItems(),
150
+ {
151
+ label: 'Color scheme',
152
+ subMenu: [...superColorSchemeSubMenuItems()],
153
+ },
154
+ ];
155
+ },
156
+ };
143
157
  })
144
158
  .actions(self => ({
145
159
  afterCreate() {
146
- // use color by strand to help indicate inversions better
147
- self.setColorScheme({ type: 'strand' });
160
+ // use color by stand to help indicate inversions better on first load, otherwise use selected orientation
161
+ if (self.colorBy) {
162
+ self.setColorScheme({ ...self.colorBy });
163
+ }
164
+ else {
165
+ self.setColorScheme({ type: 'strand' });
166
+ }
148
167
  },
149
168
  }));
150
169
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTheme } from '@mui/material';
3
+ import Color from 'color';
3
4
  export default function SVGBackground({ width, height, shift, }) {
4
5
  const theme = useTheme();
5
- return (React.createElement("rect", { width: width + shift * 2, height: height, fill: theme.palette.background.default }));
6
+ return (React.createElement("rect", { width: width + shift * 2, height: height, fill: Color(theme.palette.background.default).hex() }));
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-comparative-view",
3
- "version": "2.6.2",
3
+ "version": "2.6.3",
4
4
  "description": "JBrowse 2 linear comparative view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -39,6 +39,7 @@
39
39
  "@mui/icons-material": "^5.0.1",
40
40
  "@popperjs/core": "^2.0.0",
41
41
  "clone": "^2.1.2",
42
+ "color": "^3.1.3",
42
43
  "copy-to-clipboard": "^3.3.1",
43
44
  "file-saver": "^2.0.0",
44
45
  "react-popper": "^2.0.0"
@@ -62,5 +63,5 @@
62
63
  "publishConfig": {
63
64
  "access": "public"
64
65
  },
65
- "gitHead": "bbea587a402d9974acdd804a33f4b77f31a2fd5f"
66
+ "gitHead": "ed402c87efb0904858d602c363bd1757d5742129"
66
67
  }