@jbrowse/plugin-trix 5.0.0-beta.8 → 5.0.0-beta.9
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.
|
@@ -2,8 +2,8 @@ import Trix from '@gmod/trix';
|
|
|
2
2
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
3
3
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
4
4
|
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
5
|
+
import { checkAbortSignal } from '@jbrowse/core/util/aborting';
|
|
5
6
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
6
|
-
import { checkStopToken } from '@jbrowse/core/util/stopToken';
|
|
7
7
|
function decodeURIComponentNoThrow(uri) {
|
|
8
8
|
try {
|
|
9
9
|
return decodeURIComponent(uri);
|
|
@@ -57,7 +57,7 @@ export default class TrixTextSearchAdapter extends BaseAdapter {
|
|
|
57
57
|
// the index read has landed but nothing below it has run yet; a broad
|
|
58
58
|
// prefix returns thousands of records to JSON-parse, decode and snippet,
|
|
59
59
|
// and the keystroke that asked for them is 50ms stale by now
|
|
60
|
-
|
|
60
|
+
checkAbortSignal(args.signal);
|
|
61
61
|
const formatted = results
|
|
62
62
|
.map(([term, data]) => {
|
|
63
63
|
// record is ["loc"|"trackId"|"attr1"|...] with commas pre-encoded as
|
|
@@ -8,7 +8,9 @@ export declare function normalizeSnapshot(snap: Record<string, unknown>): Record
|
|
|
8
8
|
* `jbrowse text-index` writes this entry into `aggregateTextSearchAdapters` for
|
|
9
9
|
* you. The `uri` shorthand points at the `.ix` and the sibling `.ixx` is derived
|
|
10
10
|
* from it, so the pair only needs spelling out when they are named against
|
|
11
|
-
* convention.
|
|
11
|
+
* convention. Written by hand, `{ uri: 'trix/hg38.ix' }` is the whole entry: a
|
|
12
|
+
* `.ix` implies this type, the id is generated, and `assemblyNames` defaults to
|
|
13
|
+
* the track's own for a per-track index or to the config's one assembly.
|
|
12
14
|
* ```js
|
|
13
15
|
* {
|
|
14
16
|
* type: 'TrixTextSearchAdapter',
|
|
@@ -19,38 +21,25 @@ export declare function normalizeSnapshot(snap: Record<string, unknown>): Record
|
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
23
|
declare const TrixTextSearchAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
type: {
|
|
25
|
+
type: "string";
|
|
26
|
+
} & {
|
|
27
|
+
defaultValue: string;
|
|
28
|
+
};
|
|
27
29
|
readonly ixFilePath: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly locationType: "UriLocation";
|
|
32
|
-
};
|
|
30
|
+
type: "fileLocation";
|
|
31
|
+
} & {
|
|
32
|
+
defaultValue: unknown;
|
|
33
33
|
};
|
|
34
|
-
/**
|
|
35
|
-
* #slot
|
|
36
|
-
* location of the `.ixx` prefix index, which records where in the `.ix`
|
|
37
|
-
* each prefix begins. It is what makes a lookup a couple of range requests
|
|
38
|
-
* instead of a download of the whole index.
|
|
39
|
-
*/
|
|
40
34
|
readonly ixxFilePath: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
readonly locationType: "UriLocation";
|
|
45
|
-
};
|
|
35
|
+
type: "fileLocation";
|
|
36
|
+
} & {
|
|
37
|
+
defaultValue: unknown;
|
|
46
38
|
};
|
|
47
|
-
/**
|
|
48
|
-
* #slot
|
|
49
|
-
*/
|
|
50
39
|
readonly assemblyNames: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
type: "stringArray";
|
|
41
|
+
} & {
|
|
42
|
+
defaultValue: unknown;
|
|
54
43
|
};
|
|
55
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined
|
|
44
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, true, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
|
|
56
45
|
export default TrixTextSearchAdapter;
|
|
@@ -24,7 +24,9 @@ export function normalizeSnapshot(snap) {
|
|
|
24
24
|
* `jbrowse text-index` writes this entry into `aggregateTextSearchAdapters` for
|
|
25
25
|
* you. The `uri` shorthand points at the `.ix` and the sibling `.ixx` is derived
|
|
26
26
|
* from it, so the pair only needs spelling out when they are named against
|
|
27
|
-
* convention.
|
|
27
|
+
* convention. Written by hand, `{ uri: 'trix/hg38.ix' }` is the whole entry: a
|
|
28
|
+
* `.ix` implies this type, the id is generated, and `assemblyNames` defaults to
|
|
29
|
+
* the track's own for a per-track index or to the config's one assembly.
|
|
28
30
|
* ```js
|
|
29
31
|
* {
|
|
30
32
|
* type: 'TrixTextSearchAdapter',
|
|
@@ -50,8 +52,8 @@ const TrixTextSearchAdapter = ConfigurationSchema('TrixTextSearchAdapter', {
|
|
|
50
52
|
/**
|
|
51
53
|
* #slot
|
|
52
54
|
* location of the `.ixx` prefix index, which records where in the `.ix`
|
|
53
|
-
* each prefix begins
|
|
54
|
-
*
|
|
55
|
+
* each prefix begins, so a lookup takes a couple of range requests instead
|
|
56
|
+
* of a download of the whole index.
|
|
55
57
|
*/
|
|
56
58
|
ixxFilePath: {
|
|
57
59
|
type: 'fileLocation',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-trix",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 trix text search adapter",
|
|
6
6
|
"keywords": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@gmod/trix": "^3.0.22",
|
|
28
|
-
"@jbrowse/core": "^5.0.0-beta.
|
|
28
|
+
"@jbrowse/core": "^5.0.0-beta.9"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|