@jbrowse/plugin-arc 2.17.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/ArcRenderer/ArcRendering.d.ts +3 -4
  2. package/dist/ArcRenderer/ArcRendering.js +37 -37
  3. package/dist/ArcRenderer/configSchema.d.ts +0 -18
  4. package/dist/ArcRenderer/configSchema.js +1 -22
  5. package/dist/ArcRenderer/index.d.ts +1 -1
  6. package/dist/ArcRenderer/index.js +1 -1
  7. package/dist/ArcTooltip.d.ts +1 -2
  8. package/dist/ArcTooltip.js +6 -30
  9. package/dist/LinearArcDisplay/configSchema.d.ts +1 -7
  10. package/dist/LinearArcDisplay/configSchema.js +1 -10
  11. package/dist/LinearArcDisplay/index.d.ts +1 -1
  12. package/dist/LinearArcDisplay/model.d.ts +18 -87
  13. package/dist/LinearArcDisplay/model.js +2 -40
  14. package/dist/LinearPairedArcDisplay/afterAttach.d.ts +1 -1
  15. package/dist/LinearPairedArcDisplay/afterAttach.js +1 -1
  16. package/dist/LinearPairedArcDisplay/components/Arcs.d.ts +2 -3
  17. package/dist/LinearPairedArcDisplay/components/Arcs.js +46 -40
  18. package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +2 -3
  19. package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.js +33 -32
  20. package/dist/LinearPairedArcDisplay/components/ReactComponent.d.ts +2 -3
  21. package/dist/LinearPairedArcDisplay/components/ReactComponent.js +3 -4
  22. package/dist/LinearPairedArcDisplay/components/util.d.ts +1 -1
  23. package/dist/LinearPairedArcDisplay/components/util.js +1 -7
  24. package/dist/LinearPairedArcDisplay/configSchema.d.ts +0 -6
  25. package/dist/LinearPairedArcDisplay/configSchema.js +0 -9
  26. package/dist/LinearPairedArcDisplay/fetchChains.d.ts +1 -1
  27. package/dist/LinearPairedArcDisplay/fetchChains.js +1 -2
  28. package/dist/LinearPairedArcDisplay/index.d.ts +1 -1
  29. package/dist/LinearPairedArcDisplay/index.js +18 -8
  30. package/dist/LinearPairedArcDisplay/model.d.ts +9 -53
  31. package/dist/LinearPairedArcDisplay/model.js +19 -48
  32. package/dist/LinearPairedArcDisplay/renderSvg.d.ts +2 -3
  33. package/dist/LinearPairedArcDisplay/renderSvg.js +2 -7
  34. package/dist/LinearPairedArcDisplay/util.d.ts +4 -4
  35. package/dist/LinearPairedArcDisplay/util.js +3 -14
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.js +3 -3
  38. package/esm/ArcRenderer/ArcRendering.d.ts +3 -4
  39. package/esm/ArcRenderer/ArcRendering.js +21 -31
  40. package/esm/ArcRenderer/configSchema.d.ts +0 -18
  41. package/esm/ArcRenderer/configSchema.js +1 -22
  42. package/esm/ArcRenderer/index.d.ts +1 -1
  43. package/esm/ArcRenderer/index.js +1 -1
  44. package/esm/ArcTooltip.d.ts +1 -2
  45. package/esm/ArcTooltip.js +6 -7
  46. package/esm/LinearArcDisplay/configSchema.d.ts +1 -7
  47. package/esm/LinearArcDisplay/configSchema.js +1 -10
  48. package/esm/LinearArcDisplay/index.d.ts +1 -1
  49. package/esm/LinearArcDisplay/model.d.ts +18 -87
  50. package/esm/LinearArcDisplay/model.js +3 -41
  51. package/esm/LinearPairedArcDisplay/afterAttach.d.ts +1 -1
  52. package/esm/LinearPairedArcDisplay/afterAttach.js +1 -1
  53. package/esm/LinearPairedArcDisplay/components/Arcs.d.ts +2 -3
  54. package/esm/LinearPairedArcDisplay/components/Arcs.js +29 -33
  55. package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +2 -3
  56. package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.js +16 -25
  57. package/esm/LinearPairedArcDisplay/components/ReactComponent.d.ts +2 -3
  58. package/esm/LinearPairedArcDisplay/components/ReactComponent.js +3 -4
  59. package/esm/LinearPairedArcDisplay/components/util.d.ts +1 -1
  60. package/esm/LinearPairedArcDisplay/components/util.js +1 -7
  61. package/esm/LinearPairedArcDisplay/configSchema.d.ts +0 -6
  62. package/esm/LinearPairedArcDisplay/configSchema.js +0 -9
  63. package/esm/LinearPairedArcDisplay/fetchChains.d.ts +1 -1
  64. package/esm/LinearPairedArcDisplay/fetchChains.js +1 -2
  65. package/esm/LinearPairedArcDisplay/index.d.ts +1 -1
  66. package/esm/LinearPairedArcDisplay/index.js +1 -1
  67. package/esm/LinearPairedArcDisplay/model.d.ts +9 -53
  68. package/esm/LinearPairedArcDisplay/model.js +3 -42
  69. package/esm/LinearPairedArcDisplay/renderSvg.d.ts +2 -3
  70. package/esm/LinearPairedArcDisplay/renderSvg.js +2 -7
  71. package/esm/LinearPairedArcDisplay/util.d.ts +4 -4
  72. package/esm/LinearPairedArcDisplay/util.js +3 -14
  73. package/esm/index.d.ts +1 -1
  74. package/esm/index.js +3 -3
  75. package/package.json +2 -2
@@ -1,17 +1,7 @@
1
- import React from 'react';
2
- import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
- import { Instance } from 'mobx-state-tree';
4
- import { Feature } from '@jbrowse/core/util';
5
- /**
6
- * #stateModel LinearPairedArcDisplay
7
- * this is a non-block-based track type, and can connect arcs across multiple
8
- * displayedRegions
9
- *
10
- * extends
11
- * - [BaseDisplay](../basedisplay)
12
- * - [TrackHeightMixin](../trackheightmixin)
13
- * - [FeatureDensityMixin](../featuredensitymixin)
14
- */
1
+ import type React from 'react';
2
+ import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
+ import type { Feature } from '@jbrowse/core/util';
4
+ import type { Instance } from 'mobx-state-tree';
15
5
  export declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
16
6
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
17
7
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -22,17 +12,8 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
22
12
  userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
23
13
  userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
24
14
  } & {
25
- /**
26
- * #property
27
- */
28
15
  type: import("mobx-state-tree").ISimpleType<"LinearPairedArcDisplay">;
29
- /**
30
- * #property
31
- */
32
16
  configuration: AnyConfigurationSchemaType;
33
- /**
34
- * #property
35
- */
36
17
  displayMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
37
18
  }, {
38
19
  rendererTypeName: string;
@@ -49,22 +30,14 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
49
30
  error: unknown;
50
31
  message: string | undefined;
51
32
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
52
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree" /**
53
- * #property
54
- */).ISimpleType<string>, [undefined]>;
33
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
55
34
  type: import("mobx-state-tree").ISimpleType<string>;
56
- rpcDriverName: import("mobx-state-tree").IMaybe<import(
57
- /**
58
- * #getter
59
- */
60
- "mobx-state-tree").ISimpleType<string>>;
35
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
61
36
  }, {
62
37
  rendererTypeName: string;
63
38
  error: unknown;
64
39
  message: string | undefined;
65
- }, import("mobx-state-tree" /**
66
- * #action
67
- */)._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
40
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
68
41
  onHorizontalScroll?: () => void;
69
42
  blockState?: Record<string, any>;
70
43
  }>;
@@ -131,40 +104,23 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
131
104
  readonly regionTooLarge: boolean;
132
105
  readonly regionTooLargeReason: string;
133
106
  } & {
107
+ readonly statsReadyAndRegionNotTooLarge: boolean;
134
108
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
135
- regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): React.JSX.Element | null;
109
+ regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
136
110
  } & {
137
111
  lastDrawnOffsetPx: number;
138
112
  features: Feature[] | undefined;
139
113
  loading: boolean;
140
114
  drawn: boolean;
141
115
  } & {
142
- /**
143
- * #getter
144
- */
145
116
  readonly displayModeSetting: any;
146
117
  } & {
147
- /**
148
- * #action
149
- */
150
118
  selectFeature(feature: Feature): void;
151
- /**
152
- * #action
153
- */
154
119
  setLoading(flag: boolean): void;
155
- /**
156
- * #action
157
- */
158
120
  setFeatures(f: Feature[]): void;
159
- /**
160
- * #action
161
- */
162
121
  setDisplayMode(flag: string): void;
163
122
  } & {
164
123
  afterAttach(): void;
165
- /**
166
- * #action
167
- */
168
124
  renderSvg(opts: {
169
125
  rasterizeLayers?: boolean;
170
126
  }): Promise<React.ReactNode>;
@@ -1,32 +1,13 @@
1
- import { ConfigurationReference, getConf, } from '@jbrowse/core/configuration';
2
- import { types } from 'mobx-state-tree';
3
- import { getSession, isSessionModelWithWidgets, getContainingView, getContainingTrack, isSelectionContainer, } from '@jbrowse/core/util';
1
+ import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
4
2
  import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes';
3
+ import { getContainingTrack, getContainingView, getSession, isSelectionContainer, isSessionModelWithWidgets, } from '@jbrowse/core/util';
5
4
  import { FeatureDensityMixin, TrackHeightMixin, } from '@jbrowse/plugin-linear-genome-view';
6
- /**
7
- * #stateModel LinearPairedArcDisplay
8
- * this is a non-block-based track type, and can connect arcs across multiple
9
- * displayedRegions
10
- *
11
- * extends
12
- * - [BaseDisplay](../basedisplay)
13
- * - [TrackHeightMixin](../trackheightmixin)
14
- * - [FeatureDensityMixin](../featuredensitymixin)
15
- */
5
+ import { types } from 'mobx-state-tree';
16
6
  export function stateModelFactory(configSchema) {
17
7
  return types
18
8
  .compose('LinearPairedArcDisplay', BaseDisplay, TrackHeightMixin(), FeatureDensityMixin(), types.model({
19
- /**
20
- * #property
21
- */
22
9
  type: types.literal('LinearPairedArcDisplay'),
23
- /**
24
- * #property
25
- */
26
10
  configuration: ConfigurationReference(configSchema),
27
- /**
28
- * #property
29
- */
30
11
  displayMode: types.maybe(types.string),
31
12
  }))
32
13
  .volatile(() => ({
@@ -36,18 +17,12 @@ export function stateModelFactory(configSchema) {
36
17
  drawn: true,
37
18
  }))
38
19
  .views(self => ({
39
- /**
40
- * #getter
41
- */
42
20
  get displayModeSetting() {
43
21
  var _a;
44
22
  return (_a = self.displayMode) !== null && _a !== void 0 ? _a : getConf(self, ['renderer', 'displayMode']);
45
23
  },
46
24
  }))
47
25
  .actions(self => ({
48
- /**
49
- * #action
50
- */
51
26
  selectFeature(feature) {
52
27
  const session = getSession(self);
53
28
  if (isSessionModelWithWidgets(session)) {
@@ -62,28 +37,18 @@ export function stateModelFactory(configSchema) {
62
37
  session.setSelection(feature);
63
38
  }
64
39
  },
65
- /**
66
- * #action
67
- */
68
40
  setLoading(flag) {
69
41
  self.loading = flag;
70
42
  },
71
- /**
72
- * #action
73
- */
74
43
  setFeatures(f) {
75
44
  self.features = f;
76
45
  },
77
- /**
78
- * #action
79
- */
80
46
  setDisplayMode(flag) {
81
47
  self.displayMode = flag;
82
48
  },
83
49
  }))
84
50
  .actions(self => ({
85
51
  afterAttach() {
86
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
87
52
  ;
88
53
  (async () => {
89
54
  try {
@@ -96,12 +61,8 @@ export function stateModelFactory(configSchema) {
96
61
  }
97
62
  })();
98
63
  },
99
- /**
100
- * #action
101
- */
102
64
  async renderSvg(opts) {
103
65
  const { renderArcSvg } = await import('./renderSvg');
104
- // @ts-expect-error
105
66
  return renderArcSvg(self, opts);
106
67
  },
107
68
  }));
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { LinearArcDisplayModel } from './model';
1
+ import type { LinearArcDisplayModel } from './model';
3
2
  export declare function renderArcSvg(model: LinearArcDisplayModel, _opts: {
4
3
  rasterizeLayers?: boolean;
5
- }): Promise<React.JSX.Element>;
4
+ }): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getContainingView, when } from '@jbrowse/core/util';
3
3
  import Arcs from './components/Arcs';
4
4
  export async function renderArcSvg(model, _opts) {
@@ -7,10 +7,5 @@ export async function renderArcSvg(model, _opts) {
7
7
  const width = view.dynamicBlocks.totalWidthPx;
8
8
  const height = model.height;
9
9
  const clipid = `arc-${model.id}`;
10
- return (React.createElement(React.Fragment, null,
11
- React.createElement("defs", null,
12
- React.createElement("clipPath", { id: clipid },
13
- React.createElement("rect", { x: 0, y: 0, width: width, height: height }))),
14
- React.createElement("g", { clipPath: `url(#${clipid})` },
15
- React.createElement(Arcs, { model: model, exportSVG: true }))));
10
+ return (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipid, children: _jsx("rect", { x: 0, y: 0, width: width, height: height }) }) }), _jsx("g", { clipPath: `url(#${clipid})`, children: _jsx(Arcs, { model: model, exportSVG: true }) })] }));
16
11
  }
@@ -1,7 +1,7 @@
1
- import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { Feature, AugmentedRegion } from '@jbrowse/core/util';
3
- import { IAnyStateTreeNode } from 'mobx-state-tree';
4
- import { IAutorunOptions } from 'mobx';
1
+ import type { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
+ import type { AugmentedRegion, Feature } from '@jbrowse/core/util';
3
+ import type { IAutorunOptions } from 'mobx';
4
+ import type { IAnyStateTreeNode } from 'mobx-state-tree';
5
5
  export declare function getTag(feature: Feature, tag: string): any;
6
6
  export declare function getTagAlt(feature: Feature, tag: string, alt: string): any;
7
7
  export declare const orientationTypes: {
@@ -1,20 +1,14 @@
1
- import { toArray } from 'rxjs/operators';
2
- import { firstValueFrom } from 'rxjs';
3
- import { addDisposer, isAlive } from 'mobx-state-tree';
4
1
  import { autorun } from 'mobx';
5
- // get tag from BAM or CRAM feature, where CRAM uses feature.get('tags') and
6
- // BAM does not
2
+ import { addDisposer, isAlive } from 'mobx-state-tree';
3
+ import { firstValueFrom } from 'rxjs';
4
+ import { toArray } from 'rxjs/operators';
7
5
  export function getTag(feature, tag) {
8
6
  return feature.get('tags')[tag];
9
7
  }
10
- // use fallback alt tag, used in situations where upper case/lower case tags
11
- // exist e.g. Mm/MM for base modifications
12
8
  export function getTagAlt(feature, tag, alt) {
13
9
  var _a;
14
10
  return (_a = getTag(feature, tag)) !== null && _a !== void 0 ? _a : getTag(feature, alt);
15
11
  }
16
- // orientation definitions from igv.js, see also
17
- // https://software.broadinstitute.org/software/igv/interpreting_pair_orientations
18
12
  export const orientationTypes = {
19
13
  fr: {
20
14
  F1R2: 'LR',
@@ -72,8 +66,6 @@ export function getColorWGBS(strand, base) {
72
66
  }
73
67
  return '#888';
74
68
  }
75
- // fetches region sequence augmenting by +/- 1bp for CpG on either side of
76
- // requested region
77
69
  export async function fetchSequence(region, adapter) {
78
70
  var _a;
79
71
  const { start, end, originalRefName, refName } = region;
@@ -87,12 +79,9 @@ export async function fetchSequence(region, adapter) {
87
79
  .pipe(toArray()));
88
80
  return (_a = feats[0]) === null || _a === void 0 ? void 0 : _a.get('seq');
89
81
  }
90
- // has to check underlying C-G (aka CpG) on the reference sequence
91
82
  export function shouldFetchReferenceSequence(type) {
92
83
  return type === 'methylation';
93
84
  }
94
- // adapted from IGV
95
- // https://github.com/igvteam/igv/blob/e803e3af2d8c9ea049961dfd4628146bdde9a574/src/main/java/org/broad/igv/sam/mods/BaseModificationColors.java#L27
96
85
  export const modificationColors = {
97
86
  m: 'rgb(255,0,0)',
98
87
  h: 'rgb(11, 132, 165)',
package/esm/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PluginManager from '@jbrowse/core/PluginManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class ArcPlugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
package/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
+ import { set1 } from '@jbrowse/core/ui/colors';
3
+ import ArcRendererF from './ArcRenderer';
2
4
  import LinearArcDisplayF from './LinearArcDisplay';
3
5
  import LinearPairedArcDisplayF from './LinearPairedArcDisplay';
4
- import ArcRendererF from './ArcRenderer';
5
- import { set1 } from '@jbrowse/core/ui/colors';
6
6
  export default class ArcPlugin extends Plugin {
7
7
  constructor() {
8
8
  super(...arguments);
@@ -30,7 +30,7 @@ export default class ArcPlugin extends Plugin {
30
30
  return set1[4];
31
31
  }
32
32
  else {
33
- return set1[6]; // skip 5, yellow
33
+ return set1[6];
34
34
  }
35
35
  });
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-arc",
3
- "version": "2.17.0",
3
+ "version": "3.0.0",
4
4
  "description": "JBrowse 2 arc adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "eed30b5e671f8f7823652d7cecc51aa89226de46"
56
+ "gitHead": "2c6897f1fa732b1db5b094d1dca197e333e95319"
57
57
  }