@jbrowse/plugin-alignments 3.0.3 → 3.0.5

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.
@@ -267,7 +267,7 @@ function SharedLinearPileupDisplayMixin(configSchema) {
267
267
  const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
268
268
  featureId: f,
269
269
  sessionId,
270
- layoutId: (0, util_1.getContainingView)(self).id,
270
+ layoutId: (0, util_1.getContainingTrack)(self).id,
271
271
  rendererType: 'PileupRenderer',
272
272
  }));
273
273
  if ((0, mobx_state_tree_1.isAlive)(self) && feature) {
@@ -296,7 +296,7 @@ function SharedLinearPileupDisplayMixin(configSchema) {
296
296
  const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
297
297
  featureId: f,
298
298
  sessionId,
299
- layoutId: (0, util_1.getContainingView)(self).id,
299
+ layoutId: (0, util_1.getContainingTrack)(self).id,
300
300
  rendererType: 'PileupRenderer',
301
301
  }));
302
302
  if (feature) {
@@ -489,11 +489,10 @@ function SharedLinearPileupDisplayMixin(configSchema) {
489
489
  }
490
490
  else {
491
491
  const sessionId = (0, tracks_1.getRpcSessionId)(self);
492
- const view = (0, util_1.getContainingView)(self);
493
492
  const { feature } = (await session.rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
494
493
  featureId,
495
494
  sessionId,
496
- layoutId: view.id,
495
+ layoutId: (0, util_1.getContainingTrack)(self).id,
497
496
  rendererType: 'PileupRenderer',
498
497
  }));
499
498
  if ((0, mobx_state_tree_1.isAlive)(self) &&
@@ -37,10 +37,12 @@ function doAfterAttach(model) {
37
37
  adapterConfig,
38
38
  rendererType: rendererType.name,
39
39
  sessionId: (0, tracks_1.getRpcSessionId)(model),
40
- layoutId: view.id,
40
+ layoutId: (0, util_1.getContainingTrack)(model).id,
41
41
  timeout: 1000000,
42
42
  statusCallback: (arg) => {
43
- model.setMessage(arg);
43
+ if ((0, mobx_state_tree_1.isAlive)(model)) {
44
+ model.setMessage(arg);
45
+ }
44
46
  },
45
47
  ...model.renderPropsPre(),
46
48
  });
@@ -1,33 +1,23 @@
1
- import { LayoutSession } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
1
+ import { LayoutSession } from '@jbrowse/core/pluggableElementTypes/renderers/LayoutSession';
2
2
  import type { FilterBy, SortedBy } from '../shared/types';
3
- import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
- import type SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
3
+ import type { CachedLayout, LayoutSessionProps } from '@jbrowse/core/pluggableElementTypes/renderers/LayoutSession';
5
4
  import type GranularRectLayout from '@jbrowse/core/util/layouts/GranularRectLayout';
6
5
  import type MultiLayout from '@jbrowse/core/util/layouts/MultiLayout';
7
- export interface PileupLayoutSessionProps {
8
- config: AnyConfigurationModel;
9
- bpPerPx: number;
10
- filters: SerializableFilterChain;
6
+ export interface PileupLayoutSessionProps extends LayoutSessionProps {
11
7
  filterBy: FilterBy;
12
8
  sortedBy: SortedBy;
13
9
  showSoftClip: boolean;
14
10
  }
15
11
  type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
16
- interface CachedPileupLayout {
17
- layout: MyMultiLayout;
18
- config: AnyConfigurationModel;
19
- filters?: SerializableFilterChain;
20
- filterBy?: FilterBy;
21
- sortedBy?: SortedBy;
22
- showSoftClip: boolean;
12
+ interface CachedPileupLayout extends CachedLayout {
13
+ props: PileupLayoutSessionProps;
23
14
  }
24
15
  export declare class PileupLayoutSession extends LayoutSession {
25
- sortedBy?: SortedBy;
26
- filterBy?: FilterBy;
27
- showSoftClip: boolean;
28
- constructor(args: PileupLayoutSessionProps);
29
- cachedLayoutIsValid(cachedLayout: CachedPileupLayout): boolean;
16
+ props: PileupLayoutSessionProps;
30
17
  cachedLayout: CachedPileupLayout | undefined;
18
+ constructor(props: PileupLayoutSessionProps);
19
+ update(props: PileupLayoutSessionProps): this;
20
+ cachedLayoutIsValid(cachedLayout: CachedPileupLayout): boolean;
31
21
  get layout(): MyMultiLayout;
32
22
  }
33
23
  export {};
@@ -4,30 +4,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.PileupLayoutSession = void 0;
7
- const configuration_1 = require("@jbrowse/core/configuration");
8
- const BoxRendererType_1 = require("@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType");
7
+ const LayoutSession_1 = require("@jbrowse/core/pluggableElementTypes/renderers/LayoutSession");
9
8
  const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
10
- class PileupLayoutSession extends BoxRendererType_1.LayoutSession {
11
- constructor(args) {
12
- super(args);
13
- this.showSoftClip = false;
14
- this.config = args.config;
9
+ class PileupLayoutSession extends LayoutSession_1.LayoutSession {
10
+ constructor(props) {
11
+ super(props);
12
+ this.props = props;
13
+ }
14
+ update(props) {
15
+ super.update(props);
16
+ this.props = props;
17
+ return this;
15
18
  }
16
19
  cachedLayoutIsValid(cachedLayout) {
17
20
  return (super.cachedLayoutIsValid(cachedLayout) &&
18
- this.showSoftClip === cachedLayout.showSoftClip &&
19
- (0, fast_deep_equal_1.default)(this.sortedBy, cachedLayout.sortedBy) &&
20
- (0, fast_deep_equal_1.default)(this.filterBy, cachedLayout.filterBy));
21
+ this.props.showSoftClip === cachedLayout.props.showSoftClip &&
22
+ (0, fast_deep_equal_1.default)(this.props.sortedBy, cachedLayout.props.sortedBy) &&
23
+ (0, fast_deep_equal_1.default)(this.props.filterBy, cachedLayout.props.filterBy));
21
24
  }
22
25
  get layout() {
23
26
  if (!this.cachedLayout || !this.cachedLayoutIsValid(this.cachedLayout)) {
24
27
  this.cachedLayout = {
25
28
  layout: this.makeLayout(),
26
- config: (0, configuration_1.readConfObject)(this.config),
27
- filters: this.filters,
28
- filterBy: this.filterBy,
29
- sortedBy: this.sortedBy,
30
- showSoftClip: this.showSoftClip,
29
+ props: this.props,
31
30
  };
32
31
  }
33
32
  return this.cachedLayout.layout;
@@ -43,6 +43,6 @@ export default class PileupRenderer extends BoxRendererType {
43
43
  reactElement?: React.ReactElement;
44
44
  html?: string;
45
45
  }>;
46
- createSession(args: PileupLayoutSessionProps): PileupLayoutSession;
46
+ createLayoutSession(args: PileupLayoutSessionProps): PileupLayoutSession;
47
47
  }
48
48
  export type { RenderArgs, RenderArgsSerialized, RenderResults, ResultsDeserialized, ResultsSerialized, } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
@@ -122,7 +122,7 @@ class PileupRenderer extends BoxRendererType_1.default {
122
122
  containsNoTransferables: true,
123
123
  };
124
124
  }
125
- createSession(args) {
125
+ createLayoutSession(args) {
126
126
  return new PileupLayoutSession_1.PileupLayoutSession(args);
127
127
  }
128
128
  }
@@ -1,7 +1,7 @@
1
+ import { type IAnyStateTreeNode } from 'mobx-state-tree';
1
2
  import type { ModificationType } from './types';
2
3
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
4
  import type { BlockSet } from '@jbrowse/core/util/blockTypes';
4
- import type { IAnyStateTreeNode } from 'mobx-state-tree';
5
5
  export interface ModificationOpts {
6
6
  headers?: Record<string, string>;
7
7
  stopToken?: string;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getUniqueModifications = getUniqueModifications;
4
4
  const util_1 = require("@jbrowse/core/util");
5
5
  const tracks_1 = require("@jbrowse/core/util/tracks");
6
+ const mobx_state_tree_1 = require("mobx-state-tree");
6
7
  async function getUniqueModifications({ model, adapterConfig, blocks, opts, }) {
7
8
  const { rpcManager } = (0, util_1.getSession)(model);
8
9
  const sessionId = (0, tracks_1.getRpcSessionId)(model);
@@ -11,7 +12,9 @@ async function getUniqueModifications({ model, adapterConfig, blocks, opts, }) {
11
12
  sessionId,
12
13
  regions: blocks.contentBlocks,
13
14
  statusCallback: (arg) => {
14
- model.setMessage(arg);
15
+ if ((0, mobx_state_tree_1.isAlive)(model)) {
16
+ model.setMessage(arg);
17
+ }
15
18
  },
16
19
  ...opts,
17
20
  });
@@ -228,7 +228,7 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
228
228
  const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
229
229
  featureId: f,
230
230
  sessionId,
231
- layoutId: getContainingView(self).id,
231
+ layoutId: getContainingTrack(self).id,
232
232
  rendererType: 'PileupRenderer',
233
233
  }));
234
234
  if (isAlive(self) && feature) {
@@ -257,7 +257,7 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
257
257
  const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
258
258
  featureId: f,
259
259
  sessionId,
260
- layoutId: getContainingView(self).id,
260
+ layoutId: getContainingTrack(self).id,
261
261
  rendererType: 'PileupRenderer',
262
262
  }));
263
263
  if (feature) {
@@ -450,11 +450,10 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
450
450
  }
451
451
  else {
452
452
  const sessionId = getRpcSessionId(self);
453
- const view = getContainingView(self);
454
453
  const { feature } = (await session.rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
455
454
  featureId,
456
455
  sessionId,
457
- layoutId: view.id,
456
+ layoutId: getContainingTrack(self).id,
458
457
  rendererType: 'PileupRenderer',
459
458
  }));
460
459
  if (isAlive(self) &&
@@ -1,4 +1,4 @@
1
- import { getContainingView, getSession } from '@jbrowse/core/util';
1
+ import { getContainingTrack, getContainingView, getSession, } from '@jbrowse/core/util';
2
2
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
3
3
  import { isAlive } from 'mobx-state-tree';
4
4
  import { getUniqueModifications } from '../shared/getUniqueModifications';
@@ -34,10 +34,12 @@ export function doAfterAttach(model) {
34
34
  adapterConfig,
35
35
  rendererType: rendererType.name,
36
36
  sessionId: getRpcSessionId(model),
37
- layoutId: view.id,
37
+ layoutId: getContainingTrack(model).id,
38
38
  timeout: 1000000,
39
39
  statusCallback: (arg) => {
40
- model.setMessage(arg);
40
+ if (isAlive(model)) {
41
+ model.setMessage(arg);
42
+ }
41
43
  },
42
44
  ...model.renderPropsPre(),
43
45
  });
@@ -1,33 +1,23 @@
1
- import { LayoutSession } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
1
+ import { LayoutSession } from '@jbrowse/core/pluggableElementTypes/renderers/LayoutSession';
2
2
  import type { FilterBy, SortedBy } from '../shared/types';
3
- import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
- import type SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
3
+ import type { CachedLayout, LayoutSessionProps } from '@jbrowse/core/pluggableElementTypes/renderers/LayoutSession';
5
4
  import type GranularRectLayout from '@jbrowse/core/util/layouts/GranularRectLayout';
6
5
  import type MultiLayout from '@jbrowse/core/util/layouts/MultiLayout';
7
- export interface PileupLayoutSessionProps {
8
- config: AnyConfigurationModel;
9
- bpPerPx: number;
10
- filters: SerializableFilterChain;
6
+ export interface PileupLayoutSessionProps extends LayoutSessionProps {
11
7
  filterBy: FilterBy;
12
8
  sortedBy: SortedBy;
13
9
  showSoftClip: boolean;
14
10
  }
15
11
  type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
16
- interface CachedPileupLayout {
17
- layout: MyMultiLayout;
18
- config: AnyConfigurationModel;
19
- filters?: SerializableFilterChain;
20
- filterBy?: FilterBy;
21
- sortedBy?: SortedBy;
22
- showSoftClip: boolean;
12
+ interface CachedPileupLayout extends CachedLayout {
13
+ props: PileupLayoutSessionProps;
23
14
  }
24
15
  export declare class PileupLayoutSession extends LayoutSession {
25
- sortedBy?: SortedBy;
26
- filterBy?: FilterBy;
27
- showSoftClip: boolean;
28
- constructor(args: PileupLayoutSessionProps);
29
- cachedLayoutIsValid(cachedLayout: CachedPileupLayout): boolean;
16
+ props: PileupLayoutSessionProps;
30
17
  cachedLayout: CachedPileupLayout | undefined;
18
+ constructor(props: PileupLayoutSessionProps);
19
+ update(props: PileupLayoutSessionProps): this;
20
+ cachedLayoutIsValid(cachedLayout: CachedPileupLayout): boolean;
31
21
  get layout(): MyMultiLayout;
32
22
  }
33
23
  export {};
@@ -1,27 +1,26 @@
1
- import { readConfObject } from '@jbrowse/core/configuration';
2
- import { LayoutSession } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
1
+ import { LayoutSession } from '@jbrowse/core/pluggableElementTypes/renderers/LayoutSession';
3
2
  import deepEqual from 'fast-deep-equal';
4
3
  export class PileupLayoutSession extends LayoutSession {
5
- constructor(args) {
6
- super(args);
7
- this.showSoftClip = false;
8
- this.config = args.config;
4
+ constructor(props) {
5
+ super(props);
6
+ this.props = props;
7
+ }
8
+ update(props) {
9
+ super.update(props);
10
+ this.props = props;
11
+ return this;
9
12
  }
10
13
  cachedLayoutIsValid(cachedLayout) {
11
14
  return (super.cachedLayoutIsValid(cachedLayout) &&
12
- this.showSoftClip === cachedLayout.showSoftClip &&
13
- deepEqual(this.sortedBy, cachedLayout.sortedBy) &&
14
- deepEqual(this.filterBy, cachedLayout.filterBy));
15
+ this.props.showSoftClip === cachedLayout.props.showSoftClip &&
16
+ deepEqual(this.props.sortedBy, cachedLayout.props.sortedBy) &&
17
+ deepEqual(this.props.filterBy, cachedLayout.props.filterBy));
15
18
  }
16
19
  get layout() {
17
20
  if (!this.cachedLayout || !this.cachedLayoutIsValid(this.cachedLayout)) {
18
21
  this.cachedLayout = {
19
22
  layout: this.makeLayout(),
20
- config: readConfObject(this.config),
21
- filters: this.filters,
22
- filterBy: this.filterBy,
23
- sortedBy: this.sortedBy,
24
- showSoftClip: this.showSoftClip,
23
+ props: this.props,
25
24
  };
26
25
  }
27
26
  return this.cachedLayout.layout;
@@ -43,6 +43,6 @@ export default class PileupRenderer extends BoxRendererType {
43
43
  reactElement?: React.ReactElement;
44
44
  html?: string;
45
45
  }>;
46
- createSession(args: PileupLayoutSessionProps): PileupLayoutSession;
46
+ createLayoutSession(args: PileupLayoutSessionProps): PileupLayoutSession;
47
47
  }
48
48
  export type { RenderArgs, RenderArgsSerialized, RenderResults, ResultsDeserialized, ResultsSerialized, } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
@@ -84,7 +84,7 @@ export default class PileupRenderer extends BoxRendererType {
84
84
  containsNoTransferables: true,
85
85
  };
86
86
  }
87
- createSession(args) {
87
+ createLayoutSession(args) {
88
88
  return new PileupLayoutSession(args);
89
89
  }
90
90
  }
@@ -1,7 +1,7 @@
1
+ import { type IAnyStateTreeNode } from 'mobx-state-tree';
1
2
  import type { ModificationType } from './types';
2
3
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
4
  import type { BlockSet } from '@jbrowse/core/util/blockTypes';
4
- import type { IAnyStateTreeNode } from 'mobx-state-tree';
5
5
  export interface ModificationOpts {
6
6
  headers?: Record<string, string>;
7
7
  stopToken?: string;
@@ -1,5 +1,6 @@
1
1
  import { getSession } from '@jbrowse/core/util';
2
2
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
3
+ import { isAlive } from 'mobx-state-tree';
3
4
  export async function getUniqueModifications({ model, adapterConfig, blocks, opts, }) {
4
5
  const { rpcManager } = getSession(model);
5
6
  const sessionId = getRpcSessionId(model);
@@ -8,7 +9,9 @@ export async function getUniqueModifications({ model, adapterConfig, blocks, opt
8
9
  sessionId,
9
10
  regions: blocks.contentBlocks,
10
11
  statusCallback: (arg) => {
11
- model.setMessage(arg);
12
+ if (isAlive(model)) {
13
+ model.setMessage(arg);
14
+ }
12
15
  },
13
16
  ...opts,
14
17
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-alignments",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "JBrowse 2 alignments adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -38,10 +38,10 @@
38
38
  "dependencies": {
39
39
  "@gmod/bam": "^5.0.0",
40
40
  "@gmod/cram": "^4.0.1",
41
- "@jbrowse/core": "^3.0.3",
42
- "@jbrowse/plugin-linear-genome-view": "^3.0.3",
43
- "@jbrowse/plugin-wiggle": "^3.0.3",
44
- "@jbrowse/sv-core": "^3.0.3",
41
+ "@jbrowse/core": "^3.0.5",
42
+ "@jbrowse/plugin-linear-genome-view": "^3.0.5",
43
+ "@jbrowse/plugin-wiggle": "^3.0.5",
44
+ "@jbrowse/sv-core": "^3.0.5",
45
45
  "@mui/icons-material": "^6.0.0",
46
46
  "@mui/material": "^6.0.0",
47
47
  "canvas2svg": "^1.0.16",
@@ -63,5 +63,5 @@
63
63
  "distModule": "esm/index.js",
64
64
  "srcModule": "src/index.ts",
65
65
  "module": "esm/index.js",
66
- "gitHead": "f516540428282351d26e46743e69a724651bfb2c"
66
+ "gitHead": "a03749efe19e51609922272b845a331897346789"
67
67
  }