@jbrowse/plugin-data-management 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.
- package/dist/AddTrackWidget/model.d.ts +81 -0
- package/dist/AddTrackWidget/model.js +81 -0
- package/dist/HierarchicalTrackSelectorWidget/components/ShoppingCart.d.ts +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/ShoppingCart.js +11 -53
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.d.ts +5 -7
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.js +12 -11
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.d.ts +5 -7
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.js +11 -8
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.d.ts +1 -11
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.js +9 -7
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +40 -135
- package/dist/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.d.ts +12 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.js +57 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.d.ts +6 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.js +42 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js +71 -46
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js +5 -34
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalTree.js +8 -3
- package/dist/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.d.ts +6 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.js +42 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackCategory.js +7 -6
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.js +9 -28
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.d.ts +12 -0
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.js +50 -0
- package/dist/HierarchicalTrackSelectorWidget/components/util.d.ts +3 -0
- package/dist/HierarchicalTrackSelectorWidget/components/util.js +5 -1
- package/dist/HierarchicalTrackSelectorWidget/facetedModel.d.ts +128 -0
- package/dist/HierarchicalTrackSelectorWidget/facetedModel.js +206 -0
- package/dist/HierarchicalTrackSelectorWidget/facetedUtil.d.ts +2 -0
- package/dist/HierarchicalTrackSelectorWidget/{components/faceted/util.js → facetedUtil.js} +5 -1
- package/dist/HierarchicalTrackSelectorWidget/generateHierarchy.d.ts +17 -5
- package/dist/HierarchicalTrackSelectorWidget/generateHierarchy.js +27 -21
- package/dist/HierarchicalTrackSelectorWidget/model.d.ts +196 -17
- package/dist/HierarchicalTrackSelectorWidget/model.js +178 -23
- package/dist/ucsc-trackhub/doConnect.d.ts +1 -0
- package/dist/ucsc-trackhub/doConnect.js +131 -0
- package/dist/ucsc-trackhub/model.d.ts +19 -2
- package/dist/ucsc-trackhub/model.js +16 -71
- package/dist/ucsc-trackhub/ucscTrackHub.d.ts +161 -4
- package/dist/ucsc-trackhub/ucscTrackHub.js +49 -166
- package/esm/AddTrackWidget/model.d.ts +81 -0
- package/esm/AddTrackWidget/model.js +81 -0
- package/esm/HierarchicalTrackSelectorWidget/components/ShoppingCart.d.ts +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/ShoppingCart.js +12 -31
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.d.ts +5 -7
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilter.js +13 -11
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.d.ts +5 -7
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.js +12 -8
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.d.ts +1 -11
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.js +9 -7
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +41 -113
- package/esm/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.d.ts +12 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/DropdownTrackSelector.js +29 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.d.ts +6 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/FavoriteTracks.js +37 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js +71 -46
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js +6 -12
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalTree.js +8 -3
- package/esm/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.d.ts +6 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/RecentlyUsedTracks.js +37 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackCategory.js +7 -6
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.js +8 -27
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.d.ts +12 -0
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabelMenu.js +45 -0
- package/esm/HierarchicalTrackSelectorWidget/components/util.d.ts +3 -0
- package/esm/HierarchicalTrackSelectorWidget/components/util.js +5 -1
- package/esm/HierarchicalTrackSelectorWidget/facetedModel.d.ts +128 -0
- package/esm/HierarchicalTrackSelectorWidget/facetedModel.js +202 -0
- package/esm/HierarchicalTrackSelectorWidget/facetedUtil.d.ts +2 -0
- package/esm/HierarchicalTrackSelectorWidget/{components/faceted/util.js → facetedUtil.js} +3 -0
- package/esm/HierarchicalTrackSelectorWidget/generateHierarchy.d.ts +17 -5
- package/esm/HierarchicalTrackSelectorWidget/generateHierarchy.js +27 -21
- package/esm/HierarchicalTrackSelectorWidget/model.d.ts +196 -17
- package/esm/HierarchicalTrackSelectorWidget/model.js +180 -25
- package/esm/ucsc-trackhub/doConnect.d.ts +1 -0
- package/esm/ucsc-trackhub/doConnect.js +127 -0
- package/esm/ucsc-trackhub/model.d.ts +19 -2
- package/esm/ucsc-trackhub/model.js +17 -72
- package/esm/ucsc-trackhub/ucscTrackHub.d.ts +161 -4
- package/esm/ucsc-trackhub/ucscTrackHub.js +48 -141
- package/package.json +3 -3
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/util.d.ts +0 -1
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/util.d.ts +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { addDisposer, getParent, types } from 'mobx-state-tree';
|
|
2
|
+
import { matches } from './util';
|
|
3
|
+
import { readConfObject, } from '@jbrowse/core/configuration';
|
|
4
|
+
import { getTrackName } from '@jbrowse/core/util/tracks';
|
|
5
|
+
import { getSession, localStorageGetItem, measureGridWidth, } from '@jbrowse/core/util';
|
|
6
|
+
import { autorun, observable } from 'mobx';
|
|
7
|
+
import { getRootKeys, findNonSparseKeys } from './facetedUtil';
|
|
8
|
+
const nonMetadataKeys = ['category', 'adapter', 'description'];
|
|
9
|
+
/**
|
|
10
|
+
* #stateModel FacetedModel
|
|
11
|
+
*/
|
|
12
|
+
export function facetedStateTreeF() {
|
|
13
|
+
return types
|
|
14
|
+
.model('FacetedModel', {
|
|
15
|
+
/**
|
|
16
|
+
* #property
|
|
17
|
+
*/
|
|
18
|
+
filterText: types.optional(types.string, ''),
|
|
19
|
+
/**
|
|
20
|
+
* #property
|
|
21
|
+
*/
|
|
22
|
+
showSparse: types.optional(types.boolean, () => JSON.parse(localStorageGetItem('facet-showSparse') || 'false')),
|
|
23
|
+
/**
|
|
24
|
+
* #property
|
|
25
|
+
*/
|
|
26
|
+
showFilters: types.optional(types.boolean, () => JSON.parse(localStorageGetItem('facet-showFilters') || 'true')),
|
|
27
|
+
/**
|
|
28
|
+
* #property
|
|
29
|
+
*/
|
|
30
|
+
showOptions: types.optional(types.boolean, () => JSON.parse(localStorageGetItem('facet-showTableOptions') || 'false')),
|
|
31
|
+
/**
|
|
32
|
+
* #property
|
|
33
|
+
*/
|
|
34
|
+
panelWidth: types.optional(types.number, () => JSON.parse(localStorageGetItem('facet-panelWidth') || '400')),
|
|
35
|
+
})
|
|
36
|
+
.volatile(() => ({
|
|
37
|
+
visible: {},
|
|
38
|
+
widths: {},
|
|
39
|
+
useShoppingCart: false,
|
|
40
|
+
filters: observable.map(),
|
|
41
|
+
}))
|
|
42
|
+
.actions(self => ({
|
|
43
|
+
/**
|
|
44
|
+
* #action
|
|
45
|
+
*/
|
|
46
|
+
setFilter(key, value) {
|
|
47
|
+
self.filters.set(key, value);
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* #action
|
|
51
|
+
*/
|
|
52
|
+
setPanelWidth(width) {
|
|
53
|
+
self.panelWidth = width;
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* #action
|
|
57
|
+
*/
|
|
58
|
+
setUseShoppingCart(f) {
|
|
59
|
+
self.useShoppingCart = f;
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* #action
|
|
63
|
+
*/
|
|
64
|
+
setFilterText(str) {
|
|
65
|
+
self.filterText = str;
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* #action
|
|
69
|
+
*/
|
|
70
|
+
setShowSparse(f) {
|
|
71
|
+
self.showSparse = f;
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* #action
|
|
75
|
+
*/
|
|
76
|
+
setShowOptions(f) {
|
|
77
|
+
self.showOptions = f;
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* #action
|
|
81
|
+
*/
|
|
82
|
+
setShowFilters(f) {
|
|
83
|
+
self.showFilters = f;
|
|
84
|
+
},
|
|
85
|
+
}))
|
|
86
|
+
.views(self => ({
|
|
87
|
+
/**
|
|
88
|
+
* #getter
|
|
89
|
+
*/
|
|
90
|
+
get allTrackConfigurations() {
|
|
91
|
+
return getParent(self).allTrackConfigurations;
|
|
92
|
+
},
|
|
93
|
+
}))
|
|
94
|
+
.views(self => ({
|
|
95
|
+
/**
|
|
96
|
+
* #getter
|
|
97
|
+
*/
|
|
98
|
+
get rows() {
|
|
99
|
+
const session = getSession(self);
|
|
100
|
+
const { allTrackConfigurations, filterText } = self;
|
|
101
|
+
// metadata is spread onto the object for easier access and sorting
|
|
102
|
+
// by the mui data grid (it's unable to sort by nested objects)
|
|
103
|
+
return allTrackConfigurations
|
|
104
|
+
.filter(conf => matches(filterText, conf, session))
|
|
105
|
+
.map(track => {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
const metadata = readConfObject(track, 'metadata');
|
|
108
|
+
return {
|
|
109
|
+
id: track.trackId,
|
|
110
|
+
conf: track,
|
|
111
|
+
name: getTrackName(track, session),
|
|
112
|
+
category: (_a = readConfObject(track, 'category')) === null || _a === void 0 ? void 0 : _a.join(', '),
|
|
113
|
+
adapter: (_b = readConfObject(track, 'adapter')) === null || _b === void 0 ? void 0 : _b.type,
|
|
114
|
+
description: readConfObject(track, 'description'),
|
|
115
|
+
metadata,
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
}))
|
|
120
|
+
.views(self => ({
|
|
121
|
+
/**
|
|
122
|
+
* #getter
|
|
123
|
+
*/
|
|
124
|
+
get filteredNonMetadataKeys() {
|
|
125
|
+
return self.showSparse
|
|
126
|
+
? nonMetadataKeys
|
|
127
|
+
: findNonSparseKeys(nonMetadataKeys, self.rows, (r, f) => r[f]);
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* #getter
|
|
131
|
+
*/
|
|
132
|
+
get metadataKeys() {
|
|
133
|
+
return [...new Set(self.rows.flatMap(row => getRootKeys(row.metadata)))];
|
|
134
|
+
},
|
|
135
|
+
get filteredMetadataKeys() {
|
|
136
|
+
return self.showSparse
|
|
137
|
+
? this.metadataKeys
|
|
138
|
+
: findNonSparseKeys(this.metadataKeys, self.rows,
|
|
139
|
+
// @ts-expect-error
|
|
140
|
+
(r, f) => r.metadata[f]);
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* #getter
|
|
144
|
+
*/
|
|
145
|
+
get fields() {
|
|
146
|
+
return [
|
|
147
|
+
'name',
|
|
148
|
+
...this.filteredNonMetadataKeys,
|
|
149
|
+
...this.filteredMetadataKeys.map(m => `metadata.${m}`),
|
|
150
|
+
];
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* #getter
|
|
154
|
+
*/
|
|
155
|
+
get filteredRows() {
|
|
156
|
+
const arrFilters = [...self.filters.entries()]
|
|
157
|
+
.filter(f => f[1].length > 0)
|
|
158
|
+
.map(([key, val]) => [key, new Set(val)]);
|
|
159
|
+
return self.rows.filter(row =>
|
|
160
|
+
// @ts-expect-error
|
|
161
|
+
arrFilters.every(([key, val]) => val.has(row[key])));
|
|
162
|
+
},
|
|
163
|
+
}))
|
|
164
|
+
.actions(self => ({
|
|
165
|
+
/**
|
|
166
|
+
* #action
|
|
167
|
+
*/
|
|
168
|
+
setVisible(args) {
|
|
169
|
+
self.visible = args;
|
|
170
|
+
},
|
|
171
|
+
/**
|
|
172
|
+
* #action
|
|
173
|
+
*/
|
|
174
|
+
setWidths(args) {
|
|
175
|
+
self.widths = args;
|
|
176
|
+
},
|
|
177
|
+
afterAttach() {
|
|
178
|
+
addDisposer(self, autorun(() => {
|
|
179
|
+
this.setVisible(Object.fromEntries(self.fields.map(c => [c, true])));
|
|
180
|
+
}));
|
|
181
|
+
addDisposer(self, autorun(() => {
|
|
182
|
+
this.setWidths({
|
|
183
|
+
name: measureGridWidth(self.rows.map(r => r.name), { maxWidth: 500, stripHTML: true }) + 15,
|
|
184
|
+
...Object.fromEntries(self.filteredNonMetadataKeys
|
|
185
|
+
.filter(f => self.visible[f])
|
|
186
|
+
.map(e => [
|
|
187
|
+
e,
|
|
188
|
+
measureGridWidth(self.rows.map(r => r[e]), { maxWidth: 400, stripHTML: true }),
|
|
189
|
+
])),
|
|
190
|
+
...Object.fromEntries(self.filteredMetadataKeys
|
|
191
|
+
.filter(f => self.visible['metadata.' + f])
|
|
192
|
+
.map(e => {
|
|
193
|
+
return [
|
|
194
|
+
'metadata.' + e,
|
|
195
|
+
measureGridWidth(self.rows.map(r => r.metadata[e]), { maxWidth: 400, stripHTML: true }),
|
|
196
|
+
];
|
|
197
|
+
})),
|
|
198
|
+
});
|
|
199
|
+
}));
|
|
200
|
+
},
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
2
|
+
import { MenuItem } from '@jbrowse/core/ui';
|
|
3
|
+
export interface TreeTrackNode {
|
|
3
4
|
name: string;
|
|
4
5
|
id: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
trackId: string;
|
|
7
|
+
conf: AnyConfigurationModel;
|
|
8
|
+
checked: boolean;
|
|
8
9
|
children: TreeNode[];
|
|
10
|
+
type: 'track';
|
|
9
11
|
}
|
|
10
|
-
export
|
|
12
|
+
export interface TreeCategoryNode {
|
|
13
|
+
name: string;
|
|
14
|
+
id: string;
|
|
15
|
+
isOpenByDefault: boolean;
|
|
16
|
+
children: TreeNode[];
|
|
17
|
+
type: 'category';
|
|
18
|
+
}
|
|
19
|
+
export type TreeNode = TreeTrackNode | TreeCategoryNode;
|
|
20
|
+
export declare function generateHierarchy({ model, trackConfs, extra, noCategories, menuItems, }: {
|
|
11
21
|
model: {
|
|
12
22
|
filterText: string;
|
|
13
23
|
activeSortTrackNames: boolean;
|
|
@@ -19,6 +29,8 @@ export declare function generateHierarchy({ model, trackConfs, extra, }: {
|
|
|
19
29
|
}[];
|
|
20
30
|
};
|
|
21
31
|
};
|
|
32
|
+
noCategories?: boolean;
|
|
33
|
+
menuItems?: MenuItem[];
|
|
22
34
|
trackConfs: AnyConfigurationModel[];
|
|
23
35
|
extra?: string;
|
|
24
36
|
}): TreeNode[];
|
|
@@ -37,7 +37,7 @@ function sortConfs(confs, sortNames, sortCategories) {
|
|
|
37
37
|
}
|
|
38
38
|
return ret.map(a => a[0]);
|
|
39
39
|
}
|
|
40
|
-
export function generateHierarchy({ model, trackConfs, extra, }) {
|
|
40
|
+
export function generateHierarchy({ model, trackConfs, extra, noCategories, menuItems, }) {
|
|
41
41
|
const hierarchy = { children: [] };
|
|
42
42
|
const { collapsed, filterText, activeSortTrackNames, activeSortCategories, view, } = model;
|
|
43
43
|
if (!view) {
|
|
@@ -56,25 +56,29 @@ export function generateHierarchy({ model, trackConfs, extra, }) {
|
|
|
56
56
|
categories.unshift(' Session tracks');
|
|
57
57
|
}
|
|
58
58
|
let currLevel = hierarchy;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
if (!noCategories) {
|
|
60
|
+
// find existing category to put track into or create it
|
|
61
|
+
for (let i = 0; i < categories.length; i++) {
|
|
62
|
+
const category = categories[i];
|
|
63
|
+
const ret = currLevel.children.find(c => c.name === category);
|
|
64
|
+
const id = [extra, categories.slice(0, i + 1).join(',')]
|
|
65
|
+
.filter(f => !!f)
|
|
66
|
+
.join('-');
|
|
67
|
+
if (!ret) {
|
|
68
|
+
const n = {
|
|
69
|
+
children: [],
|
|
70
|
+
name: category,
|
|
71
|
+
id,
|
|
72
|
+
isOpenByDefault: !collapsed.get(id),
|
|
73
|
+
menuItems,
|
|
74
|
+
type: 'category',
|
|
75
|
+
};
|
|
76
|
+
currLevel.children.push(n);
|
|
77
|
+
currLevel = n;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
currLevel = ret;
|
|
81
|
+
}
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
// uses splice to try to put all leaf nodes above "category nodes" if you
|
|
@@ -83,11 +87,13 @@ export function generateHierarchy({ model, trackConfs, extra, }) {
|
|
|
83
87
|
const r = currLevel.children.findIndex(elt => elt.children.length);
|
|
84
88
|
const idx = r === -1 ? currLevel.children.length : r;
|
|
85
89
|
currLevel.children.splice(idx, 0, {
|
|
86
|
-
id: conf.trackId,
|
|
90
|
+
id: [extra, conf.trackId].filter(f => !!f).join(','),
|
|
91
|
+
trackId: conf.trackId,
|
|
87
92
|
name: getTrackName(conf, session),
|
|
88
93
|
conf,
|
|
89
94
|
checked: viewTracks.some(f => f.configuration === conf),
|
|
90
95
|
children: [],
|
|
96
|
+
type: 'track',
|
|
91
97
|
});
|
|
92
98
|
}
|
|
93
99
|
return hierarchy.children;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Instance } from 'mobx-state-tree';
|
|
2
2
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
3
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
4
|
-
|
|
4
|
+
type MaybeAnyConfigurationModel = AnyConfigurationModel | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* #stateModel HierarchicalTrackSelectorWidget
|
|
7
7
|
*/
|
|
@@ -34,6 +34,90 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
34
34
|
* #property
|
|
35
35
|
*/
|
|
36
36
|
view: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
37
|
+
/**
|
|
38
|
+
* #property
|
|
39
|
+
* this is removed in postProcessSnapshot, so is generally only loaded
|
|
40
|
+
* from localstorage
|
|
41
|
+
*/
|
|
42
|
+
favorites: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
43
|
+
/**
|
|
44
|
+
* #property
|
|
45
|
+
* this is removed in postProcessSnapshot, so is generally only loaded
|
|
46
|
+
* from localstorage
|
|
47
|
+
*/
|
|
48
|
+
recentlyUsed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
49
|
+
/**
|
|
50
|
+
* #property
|
|
51
|
+
*/
|
|
52
|
+
faceted: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{
|
|
53
|
+
filterText: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
54
|
+
showSparse: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
55
|
+
showFilters: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
56
|
+
showOptions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
57
|
+
panelWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
58
|
+
}, {
|
|
59
|
+
/**
|
|
60
|
+
* #property
|
|
61
|
+
*/
|
|
62
|
+
visible: Record<string, boolean>;
|
|
63
|
+
widths: Record<string, number | undefined>;
|
|
64
|
+
useShoppingCart: boolean;
|
|
65
|
+
filters: import("mobx").ObservableMap<string, string[]>;
|
|
66
|
+
} & {
|
|
67
|
+
setFilter(key: string, value: string[]): void;
|
|
68
|
+
setPanelWidth(width: number): void;
|
|
69
|
+
setUseShoppingCart(f: boolean): void;
|
|
70
|
+
setFilterText(str: string): void;
|
|
71
|
+
setShowSparse(f: boolean): void;
|
|
72
|
+
setShowOptions(f: boolean): void;
|
|
73
|
+
setShowFilters(f: boolean): void;
|
|
74
|
+
} & {
|
|
75
|
+
readonly allTrackConfigurations: ({
|
|
76
|
+
[x: string]: any;
|
|
77
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
78
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
79
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
80
|
+
} & {
|
|
81
|
+
readonly rows: {
|
|
82
|
+
readonly id: string;
|
|
83
|
+
readonly conf: {
|
|
84
|
+
[x: string]: any;
|
|
85
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
86
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
87
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>;
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly category: string; /**
|
|
90
|
+
* #action
|
|
91
|
+
*/
|
|
92
|
+
readonly adapter: string;
|
|
93
|
+
readonly description: string;
|
|
94
|
+
readonly metadata: any;
|
|
95
|
+
}[];
|
|
96
|
+
} & {
|
|
97
|
+
readonly filteredNonMetadataKeys: string[] | readonly ["category", "adapter", "description"];
|
|
98
|
+
readonly metadataKeys: string[];
|
|
99
|
+
readonly filteredMetadataKeys: string[];
|
|
100
|
+
readonly fields: string[];
|
|
101
|
+
readonly filteredRows: {
|
|
102
|
+
readonly id: string;
|
|
103
|
+
readonly conf: {
|
|
104
|
+
[x: string]: any;
|
|
105
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
106
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
107
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>;
|
|
108
|
+
readonly name: string;
|
|
109
|
+
readonly category: string; /**
|
|
110
|
+
* #action
|
|
111
|
+
*/
|
|
112
|
+
readonly adapter: string;
|
|
113
|
+
readonly description: string;
|
|
114
|
+
readonly metadata: any;
|
|
115
|
+
}[];
|
|
116
|
+
} & {
|
|
117
|
+
setVisible(args: Record<string, boolean>): void;
|
|
118
|
+
setWidths(args: Record<string, number | undefined>): void;
|
|
119
|
+
afterAttach(): void;
|
|
120
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
37
121
|
}, {
|
|
38
122
|
selection: ({
|
|
39
123
|
[x: string]: any;
|
|
@@ -41,6 +125,25 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
41
125
|
setSubschema(slotName: string, data: unknown): any;
|
|
42
126
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
43
127
|
filterText: string;
|
|
128
|
+
recentlyUsedCounter: number;
|
|
129
|
+
favoritesCounter: number;
|
|
130
|
+
} & {
|
|
131
|
+
/**
|
|
132
|
+
* #getter
|
|
133
|
+
*/
|
|
134
|
+
readonly selectionSet: Set<{
|
|
135
|
+
[x: string]: any;
|
|
136
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
137
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
138
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>>;
|
|
139
|
+
/**
|
|
140
|
+
* #getter
|
|
141
|
+
*/
|
|
142
|
+
readonly favoritesSet: Set<string>;
|
|
143
|
+
/**
|
|
144
|
+
* #getter
|
|
145
|
+
*/
|
|
146
|
+
readonly recentlyUsedSet: Set<string>;
|
|
44
147
|
} & {
|
|
45
148
|
/**
|
|
46
149
|
* #action
|
|
@@ -66,6 +169,34 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
66
169
|
* #action
|
|
67
170
|
*/
|
|
68
171
|
clearSelection(): void;
|
|
172
|
+
/**
|
|
173
|
+
* #action
|
|
174
|
+
*/
|
|
175
|
+
addToFavorites(trackId: string): void;
|
|
176
|
+
/**
|
|
177
|
+
* #action
|
|
178
|
+
*/
|
|
179
|
+
removeFromFavorites(trackId: string): void;
|
|
180
|
+
/**
|
|
181
|
+
* #action
|
|
182
|
+
*/
|
|
183
|
+
clearFavorites(): void;
|
|
184
|
+
/**
|
|
185
|
+
* #action
|
|
186
|
+
*/
|
|
187
|
+
setRecentlyUsedCounter(val: number): void;
|
|
188
|
+
/**
|
|
189
|
+
* #action
|
|
190
|
+
*/
|
|
191
|
+
setFavoritesCounter(val: number): void;
|
|
192
|
+
/**
|
|
193
|
+
* #action
|
|
194
|
+
*/
|
|
195
|
+
addToRecentlyUsed(id: string): void;
|
|
196
|
+
/**
|
|
197
|
+
* #action
|
|
198
|
+
*/
|
|
199
|
+
clearRecentlyUsed(): void;
|
|
69
200
|
/**
|
|
70
201
|
* #action
|
|
71
202
|
*/
|
|
@@ -94,7 +225,19 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
94
225
|
/**
|
|
95
226
|
* #method
|
|
96
227
|
*/
|
|
97
|
-
|
|
228
|
+
isSelected(track: AnyConfigurationModel): boolean;
|
|
229
|
+
/**
|
|
230
|
+
* #method
|
|
231
|
+
*/
|
|
232
|
+
isFavorite(trackId: string): boolean;
|
|
233
|
+
/**
|
|
234
|
+
* #method
|
|
235
|
+
*/
|
|
236
|
+
isRecentlyUsed(trackId: string): boolean;
|
|
237
|
+
/**
|
|
238
|
+
* #method
|
|
239
|
+
*/
|
|
240
|
+
getRefSeqTrackConf(assemblyName: string): MaybeAnyConfigurationModel;
|
|
98
241
|
} & {
|
|
99
242
|
/**
|
|
100
243
|
* #getter
|
|
@@ -110,34 +253,42 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
110
253
|
*/
|
|
111
254
|
readonly activeSortCategories: any;
|
|
112
255
|
/**
|
|
113
|
-
* #
|
|
114
|
-
* filter out tracks that don't match the current display types
|
|
256
|
+
* #getter
|
|
257
|
+
* filter out tracks that don't match the current assembly/display types
|
|
115
258
|
*/
|
|
116
|
-
|
|
117
|
-
tracks: AnyConfigurationModel[];
|
|
118
|
-
}): ({
|
|
259
|
+
readonly configAndSessionTrackConfigurations: ({
|
|
119
260
|
[x: string]: any;
|
|
120
261
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
121
262
|
setSubschema(slotName: string, data: unknown): any;
|
|
122
263
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
264
|
+
readonly allTrackConfigurations: ({
|
|
265
|
+
[x: string]: any;
|
|
266
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
267
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
268
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
269
|
+
} & {
|
|
123
270
|
/**
|
|
124
271
|
* #getter
|
|
125
|
-
*
|
|
272
|
+
* filters out tracks that are not in the favorites group
|
|
126
273
|
*/
|
|
127
|
-
readonly
|
|
274
|
+
readonly favoriteTracks: ({
|
|
128
275
|
[x: string]: any;
|
|
129
276
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
130
277
|
setSubschema(slotName: string, data: unknown): any;
|
|
131
278
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
132
|
-
} & {
|
|
133
279
|
/**
|
|
134
|
-
* #
|
|
280
|
+
* #getter
|
|
281
|
+
* filters out tracks that are not in the recently used group
|
|
135
282
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
283
|
+
readonly recentlyUsedTracks: ({
|
|
284
|
+
[x: string]: any;
|
|
285
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
286
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
287
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
140
288
|
} & {
|
|
289
|
+
/**
|
|
290
|
+
* #getter
|
|
291
|
+
*/
|
|
141
292
|
readonly allTracks: {
|
|
142
293
|
group: any;
|
|
143
294
|
tracks: ({
|
|
@@ -145,6 +296,8 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
145
296
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
146
297
|
setSubschema(slotName: string, data: unknown): any;
|
|
147
298
|
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[];
|
|
299
|
+
noCategories: boolean;
|
|
300
|
+
menuItems: never[];
|
|
148
301
|
}[];
|
|
149
302
|
} & {
|
|
150
303
|
/**
|
|
@@ -153,10 +306,15 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
153
306
|
readonly hierarchy: {
|
|
154
307
|
name: string;
|
|
155
308
|
id: string;
|
|
309
|
+
isOpenByDefault: boolean;
|
|
310
|
+
type: "category";
|
|
156
311
|
children: {
|
|
157
312
|
name: any;
|
|
158
313
|
id: any;
|
|
159
|
-
|
|
314
|
+
type: "category";
|
|
315
|
+
isOpenByDefault: boolean;
|
|
316
|
+
menuItems: never[];
|
|
317
|
+
children: import("./generateHierarchy").TreeNode[];
|
|
160
318
|
}[];
|
|
161
319
|
};
|
|
162
320
|
} & {
|
|
@@ -171,7 +329,28 @@ export default function stateTreeFactory(pluginManager: PluginManager): import("
|
|
|
171
329
|
} & {
|
|
172
330
|
afterCreate(): void;
|
|
173
331
|
} & {
|
|
332
|
+
/**
|
|
333
|
+
* #getter
|
|
334
|
+
*/
|
|
174
335
|
readonly hasAnySubcategories: boolean;
|
|
175
|
-
}
|
|
336
|
+
} & {
|
|
337
|
+
afterAttach(): void;
|
|
338
|
+
}, import("mobx-state-tree")._NotCustomized, {
|
|
339
|
+
type: "HierarchicalTrackSelectorWidget";
|
|
340
|
+
view: import("mobx-state-tree").ReferenceIdentifier | undefined;
|
|
341
|
+
id: string;
|
|
342
|
+
collapsed: import("mobx").IKeyValueMap<boolean>;
|
|
343
|
+
initialized: boolean | undefined;
|
|
344
|
+
sortTrackNames: boolean | undefined;
|
|
345
|
+
sortCategories: boolean | undefined;
|
|
346
|
+
faceted: import("mobx-state-tree").ModelSnapshotType<{
|
|
347
|
+
filterText: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
348
|
+
showSparse: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
349
|
+
showFilters: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
350
|
+
showOptions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
351
|
+
panelWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
352
|
+
}>;
|
|
353
|
+
}>;
|
|
176
354
|
export type HierarchicalTrackSelectorStateModel = ReturnType<typeof stateTreeFactory>;
|
|
177
355
|
export type HierarchicalTrackSelectorModel = Instance<HierarchicalTrackSelectorStateModel>;
|
|
356
|
+
export {};
|