@jbrowse/plugin-config 1.7.11 → 2.1.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/ConfigurationEditorWidget/components/CallbackEditor.d.ts +10 -7
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +117 -115
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +9 -33
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +68 -117
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +7 -3
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +117 -160
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +9 -7
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +92 -77
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +17 -5
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +240 -374
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +76 -105
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js.map +1 -0
- package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +8 -6
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js +16 -46
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js.map +1 -0
- package/dist/ConfigurationEditorWidget/index.d.ts +10 -3
- package/dist/ConfigurationEditorWidget/index.js +26 -42
- package/dist/ConfigurationEditorWidget/index.js.map +1 -0
- package/dist/ConfigurationEditorWidget/model.d.ts +3 -2
- package/dist/ConfigurationEditorWidget/model.js +19 -26
- package/dist/ConfigurationEditorWidget/model.js.map +1 -0
- package/dist/FromConfigAdapter/FromConfigAdapter.js +172 -204
- package/dist/FromConfigAdapter/FromConfigAdapter.js.map +1 -0
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.js +151 -142
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.js.map +1 -0
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.d.ts +2 -1
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js +174 -181
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js.map +1 -0
- package/dist/FromConfigAdapter/configSchema.js +33 -49
- package/dist/FromConfigAdapter/configSchema.js.map +1 -0
- package/dist/FromConfigAdapter/index.js +16 -50
- package/dist/FromConfigAdapter/index.js.map +1 -0
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +111 -125
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js.map +1 -0
- package/dist/RefNameAliasAdapter/configSchema.js +16 -25
- package/dist/RefNameAliasAdapter/configSchema.js.map +1 -0
- package/dist/RefNameAliasAdapter/index.js +10 -22
- package/dist/RefNameAliasAdapter/index.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.js +129 -144
- package/dist/index.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.d.ts +12 -0
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +80 -0
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/ColorEditor.d.ts +20 -0
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js +22 -0
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +8 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +87 -0
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +11 -0
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js +55 -0
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +18 -0
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +182 -0
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +12 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +36 -0
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js.map +1 -0
- package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +9 -0
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js +12 -0
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js.map +1 -0
- package/esm/ConfigurationEditorWidget/index.d.ts +10 -0
- package/esm/ConfigurationEditorWidget/index.js +21 -0
- package/esm/ConfigurationEditorWidget/index.js.map +1 -0
- package/esm/ConfigurationEditorWidget/model.d.ts +9 -0
- package/esm/ConfigurationEditorWidget/model.js +17 -0
- package/esm/ConfigurationEditorWidget/model.js.map +1 -0
- package/esm/FromConfigAdapter/FromConfigAdapter.d.ts +24 -0
- package/esm/FromConfigAdapter/FromConfigAdapter.js +63 -0
- package/esm/FromConfigAdapter/FromConfigAdapter.js.map +1 -0
- package/esm/FromConfigAdapter/FromConfigRegionsAdapter.d.ts +23 -0
- package/esm/FromConfigAdapter/FromConfigRegionsAdapter.js +50 -0
- package/esm/FromConfigAdapter/FromConfigRegionsAdapter.js.map +1 -0
- package/esm/FromConfigAdapter/FromConfigSequenceAdapter.d.ts +26 -0
- package/esm/FromConfigAdapter/FromConfigSequenceAdapter.js +65 -0
- package/esm/FromConfigAdapter/FromConfigSequenceAdapter.js.map +1 -0
- package/esm/FromConfigAdapter/configSchema.d.ts +3 -0
- package/esm/FromConfigAdapter/configSchema.js +32 -0
- package/esm/FromConfigAdapter/configSchema.js.map +1 -0
- package/esm/FromConfigAdapter/index.d.ts +4 -0
- package/esm/FromConfigAdapter/index.js +5 -0
- package/esm/FromConfigAdapter/index.js.map +1 -0
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +8 -0
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +24 -0
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js.map +1 -0
- package/esm/RefNameAliasAdapter/configSchema.d.ts +2 -0
- package/esm/RefNameAliasAdapter/configSchema.js +15 -0
- package/esm/RefNameAliasAdapter/configSchema.js.map +1 -0
- package/esm/RefNameAliasAdapter/index.d.ts +2 -0
- package/esm/RefNameAliasAdapter/index.js +3 -0
- package/esm/RefNameAliasAdapter/index.js.map +1 -0
- package/esm/index.d.ts +18 -0
- package/esm/index.js +72 -0
- package/esm/index.js.map +1 -0
- package/package.json +21 -15
- package/src/ConfigurationEditorWidget/components/CallbackEditor.tsx +126 -0
- package/src/ConfigurationEditorWidget/components/ColorEditor.tsx +13 -60
- package/src/ConfigurationEditorWidget/components/{ConfigurationEditor.test.js → ConfigurationEditor.test.tsx} +0 -0
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx +173 -0
- package/src/ConfigurationEditorWidget/components/JsonEditor.tsx +84 -0
- package/src/ConfigurationEditorWidget/components/SlotEditor.tsx +484 -0
- package/src/ConfigurationEditorWidget/components/StringArrayEditor.tsx +2 -2
- package/src/ConfigurationEditorWidget/components/{TypeSelector.js → TypeSelector.tsx} +15 -7
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap +2024 -0
- package/src/ConfigurationEditorWidget/index.tsx +25 -0
- package/src/ConfigurationEditorWidget/{model.js → model.ts} +4 -2
- package/src/FromConfigAdapter/FromConfigSequenceAdapter.ts +6 -10
- package/src/index.ts +20 -14
- package/dist/ConfigurationEditorWidget/components/CodeEditor.d.ts +0 -4
- package/dist/ConfigurationEditorWidget/components/CodeEditor.js +0 -80
- package/dist/ConfigurationEditorWidget/components/ColorEditor.test.js +0 -31
- package/dist/ConfigurationEditorWidget/components/ColorPicker.d.ts +0 -14
- package/dist/ConfigurationEditorWidget/components/ColorPicker.js +0 -72
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.test.js +0 -121
- package/dist/FromConfigAdapter/FromConfigAdapter.test.js +0 -100
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.test.js +0 -200
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.test.js +0 -110
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.test.js +0 -41
- package/dist/index.test.js +0 -41
- package/src/ConfigurationEditorWidget/components/CallbackEditor.js +0 -112
- package/src/ConfigurationEditorWidget/components/CodeEditor.js +0 -60
- package/src/ConfigurationEditorWidget/components/ColorPicker.tsx +0 -52
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.js +0 -154
- package/src/ConfigurationEditorWidget/components/JsonEditor.js +0 -56
- package/src/ConfigurationEditorWidget/components/SlotEditor.js +0 -377
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.js.snap +0 -1753
- package/src/ConfigurationEditorWidget/index.js +0 -20
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
-
|
|
9
|
-
var _FromConfigRegionsAdapter = _interopRequireDefault(require("./FromConfigRegionsAdapter"));
|
|
10
|
-
|
|
11
|
-
var _configSchema = require("./configSchema");
|
|
12
|
-
|
|
13
|
-
test('adapter can fetch regions 1', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
14
|
-
var features, adapter, result;
|
|
15
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
switch (_context.prev = _context.next) {
|
|
18
|
-
case 0:
|
|
19
|
-
features = [{
|
|
20
|
-
uniqueId: 'one',
|
|
21
|
-
refName: 'ctgA',
|
|
22
|
-
start: 250,
|
|
23
|
-
end: 400
|
|
24
|
-
}, {
|
|
25
|
-
uniqueId: 'two',
|
|
26
|
-
refName: 'ctgA',
|
|
27
|
-
start: 150,
|
|
28
|
-
end: 300
|
|
29
|
-
}, {
|
|
30
|
-
uniqueId: 'three',
|
|
31
|
-
refName: 'ctgB',
|
|
32
|
-
start: 50,
|
|
33
|
-
end: 60
|
|
34
|
-
}];
|
|
35
|
-
adapter = new _FromConfigRegionsAdapter.default(_configSchema.regionsConfigSchema.create({
|
|
36
|
-
features: features
|
|
37
|
-
}));
|
|
38
|
-
_context.next = 4;
|
|
39
|
-
return adapter.getRegions();
|
|
40
|
-
|
|
41
|
-
case 4:
|
|
42
|
-
result = _context.sent;
|
|
43
|
-
expect(result).toEqual([{
|
|
44
|
-
refName: 'ctgA',
|
|
45
|
-
start: 150,
|
|
46
|
-
end: 400
|
|
47
|
-
}, {
|
|
48
|
-
refName: 'ctgB',
|
|
49
|
-
start: 50,
|
|
50
|
-
end: 60
|
|
51
|
-
}]);
|
|
52
|
-
|
|
53
|
-
case 6:
|
|
54
|
-
case "end":
|
|
55
|
-
return _context.stop();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}, _callee);
|
|
59
|
-
})));
|
|
60
|
-
test('adapter can fetch regions 2', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
61
|
-
var features, adapter, result;
|
|
62
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
63
|
-
while (1) {
|
|
64
|
-
switch (_context2.prev = _context2.next) {
|
|
65
|
-
case 0:
|
|
66
|
-
features = [{
|
|
67
|
-
uniqueId: 'three',
|
|
68
|
-
refName: 'ctgB',
|
|
69
|
-
start: 50,
|
|
70
|
-
end: 60
|
|
71
|
-
}, {
|
|
72
|
-
uniqueId: 'two',
|
|
73
|
-
refName: 'ctgA',
|
|
74
|
-
start: 150,
|
|
75
|
-
end: 300
|
|
76
|
-
}, {
|
|
77
|
-
uniqueId: 'one',
|
|
78
|
-
refName: 'ctgA',
|
|
79
|
-
start: 250,
|
|
80
|
-
end: 400
|
|
81
|
-
}];
|
|
82
|
-
adapter = new _FromConfigRegionsAdapter.default(_configSchema.regionsConfigSchema.create({
|
|
83
|
-
features: features
|
|
84
|
-
}));
|
|
85
|
-
_context2.next = 4;
|
|
86
|
-
return adapter.getRegions();
|
|
87
|
-
|
|
88
|
-
case 4:
|
|
89
|
-
result = _context2.sent;
|
|
90
|
-
expect(result).toEqual([{
|
|
91
|
-
refName: 'ctgA',
|
|
92
|
-
start: 150,
|
|
93
|
-
end: 400
|
|
94
|
-
}, {
|
|
95
|
-
refName: 'ctgB',
|
|
96
|
-
start: 50,
|
|
97
|
-
end: 60
|
|
98
|
-
}]);
|
|
99
|
-
|
|
100
|
-
case 6:
|
|
101
|
-
case "end":
|
|
102
|
-
return _context2.stop();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}, _callee2);
|
|
106
|
-
})));
|
|
107
|
-
test('adapter can fetch regions 3', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
108
|
-
var features, adapter, result;
|
|
109
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
110
|
-
while (1) {
|
|
111
|
-
switch (_context3.prev = _context3.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
features = [{
|
|
114
|
-
uniqueId: 'two',
|
|
115
|
-
refName: 'ctgA',
|
|
116
|
-
start: 150,
|
|
117
|
-
end: 300
|
|
118
|
-
}, {
|
|
119
|
-
uniqueId: 'one',
|
|
120
|
-
refName: 'ctgA',
|
|
121
|
-
start: 250,
|
|
122
|
-
end: 400
|
|
123
|
-
}, {
|
|
124
|
-
uniqueId: 'three',
|
|
125
|
-
refName: 'ctgB',
|
|
126
|
-
start: 50,
|
|
127
|
-
end: 60
|
|
128
|
-
}];
|
|
129
|
-
adapter = new _FromConfigRegionsAdapter.default(_configSchema.regionsConfigSchema.create({
|
|
130
|
-
features: features
|
|
131
|
-
}));
|
|
132
|
-
_context3.next = 4;
|
|
133
|
-
return adapter.getRegions();
|
|
134
|
-
|
|
135
|
-
case 4:
|
|
136
|
-
result = _context3.sent;
|
|
137
|
-
expect(result).toEqual([{
|
|
138
|
-
refName: 'ctgA',
|
|
139
|
-
start: 150,
|
|
140
|
-
end: 400
|
|
141
|
-
}, {
|
|
142
|
-
refName: 'ctgB',
|
|
143
|
-
start: 50,
|
|
144
|
-
end: 60
|
|
145
|
-
}]);
|
|
146
|
-
|
|
147
|
-
case 6:
|
|
148
|
-
case "end":
|
|
149
|
-
return _context3.stop();
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}, _callee3);
|
|
153
|
-
})));
|
|
154
|
-
test('adapter can fetch regions 4', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
155
|
-
var features, adapter, result;
|
|
156
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
157
|
-
while (1) {
|
|
158
|
-
switch (_context4.prev = _context4.next) {
|
|
159
|
-
case 0:
|
|
160
|
-
features = [{
|
|
161
|
-
uniqueId: 'two',
|
|
162
|
-
refName: 'ctgA',
|
|
163
|
-
start: 150,
|
|
164
|
-
end: 300
|
|
165
|
-
}, {
|
|
166
|
-
uniqueId: 'onePrime',
|
|
167
|
-
refName: 'ctgA',
|
|
168
|
-
start: 300,
|
|
169
|
-
end: 400
|
|
170
|
-
}, {
|
|
171
|
-
uniqueId: 'three',
|
|
172
|
-
refName: 'ctgB',
|
|
173
|
-
start: 50,
|
|
174
|
-
end: 60
|
|
175
|
-
}];
|
|
176
|
-
adapter = new _FromConfigRegionsAdapter.default(_configSchema.regionsConfigSchema.create({
|
|
177
|
-
features: features
|
|
178
|
-
}));
|
|
179
|
-
_context4.next = 4;
|
|
180
|
-
return adapter.getRegions();
|
|
181
|
-
|
|
182
|
-
case 4:
|
|
183
|
-
result = _context4.sent;
|
|
184
|
-
expect(result).toEqual([{
|
|
185
|
-
refName: 'ctgA',
|
|
186
|
-
start: 150,
|
|
187
|
-
end: 400
|
|
188
|
-
}, {
|
|
189
|
-
refName: 'ctgB',
|
|
190
|
-
start: 50,
|
|
191
|
-
end: 60
|
|
192
|
-
}]);
|
|
193
|
-
|
|
194
|
-
case 6:
|
|
195
|
-
case "end":
|
|
196
|
-
return _context4.stop();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}, _callee4);
|
|
200
|
-
})));
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
-
|
|
9
|
-
var _operators = require("rxjs/operators");
|
|
10
|
-
|
|
11
|
-
var _FromConfigSequenceAdapter = _interopRequireDefault(require("./FromConfigSequenceAdapter"));
|
|
12
|
-
|
|
13
|
-
var _configSchema = require("./configSchema");
|
|
14
|
-
|
|
15
|
-
test('adapter can fetch sequences when there is just one feature representing whole refseq', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
16
|
-
var features, adapter, result, featuresArray, result2, featuresArray2;
|
|
17
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
18
|
-
while (1) {
|
|
19
|
-
switch (_context.prev = _context.next) {
|
|
20
|
-
case 0:
|
|
21
|
-
features = [{
|
|
22
|
-
uniqueId: 'one',
|
|
23
|
-
refName: 'ctgA',
|
|
24
|
-
start: 0,
|
|
25
|
-
end: 150,
|
|
26
|
-
seq: 'ccaaaccgtcaattaaccggtatcttctcggaaacggcggttctctcctagatagcgatctgtggtctcaccatgcaatttaaacaggtgagtaaagattgctacaaatacgagactagctgtcaccagatgctgttcatctgttggctc'
|
|
27
|
-
}];
|
|
28
|
-
adapter = new _FromConfigSequenceAdapter.default(_configSchema.sequenceConfigSchema.create({
|
|
29
|
-
features: features
|
|
30
|
-
}));
|
|
31
|
-
result = adapter.getFeatures({
|
|
32
|
-
refName: 'ctgA',
|
|
33
|
-
start: 0,
|
|
34
|
-
end: 50
|
|
35
|
-
});
|
|
36
|
-
_context.next = 5;
|
|
37
|
-
return result.pipe((0, _operators.toArray)()).toPromise();
|
|
38
|
-
|
|
39
|
-
case 5:
|
|
40
|
-
featuresArray = _context.sent;
|
|
41
|
-
expect(featuresArray.length).toBe(1);
|
|
42
|
-
expect(featuresArray[0].get('seq')).toBe(features[0].seq.slice(0, 50));
|
|
43
|
-
result2 = adapter.getFeatures({
|
|
44
|
-
refName: 'ctgA',
|
|
45
|
-
start: 100,
|
|
46
|
-
end: 150
|
|
47
|
-
});
|
|
48
|
-
_context.next = 11;
|
|
49
|
-
return result2.pipe((0, _operators.toArray)()).toPromise();
|
|
50
|
-
|
|
51
|
-
case 11:
|
|
52
|
-
featuresArray2 = _context.sent;
|
|
53
|
-
expect(featuresArray2.length).toBe(1);
|
|
54
|
-
expect(featuresArray2[0].get('seq')).toBe(features[0].seq.slice(100, 150));
|
|
55
|
-
|
|
56
|
-
case 14:
|
|
57
|
-
case "end":
|
|
58
|
-
return _context.stop();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}, _callee);
|
|
62
|
-
})));
|
|
63
|
-
test("adapter can fetch sequences when the config's sequence doesn't start at 0", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
64
|
-
var features, adapter, result, featuresArray, result2, featuresArray2;
|
|
65
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
66
|
-
while (1) {
|
|
67
|
-
switch (_context2.prev = _context2.next) {
|
|
68
|
-
case 0:
|
|
69
|
-
features = [{
|
|
70
|
-
uniqueId: 'one',
|
|
71
|
-
refName: 'ctgA',
|
|
72
|
-
start: 5000,
|
|
73
|
-
end: 5150,
|
|
74
|
-
seq: 'ccaaaccgtcaattaaccggtatcttctcggaaacggcggttctctcctagatagcgatctgtggtctcaccatgcaatttaaacaggtgagtaaagattgctacaaatacgagactagctgtcaccagatgctgttcatctgttggctc'
|
|
75
|
-
}];
|
|
76
|
-
adapter = new _FromConfigSequenceAdapter.default(_configSchema.sequenceConfigSchema.create({
|
|
77
|
-
features: features
|
|
78
|
-
}));
|
|
79
|
-
result = adapter.getFeatures({
|
|
80
|
-
refName: 'ctgA',
|
|
81
|
-
start: 4950,
|
|
82
|
-
end: 5050
|
|
83
|
-
});
|
|
84
|
-
_context2.next = 5;
|
|
85
|
-
return result.pipe((0, _operators.toArray)()).toPromise();
|
|
86
|
-
|
|
87
|
-
case 5:
|
|
88
|
-
featuresArray = _context2.sent;
|
|
89
|
-
expect(featuresArray.length).toBe(1);
|
|
90
|
-
expect(featuresArray[0].get('seq')).toBe(features[0].seq.slice(0, 50));
|
|
91
|
-
result2 = adapter.getFeatures({
|
|
92
|
-
refName: 'ctgA',
|
|
93
|
-
start: 5050,
|
|
94
|
-
end: 5150
|
|
95
|
-
});
|
|
96
|
-
_context2.next = 11;
|
|
97
|
-
return result2.pipe((0, _operators.toArray)()).toPromise();
|
|
98
|
-
|
|
99
|
-
case 11:
|
|
100
|
-
featuresArray2 = _context2.sent;
|
|
101
|
-
expect(featuresArray2.length).toBe(1);
|
|
102
|
-
expect(featuresArray2[0].get('seq')).toBe(features[0].seq.slice(50, 150));
|
|
103
|
-
|
|
104
|
-
case 14:
|
|
105
|
-
case "end":
|
|
106
|
-
return _context2.stop();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}, _callee2);
|
|
110
|
-
})));
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
-
|
|
9
|
-
var _RefNameAliasAdapter = _interopRequireDefault(require("./RefNameAliasAdapter"));
|
|
10
|
-
|
|
11
|
-
var _configSchema = _interopRequireDefault(require("./configSchema"));
|
|
12
|
-
|
|
13
|
-
test('adapter can fetch a simple alias file', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
14
|
-
var adapter, result;
|
|
15
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
switch (_context.prev = _context.next) {
|
|
18
|
-
case 0:
|
|
19
|
-
adapter = new _RefNameAliasAdapter.default(_configSchema.default.create({
|
|
20
|
-
location: {
|
|
21
|
-
localPath: require.resolve('./test_data/simple_alias.txt'),
|
|
22
|
-
locationType: 'LocalPathLocation'
|
|
23
|
-
}
|
|
24
|
-
}));
|
|
25
|
-
_context.next = 3;
|
|
26
|
-
return adapter.getRefNameAliases();
|
|
27
|
-
|
|
28
|
-
case 3:
|
|
29
|
-
result = _context.sent;
|
|
30
|
-
expect(result[0].refName).toBe('chr1');
|
|
31
|
-
expect(result[0].aliases).toEqual(['1', 'NC_000001.10']);
|
|
32
|
-
expect(result[1].refName).toBe('chr2');
|
|
33
|
-
expect(result[1].aliases).toEqual(['2', 'NC_000002.11']);
|
|
34
|
-
|
|
35
|
-
case 8:
|
|
36
|
-
case "end":
|
|
37
|
-
return _context.stop();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}, _callee);
|
|
41
|
-
})));
|
package/dist/index.test.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _PluginManager = _interopRequireDefault(require("@jbrowse/core/PluginManager"));
|
|
6
|
-
|
|
7
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require("."));
|
|
10
|
-
|
|
11
|
-
describe('Config editing', function () {
|
|
12
|
-
var pluginManager;
|
|
13
|
-
beforeAll(function () {
|
|
14
|
-
var originalConsoleWarn = console.warn;
|
|
15
|
-
console.warn = jest.fn();
|
|
16
|
-
pluginManager = new _PluginManager.default([new _.default()]);
|
|
17
|
-
pluginManager.createPluggableElements();
|
|
18
|
-
pluginManager.configure();
|
|
19
|
-
console.warn = originalConsoleWarn;
|
|
20
|
-
});
|
|
21
|
-
it("won't add if already added", function () {
|
|
22
|
-
expect(function () {
|
|
23
|
-
return pluginManager.addPlugin(new _.default());
|
|
24
|
-
}).toThrow(/JBrowse already configured, cannot add plugins/);
|
|
25
|
-
});
|
|
26
|
-
it('adds config editor widget', function () {
|
|
27
|
-
var ConfigurationEditorWidget = pluginManager.getWidgetType('ConfigurationEditorWidget');
|
|
28
|
-
var config = ConfigurationEditorWidget.configSchema.create({
|
|
29
|
-
type: 'ConfigurationEditorWidget'
|
|
30
|
-
});
|
|
31
|
-
expect((0, _mobxStateTree.getSnapshot)(config)).toMatchSnapshot();
|
|
32
|
-
});
|
|
33
|
-
it('creates proper FromConfigAdapter', function () {
|
|
34
|
-
var adapter = pluginManager.getAdapterType('FromConfigAdapter');
|
|
35
|
-
var config = adapter.configSchema.create({
|
|
36
|
-
type: 'FromConfigAdapter',
|
|
37
|
-
adapterId: 'testFromConfigAdapterId'
|
|
38
|
-
});
|
|
39
|
-
expect((0, _mobxStateTree.getSnapshot)(config)).toMatchSnapshot();
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { useDebounce } from '@jbrowse/core/util'
|
|
3
|
-
import { stringToJexlExpression } from '@jbrowse/core/util/jexlStrings'
|
|
4
|
-
import {
|
|
5
|
-
FormControl,
|
|
6
|
-
FormHelperText,
|
|
7
|
-
InputLabel,
|
|
8
|
-
Tooltip,
|
|
9
|
-
IconButton,
|
|
10
|
-
makeStyles,
|
|
11
|
-
} from '@material-ui/core'
|
|
12
|
-
import HelpIcon from '@material-ui/icons/Help'
|
|
13
|
-
import { getEnv } from 'mobx-state-tree'
|
|
14
|
-
import { observer, PropTypes } from 'mobx-react'
|
|
15
|
-
import Editor from 'react-simple-code-editor'
|
|
16
|
-
|
|
17
|
-
// fontSize and fontFamily have to match between Editor and SyntaxHighlighter
|
|
18
|
-
const fontSize = '12px'
|
|
19
|
-
|
|
20
|
-
// Optimize by using system default fonts:
|
|
21
|
-
// https://css-tricks.com/snippets/css/font-stacks/
|
|
22
|
-
const fontFamily =
|
|
23
|
-
'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace'
|
|
24
|
-
|
|
25
|
-
const useStyles = makeStyles(theme => ({
|
|
26
|
-
callbackEditor: {
|
|
27
|
-
marginTop: '16px',
|
|
28
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
29
|
-
fontFamily,
|
|
30
|
-
fontSize,
|
|
31
|
-
},
|
|
32
|
-
}))
|
|
33
|
-
|
|
34
|
-
function CallbackEditor({ slot }) {
|
|
35
|
-
const classes = useStyles()
|
|
36
|
-
|
|
37
|
-
const [code, setCode] = useState(slot.value)
|
|
38
|
-
const [error, setCodeError] = useState()
|
|
39
|
-
const debouncedCode = useDebounce(code, 400)
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
try {
|
|
43
|
-
const jexlDebouncedCode = debouncedCode.startsWith('jexl:')
|
|
44
|
-
? debouncedCode
|
|
45
|
-
: `jexl:${debouncedCode}`
|
|
46
|
-
stringToJexlExpression(
|
|
47
|
-
jexlDebouncedCode,
|
|
48
|
-
getEnv(slot).pluginManager?.jexl,
|
|
49
|
-
)
|
|
50
|
-
slot.set(jexlDebouncedCode)
|
|
51
|
-
setCodeError(null)
|
|
52
|
-
} catch (e) {
|
|
53
|
-
console.error({ e })
|
|
54
|
-
setCodeError(e)
|
|
55
|
-
}
|
|
56
|
-
}, [debouncedCode, slot])
|
|
57
|
-
|
|
58
|
-
// if default value is a callback, will have to remove jexl:
|
|
59
|
-
// do this last
|
|
60
|
-
return (
|
|
61
|
-
<>
|
|
62
|
-
<FormControl>
|
|
63
|
-
<InputLabel shrink htmlFor="callback-editor">
|
|
64
|
-
{slot.name}
|
|
65
|
-
</InputLabel>
|
|
66
|
-
<Editor
|
|
67
|
-
className={classes.callbackEditor}
|
|
68
|
-
value={code.startsWith('jexl:') ? code.split('jexl:')[1] : code}
|
|
69
|
-
onValueChange={newCode => setCode(newCode)}
|
|
70
|
-
highlight={newCode => newCode}
|
|
71
|
-
padding={10}
|
|
72
|
-
style={{ background: error ? '#fdd' : undefined }}
|
|
73
|
-
/>
|
|
74
|
-
{error ? (
|
|
75
|
-
<FormHelperText
|
|
76
|
-
style={{ color: '#f00' }}
|
|
77
|
-
>{`${error}`}</FormHelperText>
|
|
78
|
-
) : null}
|
|
79
|
-
<FormHelperText>{slot.description}</FormHelperText>
|
|
80
|
-
</FormControl>
|
|
81
|
-
<Tooltip
|
|
82
|
-
title={
|
|
83
|
-
<div>
|
|
84
|
-
Callbacks are written in Jexl format. Click to learn more.
|
|
85
|
-
<br /> Names of available context items: {slot.contextVariable}
|
|
86
|
-
</div>
|
|
87
|
-
}
|
|
88
|
-
arrow
|
|
89
|
-
>
|
|
90
|
-
<IconButton
|
|
91
|
-
color="primary"
|
|
92
|
-
onClick={() => {
|
|
93
|
-
const newWindow = window.open(
|
|
94
|
-
'https://github.com/TomFrost/Jexl',
|
|
95
|
-
'_blank',
|
|
96
|
-
'noopener,noreferrer',
|
|
97
|
-
)
|
|
98
|
-
if (newWindow) {
|
|
99
|
-
newWindow.opener = null
|
|
100
|
-
}
|
|
101
|
-
}}
|
|
102
|
-
>
|
|
103
|
-
<HelpIcon />
|
|
104
|
-
</IconButton>
|
|
105
|
-
</Tooltip>
|
|
106
|
-
</>
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
CallbackEditor.propTypes = {
|
|
110
|
-
slot: PropTypes.objectOrObservableObject.isRequired,
|
|
111
|
-
}
|
|
112
|
-
export default observer(CallbackEditor)
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react'
|
|
2
|
-
import Editor from 'react-simple-code-editor'
|
|
3
|
-
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'
|
|
4
|
-
import json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json'
|
|
5
|
-
import a11yDark from 'react-syntax-highlighter/dist/cjs/styles/hljs/a11y-dark'
|
|
6
|
-
import a11yLight from 'react-syntax-highlighter/dist/cjs/styles/hljs/a11y-light'
|
|
7
|
-
import { useTheme, makeStyles } from '@material-ui/core'
|
|
8
|
-
|
|
9
|
-
// fontSize and fontFamily have to match between Editor and SyntaxHighlighter
|
|
10
|
-
const fontSize = '12px'
|
|
11
|
-
// Optimize by using system default fonts: https://css-tricks.com/snippets/css/font-stacks/
|
|
12
|
-
const fontFamily =
|
|
13
|
-
'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace'
|
|
14
|
-
|
|
15
|
-
const useStyles = makeStyles(theme => ({
|
|
16
|
-
callbackEditor: {
|
|
17
|
-
fontFamily,
|
|
18
|
-
fontSize,
|
|
19
|
-
background: theme.palette.background.default,
|
|
20
|
-
overflowX: 'auto',
|
|
21
|
-
marginTop: '16px',
|
|
22
|
-
border: '1px solid rgba(0,0,0,0.42)',
|
|
23
|
-
},
|
|
24
|
-
syntaxHighlighter: {
|
|
25
|
-
margin: 0,
|
|
26
|
-
fontFamily,
|
|
27
|
-
fontSize,
|
|
28
|
-
},
|
|
29
|
-
}))
|
|
30
|
-
|
|
31
|
-
// eslint-disable-next-line react/prop-types
|
|
32
|
-
export default function CodeEditor({ contents, setContents }) {
|
|
33
|
-
const classes = useStyles()
|
|
34
|
-
const theme = useTheme()
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
SyntaxHighlighter.registerLanguage('json', json)
|
|
37
|
-
}, [])
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Editor
|
|
41
|
-
className={classes.callbackEditor}
|
|
42
|
-
value={contents}
|
|
43
|
-
onValueChange={setContents}
|
|
44
|
-
highlight={newCode => (
|
|
45
|
-
<SyntaxHighlighter
|
|
46
|
-
language="json"
|
|
47
|
-
style={theme.palette.type === 'dark' ? a11yDark : a11yLight}
|
|
48
|
-
className={classes.syntaxHighlighter}
|
|
49
|
-
// override some inline style stuff that's higher specificity
|
|
50
|
-
// than className
|
|
51
|
-
customStyle={{ background: 'none', padding: 0 }}
|
|
52
|
-
>
|
|
53
|
-
{newCode}
|
|
54
|
-
</SyntaxHighlighter>
|
|
55
|
-
)}
|
|
56
|
-
padding={10}
|
|
57
|
-
style={{}}
|
|
58
|
-
/>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
3
|
-
import ReactPropTypes from 'prop-types'
|
|
4
|
-
import { ChromePicker, Color, ColorResult } from 'react-color'
|
|
5
|
-
|
|
6
|
-
const useStyles = makeStyles({
|
|
7
|
-
popover: {
|
|
8
|
-
position: 'absolute',
|
|
9
|
-
zIndex: 2,
|
|
10
|
-
},
|
|
11
|
-
cover: {
|
|
12
|
-
position: 'fixed',
|
|
13
|
-
top: 0,
|
|
14
|
-
right: 0,
|
|
15
|
-
bottom: 0,
|
|
16
|
-
left: 0,
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
export function ColorPicker(props: {
|
|
21
|
-
color: Color
|
|
22
|
-
onChange: (color: ColorResult) => void
|
|
23
|
-
}) {
|
|
24
|
-
const { color, onChange } = props
|
|
25
|
-
const classes = useStyles()
|
|
26
|
-
const [displayColorPicker, setDisplayColorPicker] = useState(true)
|
|
27
|
-
|
|
28
|
-
const handleClose = () => {
|
|
29
|
-
setDisplayColorPicker(false)
|
|
30
|
-
}
|
|
31
|
-
return (
|
|
32
|
-
<div>
|
|
33
|
-
{displayColorPicker ? (
|
|
34
|
-
<div className={classes.popover}>
|
|
35
|
-
<div
|
|
36
|
-
role="presentation"
|
|
37
|
-
className={classes.cover}
|
|
38
|
-
onClick={handleClose}
|
|
39
|
-
/>
|
|
40
|
-
<ChromePicker color={color} onChange={onChange} />
|
|
41
|
-
</div>
|
|
42
|
-
) : null}
|
|
43
|
-
</div>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
ColorPicker.propTypes = {
|
|
48
|
-
color: ReactPropTypes.string.isRequired,
|
|
49
|
-
onChange: ReactPropTypes.func.isRequired,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default ColorPicker
|