@jbrowse/core 2.7.2 → 2.9.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.
@@ -57,8 +57,8 @@ function DataGridDetails({ value, prefix, name, }) {
57
57
  const rows = Object.entries(value).map(([k, val]) => {
58
58
  const { id, ...rest } = val;
59
59
  return {
60
- id: k,
61
- identifier: id,
60
+ id: k, // used by material UI
61
+ identifier: id, // renamed from id to identifier
62
62
  ...rest,
63
63
  };
64
64
  });
@@ -112,7 +112,8 @@ function CoreDetails(props) {
112
112
  .map(([name, value]) => (react_1.default.createElement(SimpleField_1.default, { key: name, name: name, value: value })))));
113
113
  }
114
114
  const BaseCoreDetails = (props) => {
115
- return (react_1.default.createElement(BaseCard, { ...props, title: "Primary data" },
115
+ const { title = 'Primary data' } = props;
116
+ return (react_1.default.createElement(BaseCard, { ...props, title: title },
116
117
  react_1.default.createElement(CoreDetails, { ...props })));
117
118
  };
118
119
  exports.BaseCoreDetails = BaseCoreDetails;
@@ -124,6 +125,7 @@ const BaseAttributes = (props) => {
124
125
  exports.BaseAttributes = BaseAttributes;
125
126
  function FeatureDetails(props) {
126
127
  const { omit = [], model, feature, depth = 0 } = props;
128
+ const { maxDepth } = model;
127
129
  const { mate, name = '', id = '', type = '', subfeatures, uniqueId } = feature;
128
130
  const pm = (0, util_1.getEnv)(model).pluginManager;
129
131
  const session = (0, util_1.getSession)(model);
@@ -148,7 +150,7 @@ function FeatureDetails(props) {
148
150
  react_1.default.createElement(material_1.Divider, null),
149
151
  react_1.default.createElement(BaseCard, { title: ExtraPanel.name },
150
152
  react_1.default.createElement(ExtraPanel.Component, { ...props })))) : null,
151
- (subfeatures === null || subfeatures === void 0 ? void 0 : subfeatures.length) ? (react_1.default.createElement(BaseCard, { title: "Subfeatures", defaultExpanded: depth < 1 }, subfeatures.map((sub, idx) => (react_1.default.createElement(FeatureDetails, { key: JSON.stringify(sub), feature: { ...sub, uniqueId: `${uniqueId}_${idx}` }, model: model, depth: depth + 1 }))))) : null));
153
+ depth < maxDepth && (subfeatures === null || subfeatures === void 0 ? void 0 : subfeatures.length) ? (react_1.default.createElement(BaseCard, { title: "Subfeatures", defaultExpanded: depth < 1 }, subfeatures.map((sub, idx) => (react_1.default.createElement(FeatureDetails, { key: JSON.stringify(sub), feature: { ...sub, uniqueId: `${uniqueId}_${idx}` }, model: model, depth: depth + 1 }))))) : null));
152
154
  }
153
155
  exports.FeatureDetails = FeatureDetails;
154
156
  const BaseFeatureDetail = (0, mobx_react_1.observer)(function ({ model }) {
@@ -1,35 +1,119 @@
1
1
  import PluginManager from '../PluginManager';
2
2
  declare const configSchema: import("../configuration/configurationSchema").ConfigurationSchemaType<{}, import("../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
3
+ /**
4
+ * #stateModel BaseFeatureWidget
5
+ * displays data about features, allowing configuration callbacks to modify the
6
+ * contents of what is displayed
7
+ *
8
+ * see: formatDetails-\>feature,formatDetails-\>subfeatures
9
+ */
3
10
  export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
11
+ /**
12
+ * #property
13
+ */
4
14
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
15
+ /**
16
+ * #property
17
+ */
5
18
  type: import("mobx-state-tree").ISimpleType<"BaseFeatureWidget">;
19
+ /**
20
+ * #property
21
+ */
6
22
  featureData: import("mobx-state-tree").IType<any, any, any>;
23
+ /**
24
+ * #property
25
+ */
7
26
  formattedFields: import("mobx-state-tree").IType<any, any, any>;
27
+ /**
28
+ * #property
29
+ */
8
30
  unformattedFeatureData: import("mobx-state-tree").IType<any, any, any>;
31
+ /**
32
+ * #property
33
+ */
9
34
  view: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
35
+ /**
36
+ * #property
37
+ */
10
38
  track: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
39
+ /**
40
+ * #property
41
+ */
11
42
  trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
43
+ /**
44
+ * #property
45
+ */
12
46
  trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
47
+ /**
48
+ * #property
49
+ */
50
+ maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
13
51
  }, {
14
52
  error: unknown;
15
53
  } & {
54
+ /**
55
+ * #action
56
+ */
16
57
  setFeatureData(featureData: Record<string, unknown>): void;
58
+ /**
59
+ * #action
60
+ */
17
61
  clearFeatureData(): void;
62
+ /**
63
+ * #action
64
+ */
18
65
  setFormattedData(feat: Record<string, unknown>): void;
19
- setExtra(type?: string, trackId?: string): void;
66
+ /**
67
+ * #action
68
+ */
69
+ setExtra(type?: string, trackId?: string, maxDepth?: number): void;
70
+ /**
71
+ * #action
72
+ */
20
73
  setError(e: unknown): void;
21
74
  } & {
22
75
  afterCreate(): void;
23
76
  }, import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
77
+ /**
78
+ * #property
79
+ */
24
80
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
81
+ /**
82
+ * #property
83
+ */
25
84
  type: import("mobx-state-tree").ISimpleType<"BaseFeatureWidget">;
85
+ /**
86
+ * #property
87
+ */
26
88
  featureData: import("mobx-state-tree").IType<any, any, any>;
89
+ /**
90
+ * #property
91
+ */
27
92
  formattedFields: import("mobx-state-tree").IType<any, any, any>;
93
+ /**
94
+ * #property
95
+ */
28
96
  unformattedFeatureData: import("mobx-state-tree").IType<any, any, any>;
97
+ /**
98
+ * #property
99
+ */
29
100
  view: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
101
+ /**
102
+ * #property
103
+ */
30
104
  track: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
105
+ /**
106
+ * #property
107
+ */
31
108
  trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
109
+ /**
110
+ * #property
111
+ */
32
112
  trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
113
+ /**
114
+ * #property
115
+ */
116
+ maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
33
117
  }>>, {
34
118
  type: "BaseFeatureWidget";
35
119
  id: string;
@@ -37,6 +121,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
37
121
  view: import("mobx-state-tree").ReferenceIdentifier | undefined;
38
122
  trackId: string | undefined;
39
123
  trackType: string | undefined;
124
+ maxDepth: number | undefined;
40
125
  formattedFields: any;
41
126
  finalizedFeatureData: any;
42
127
  }>;
@@ -15,44 +15,97 @@ exports.configSchema = configSchema;
15
15
  function formatSubfeatures(obj, depth, parse, currentDepth = 0, returnObj = {}) {
16
16
  var _a;
17
17
  if (depth <= currentDepth) {
18
- return returnObj;
18
+ return;
19
19
  }
20
- returnObj.subfeatures = (_a = obj.subfeatures) === null || _a === void 0 ? void 0 : _a.map(sub => {
20
+ (_a = obj.subfeatures) === null || _a === void 0 ? void 0 : _a.map(sub => {
21
21
  formatSubfeatures(sub, depth, parse, currentDepth + 1, returnObj);
22
- return parse(sub);
22
+ parse(sub);
23
23
  });
24
- return returnObj;
25
24
  }
25
+ /**
26
+ * #stateModel BaseFeatureWidget
27
+ * displays data about features, allowing configuration callbacks to modify the
28
+ * contents of what is displayed
29
+ *
30
+ * see: formatDetails-\>feature,formatDetails-\>subfeatures
31
+ */
26
32
  function stateModelFactory(pluginManager) {
27
33
  return mobx_state_tree_1.types
28
34
  .model('BaseFeatureWidget', {
35
+ /**
36
+ * #property
37
+ */
29
38
  id: mst_1.ElementId,
39
+ /**
40
+ * #property
41
+ */
30
42
  type: mobx_state_tree_1.types.literal('BaseFeatureWidget'),
43
+ /**
44
+ * #property
45
+ */
31
46
  featureData: mobx_state_tree_1.types.frozen(),
47
+ /**
48
+ * #property
49
+ */
32
50
  formattedFields: mobx_state_tree_1.types.frozen(),
51
+ /**
52
+ * #property
53
+ */
33
54
  unformattedFeatureData: mobx_state_tree_1.types.frozen(),
55
+ /**
56
+ * #property
57
+ */
34
58
  view: mobx_state_tree_1.types.safeReference(pluginManager.pluggableMstType('view', 'stateModel')),
59
+ /**
60
+ * #property
61
+ */
35
62
  track: mobx_state_tree_1.types.safeReference(pluginManager.pluggableMstType('track', 'stateModel')),
63
+ /**
64
+ * #property
65
+ */
36
66
  trackId: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
67
+ /**
68
+ * #property
69
+ */
37
70
  trackType: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
71
+ /**
72
+ * #property
73
+ */
74
+ maxDepth: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.number),
38
75
  })
39
76
  .volatile(() => ({
40
77
  error: undefined,
41
78
  }))
42
79
  .actions(self => ({
80
+ /**
81
+ * #action
82
+ */
43
83
  setFeatureData(featureData) {
44
84
  self.unformattedFeatureData = featureData;
45
85
  },
86
+ /**
87
+ * #action
88
+ */
46
89
  clearFeatureData() {
47
90
  self.featureData = undefined;
48
91
  },
92
+ /**
93
+ * #action
94
+ */
49
95
  setFormattedData(feat) {
50
96
  self.featureData = feat;
51
97
  },
52
- setExtra(type, trackId) {
98
+ /**
99
+ * #action
100
+ */
101
+ setExtra(type, trackId, maxDepth) {
53
102
  self.trackId = trackId;
54
103
  self.trackType = type;
104
+ self.maxDepth = maxDepth;
55
105
  },
106
+ /**
107
+ * #action
108
+ */
56
109
  setError(e) {
57
110
  self.error = e;
58
111
  },
@@ -60,11 +113,12 @@ function stateModelFactory(pluginManager) {
60
113
  .actions(self => ({
61
114
  afterCreate() {
62
115
  (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
63
- var _a, _b;
64
116
  try {
65
- self.setExtra((_a = self.track) === null || _a === void 0 ? void 0 : _a.type, (_b = self.track) === null || _b === void 0 ? void 0 : _b.configuration.trackId);
66
117
  const { unformattedFeatureData, track } = self;
67
118
  const session = (0, util_1.getSession)(self);
119
+ if (track) {
120
+ self.setExtra(track.type, track.configuration.trackId, (0, configuration_1.getConf)(track, ['formatDetails', 'maxDepth']));
121
+ }
68
122
  if (unformattedFeatureData) {
69
123
  const feature = (0, clone_1.default)(unformattedFeatureData);
70
124
  const combine = (arg2, feature) => ({
@@ -74,8 +128,7 @@ function stateModelFactory(pluginManager) {
74
128
  if (track) {
75
129
  // eslint-disable-next-line no-underscore-dangle
76
130
  feature.__jbrowsefmt = combine('feature', feature);
77
- const depth = (0, configuration_1.getConf)(track, ['formatDetails', 'depth']);
78
- formatSubfeatures(feature, depth, sub => {
131
+ formatSubfeatures(feature, (0, configuration_1.getConf)(track, ['formatDetails', 'depth']), sub => {
79
132
  // eslint-disable-next-line no-underscore-dangle
80
133
  sub.__jbrowsefmt = combine('subfeatures', sub);
81
134
  });
@@ -22,25 +22,25 @@ const refNameColors = [
22
22
  'rgb(204, 0, 0)',
23
23
  'rgb(255, 0, 0)',
24
24
  'rgb(255, 0, 204)',
25
- 'rgb(165, 132, 132)',
26
- 'rgb(204, 122, 0)',
27
- 'rgb(178, 142, 0)',
28
- 'rgb(153, 153, 0)',
29
- 'rgb(122, 153, 0)',
30
- 'rgb(0, 165, 0)',
25
+ 'rgb(165, 132, 132)', // originally 'rgb(255, 204, 204)'
26
+ 'rgb(204, 122, 0)', // originally rgb(255, 153, 0)'
27
+ 'rgb(178, 142, 0)', // originally 'rgb(255, 204, 0)'
28
+ 'rgb(153, 153, 0)', // originally 'rgb(255, 255, 0)'
29
+ 'rgb(122, 153, 0)', // originally 'rgb(204, 255, 0)'
30
+ 'rgb(0, 165, 0)', // originally 'rgb(0, 255, 0)'
31
31
  'rgb(53, 128, 0)',
32
32
  'rgb(0, 0, 204)',
33
- 'rgb(96, 145, 242)',
34
- 'rgb(107, 142, 178)',
35
- 'rgb(0, 165, 165)',
36
- 'rgb(122, 153, 153)',
33
+ 'rgb(96, 145, 242)', // originally 'rgb(102, 153, 255)'
34
+ 'rgb(107, 142, 178)', // originally 'rgb(153, 204, 255)'
35
+ 'rgb(0, 165, 165)', // originally 'rgb(0, 255, 255)'
36
+ 'rgb(122, 153, 153)', // originally 'rgb(204, 255, 255)'
37
37
  'rgb(153, 0, 204)',
38
38
  'rgb(204, 51, 255)',
39
- 'rgb(173, 130, 216)',
39
+ 'rgb(173, 130, 216)', // originally 'rgb(204, 153, 255)'
40
40
  'rgb(102, 102, 102)',
41
- 'rgb(145, 145, 145)',
42
- 'rgb(142, 142, 142)',
43
- 'rgb(142, 142, 107)',
41
+ 'rgb(145, 145, 145)', // originally 'rgb(153, 153, 153)'
42
+ 'rgb(142, 142, 142)', // originally 'rgb(204, 204, 204)'
43
+ 'rgb(142, 142, 107)', // originally 'rgb(204, 204, 153)'
44
44
  'rgb(96, 163, 48)', // originally 'rgb(121, 204, 61)'
45
45
  ];
46
46
  async function loadRefNameMap(assembly, adapterConfig, options, signal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/core",
3
- "version": "2.7.2",
3
+ "version": "2.9.0",
4
4
  "description": "JBrowse 2 core libraries used by plugins",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "directory": "dist"
75
75
  },
76
- "gitHead": "9052b295f2d322e729254457ed9fe2231fb22cce"
76
+ "gitHead": "a50b6f67cf8c8f3c65a7b8cd858de2fcca1f2909"
77
77
  }
@@ -101,6 +101,14 @@ export declare function createBaseTrackConfig(pluginManager: PluginManager): imp
101
101
  defaultValue: number;
102
102
  description: string;
103
103
  };
104
+ /**
105
+ * #slot formatDetails.maxDepth
106
+ */
107
+ maxDepth: {
108
+ type: string;
109
+ defaultValue: number;
110
+ description: string;
111
+ };
104
112
  }, import("../../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
105
113
  formatAbout: import("../../configuration/configurationSchema").ConfigurationSchemaType<{
106
114
  /**
@@ -105,6 +105,14 @@ function createBaseTrackConfig(pluginManager) {
105
105
  defaultValue: 2,
106
106
  description: 'depth of subfeatures to iterate the formatter on formatDetails.subfeatures (e.g. you may not want to format the exon/cds subfeatures, so limited to 2',
107
107
  },
108
+ /**
109
+ * #slot formatDetails.maxDepth
110
+ */
111
+ maxDepth: {
112
+ type: 'number',
113
+ defaultValue: 99999,
114
+ description: 'Maximum depth to render subfeatures',
115
+ },
108
116
  }),
109
117
  formatAbout: (0, configuration_1.ConfigurationSchema)('FormatAbout', {
110
118
  /**
@@ -138,7 +138,7 @@ class BaseRpcDriver {
138
138
  // now actually call the worker
139
139
  const callP = worker
140
140
  .call(functionName, filteredAndSerializedArgs, {
141
- timeout: 5 * 60 * 1000,
141
+ timeout: 5 * 60 * 1000, // 5 minutes
142
142
  statusCallback: args.statusCallback,
143
143
  rpcDriverClassName: this.name,
144
144
  ...options,
@@ -1,3 +1,4 @@
1
+ /// <reference path="../../rpc/declaration.d.ts" />
1
2
  import Rpc from 'librpc-web-mod';
2
3
  import BaseRpcDriver, { RpcDriverConstructorArgs } from './BaseRpcDriver';
3
4
  import { PluginDefinition } from '../PluginLoader';