@jbrowse/plugin-config 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.
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.js +5 -10
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +19 -57
- package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +2 -3
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +12 -38
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +3 -4
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +14 -32
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +2 -3
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +3 -8
- package/dist/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/HeadingComponent.js +2 -5
- package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +12 -40
- package/dist/ConfigurationEditorWidget/components/NumberEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/NumberEditor.js +3 -25
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +22 -56
- package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +2 -3
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +21 -52
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +28 -64
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +1 -2
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +30 -65
- package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +2 -3
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js +2 -7
- package/dist/ConfigurationEditorWidget/index.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/index.js +18 -8
- package/dist/ConfigurationEditorWidget/model.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/model.js +1 -3
- package/dist/FromConfigAdapter/FromConfigAdapter.d.ts +5 -5
- package/dist/FromConfigAdapter/FromConfigAdapter.js +3 -4
- package/dist/FromConfigAdapter/configSchema.d.ts +0 -3
- package/dist/FromConfigAdapter/configSchema.js +1 -7
- package/dist/FromConfigAdapter/index.d.ts +1 -1
- package/dist/FromConfigAdapter/index.js +17 -7
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +5 -12
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +2 -12
- package/dist/FromConfigRegionsAdapter/configSchema.d.ts +0 -3
- package/dist/FromConfigRegionsAdapter/configSchema.js +1 -8
- package/dist/FromConfigRegionsAdapter/index.d.ts +1 -1
- package/dist/FromConfigRegionsAdapter/index.js +17 -7
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +3 -16
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +3 -18
- package/dist/FromConfigSequenceAdapter/configSchema.d.ts +0 -3
- package/dist/FromConfigSequenceAdapter/configSchema.js +1 -7
- package/dist/FromConfigSequenceAdapter/index.d.ts +1 -1
- package/dist/FromConfigSequenceAdapter/index.js +17 -7
- package/dist/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +2 -1
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -3
- package/dist/NcbiSequenceReportAliasAdapter/configSchema.js +1 -8
- package/dist/NcbiSequenceReportAliasAdapter/index.d.ts +1 -1
- package/dist/NcbiSequenceReportAliasAdapter/index.js +17 -7
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +2 -1
- package/dist/RefNameAliasAdapter/configSchema.d.ts +0 -8
- package/dist/RefNameAliasAdapter/configSchema.js +1 -14
- package/dist/RefNameAliasAdapter/index.d.ts +1 -1
- package/dist/RefNameAliasAdapter/index.js +17 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -9
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +5 -7
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +19 -34
- package/esm/ConfigurationEditorWidget/components/ColorEditor.d.ts +2 -3
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js +12 -15
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +3 -4
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +15 -33
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +2 -3
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js +3 -5
- package/esm/ConfigurationEditorWidget/components/HeadingComponent.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/HeadingComponent.js +3 -3
- package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js +12 -17
- package/esm/ConfigurationEditorWidget/components/NumberEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/NumberEditor.js +3 -2
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +22 -33
- package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +2 -3
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +22 -30
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +28 -41
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +1 -2
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +30 -42
- package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +2 -3
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js +2 -4
- package/esm/ConfigurationEditorWidget/index.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/index.js +1 -1
- package/esm/ConfigurationEditorWidget/model.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/model.js +1 -3
- package/esm/FromConfigAdapter/FromConfigAdapter.d.ts +5 -5
- package/esm/FromConfigAdapter/FromConfigAdapter.js +3 -4
- package/esm/FromConfigAdapter/configSchema.d.ts +0 -3
- package/esm/FromConfigAdapter/configSchema.js +1 -7
- package/esm/FromConfigAdapter/index.d.ts +1 -1
- package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.d.ts +5 -12
- package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +3 -13
- package/esm/FromConfigRegionsAdapter/configSchema.d.ts +0 -3
- package/esm/FromConfigRegionsAdapter/configSchema.js +1 -8
- package/esm/FromConfigRegionsAdapter/index.d.ts +1 -1
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.d.ts +3 -16
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +3 -18
- package/esm/FromConfigSequenceAdapter/configSchema.d.ts +0 -3
- package/esm/FromConfigSequenceAdapter/configSchema.js +1 -7
- package/esm/FromConfigSequenceAdapter/index.d.ts +1 -1
- package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.d.ts +2 -1
- package/esm/NcbiSequenceReportAliasAdapter/NcbiSequenceReportAliasAdapter.js +1 -1
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.d.ts +0 -3
- package/esm/NcbiSequenceReportAliasAdapter/configSchema.js +1 -8
- package/esm/NcbiSequenceReportAliasAdapter/index.d.ts +1 -1
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.d.ts +2 -1
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +1 -1
- package/esm/RefNameAliasAdapter/configSchema.d.ts +0 -8
- package/esm/RefNameAliasAdapter/configSchema.js +1 -14
- package/esm/RefNameAliasAdapter/index.d.ts +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/package.json +2 -2
|
@@ -1,47 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { Button, FormHelperText, IconButton, InputAdornment, InputLabel, List, ListItem, TextField, } from '@mui/material';
|
|
4
|
-
// icons
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
5
3
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
4
|
+
import { Button, FormHelperText, IconButton, InputAdornment, InputLabel, List, ListItem, TextField, } from '@mui/material';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
6
|
const StringArrayEditor = observer(function ({ slot, }) {
|
|
7
7
|
const [value, setValue] = useState('');
|
|
8
8
|
const [addNew, setAddNew] = useState(false);
|
|
9
|
-
return (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
slot.add(value);
|
|
34
|
-
setValue('');
|
|
35
|
-
} }, "OK"),
|
|
36
|
-
React.createElement(Button, { color: "primary", variant: "contained", style: { margin: 2 }, onClick: () => {
|
|
37
|
-
setAddNew(false);
|
|
38
|
-
setValue('');
|
|
39
|
-
} }, "Cancel")))),
|
|
40
|
-
},
|
|
41
|
-
} }))) : null,
|
|
42
|
-
React.createElement(Button, { color: "primary", variant: "contained", style: { margin: 4 }, disabled: addNew, onClick: () => {
|
|
43
|
-
setAddNew(true);
|
|
44
|
-
} }, "Add item")),
|
|
45
|
-
React.createElement(FormHelperText, null, slot.description)));
|
|
9
|
+
return (_jsxs(_Fragment, { children: [slot.name ? _jsx(InputLabel, { children: slot.name }) : null, _jsxs(List, { disablePadding: true, children: [slot.value.map((val, idx) => (_jsx(ListItem, { disableGutters: true, children: _jsx(TextField, { value: val, onChange: evt => {
|
|
10
|
+
slot.setAtIndex(idx, evt.target.value);
|
|
11
|
+
}, slotProps: {
|
|
12
|
+
input: {
|
|
13
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { onClick: () => {
|
|
14
|
+
slot.removeAtIndex(idx);
|
|
15
|
+
}, children: _jsx(DeleteIcon, {}) }) })),
|
|
16
|
+
},
|
|
17
|
+
} }) }, `${JSON.stringify(val)}-${idx}`))), addNew ? (_jsx(ListItem, { disableGutters: true, children: _jsx(TextField, { value: value, placeholder: "add new", onChange: event => {
|
|
18
|
+
setValue(event.target.value);
|
|
19
|
+
}, slotProps: {
|
|
20
|
+
input: {
|
|
21
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsxs(_Fragment, { children: [_jsx(Button, { color: "primary", variant: "contained", style: { margin: 2 }, "data-testid": `stringArrayAdd-${slot.name}`, onClick: () => {
|
|
22
|
+
setAddNew(false);
|
|
23
|
+
slot.add(value);
|
|
24
|
+
setValue('');
|
|
25
|
+
}, children: "OK" }), _jsx(Button, { color: "primary", variant: "contained", style: { margin: 2 }, onClick: () => {
|
|
26
|
+
setAddNew(false);
|
|
27
|
+
setValue('');
|
|
28
|
+
}, children: "Cancel" })] }) })),
|
|
29
|
+
},
|
|
30
|
+
} }) })) : null, _jsx(Button, { color: "primary", variant: "contained", style: { margin: 4 }, disabled: addNew, onClick: () => {
|
|
31
|
+
setAddNew(true);
|
|
32
|
+
}, children: "Add item" })] }), _jsx(FormHelperText, { children: slot.description })] }));
|
|
46
33
|
});
|
|
47
34
|
export default StringArrayEditor;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const StringArrayMapEditor: ({ slot, }: {
|
|
3
2
|
slot: {
|
|
4
3
|
name: string;
|
|
@@ -10,5 +9,5 @@ declare const StringArrayMapEditor: ({ slot, }: {
|
|
|
10
9
|
removeAtKeyIndex: (key: string, idx: number) => void;
|
|
11
10
|
addToKey: (key: string, val: string) => void;
|
|
12
11
|
};
|
|
13
|
-
}) =>
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export default StringArrayMapEditor;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
4
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
3
5
|
import { Card, CardContent, CardHeader, FormHelperText, IconButton, InputAdornment, InputLabel, TextField, } from '@mui/material';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
4
7
|
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
// icons
|
|
6
|
-
import DeleteIcon from '@mui/icons-material/Delete';
|
|
7
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
8
|
-
// locals
|
|
9
8
|
import StringArrayEditor from './StringArrayEditor';
|
|
10
9
|
const useStyles = makeStyles()(theme => ({
|
|
11
10
|
card: {
|
|
@@ -15,41 +14,30 @@ const useStyles = makeStyles()(theme => ({
|
|
|
15
14
|
const StringArrayMapEditor = observer(function ({ slot, }) {
|
|
16
15
|
const { classes } = useStyles();
|
|
17
16
|
const [value, setValue] = useState('');
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, slotProps: {
|
|
44
|
-
input: {
|
|
45
|
-
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
46
|
-
React.createElement(IconButton, { disabled: value === '', onClick: () => {
|
|
47
|
-
slot.add(value, []);
|
|
48
|
-
setValue('');
|
|
49
|
-
} },
|
|
50
|
-
React.createElement(AddIcon, null)))),
|
|
51
|
-
},
|
|
52
|
-
} }) })),
|
|
53
|
-
React.createElement(FormHelperText, null, slot.description)));
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(InputLabel, { children: slot.name }), [...slot.value].map(([key, val]) => (_jsxs(Card, { raised: true, className: classes.card, children: [_jsx(CardHeader, { title: key, action: _jsx(IconButton, { onClick: () => {
|
|
18
|
+
slot.remove(key);
|
|
19
|
+
}, children: _jsx(DeleteIcon, {}) }) }), _jsx(CardContent, { children: _jsx(StringArrayEditor, { slot: {
|
|
20
|
+
name: slot.name,
|
|
21
|
+
value: val,
|
|
22
|
+
description: `Values associated with entry ${key}`,
|
|
23
|
+
setAtIndex: (idx, val) => {
|
|
24
|
+
slot.setAtKeyIndex(key, idx, val);
|
|
25
|
+
},
|
|
26
|
+
removeAtIndex: (idx) => {
|
|
27
|
+
slot.removeAtKeyIndex(key, idx);
|
|
28
|
+
},
|
|
29
|
+
add: (val) => {
|
|
30
|
+
slot.addToKey(key, val);
|
|
31
|
+
},
|
|
32
|
+
} }) })] }, key))), _jsx(Card, { raised: true, className: classes.card, children: _jsx(CardHeader, { disableTypography: true, title: _jsx(TextField, { fullWidth: true, value: value, placeholder: "add new", onChange: event => {
|
|
33
|
+
setValue(event.target.value);
|
|
34
|
+
}, slotProps: {
|
|
35
|
+
input: {
|
|
36
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { disabled: value === '', onClick: () => {
|
|
37
|
+
slot.add(value, []);
|
|
38
|
+
setValue('');
|
|
39
|
+
}, children: _jsx(AddIcon, {}) }) })),
|
|
40
|
+
},
|
|
41
|
+
} }) }) }), _jsx(FormHelperText, { children: slot.description })] }));
|
|
54
42
|
});
|
|
55
43
|
export default StringArrayMapEditor;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
1
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
2
|
declare const TypeSelector: ({ typeNameChoices, slot, slotName, onChange, }: {
|
|
4
3
|
typeNameChoices: string[];
|
|
5
4
|
slot: AnyConfigurationModel;
|
|
6
5
|
slotName: string;
|
|
7
6
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default TypeSelector;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { MenuItem, Paper, TextField } from '@mui/material';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { useSlotEditorStyles } from './useSlotEditorStyles';
|
|
5
5
|
const TypeSelector = observer(function ({ typeNameChoices, slot, slotName, onChange, }) {
|
|
6
6
|
const { classes } = useSlotEditorStyles();
|
|
7
|
-
return (
|
|
8
|
-
React.createElement("div", { className: classes.paperContent },
|
|
9
|
-
React.createElement(TextField, { value: slot.type, label: "Type", select: true, helperText: `Type of ${slotName} to use`, fullWidth: true, onChange: onChange }, typeNameChoices.map(str => (React.createElement(MenuItem, { key: str, value: str }, str)))))));
|
|
7
|
+
return (_jsx(Paper, { className: classes.paper, children: _jsx("div", { className: classes.paperContent, children: _jsx(TextField, { value: slot.type, label: "Type", select: true, helperText: `Type of ${slotName} to use`, fullWidth: true, onChange: onChange, children: typeNameChoices.map(str => (_jsx(MenuItem, { value: str, children: str }, str))) }) }) }));
|
|
10
8
|
});
|
|
11
9
|
export default TypeSelector;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function registerConfigurationEditorWidget(pluginManager: PluginManager): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
3
|
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
4
|
-
import stateModelFactory from './model';
|
|
5
4
|
import HeadingComponent from './components/HeadingComponent';
|
|
5
|
+
import stateModelFactory from './model';
|
|
6
6
|
const configSchema = ConfigurationSchema('ConfigurationEditorWidget', {});
|
|
7
7
|
const LazyConfigurationEditorComponent = lazy(() => import('./components/ConfigurationEditor'));
|
|
8
8
|
export default function registerConfigurationEditorWidget(pluginManager) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
3
3
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
4
4
|
type: import("mobx-state-tree").ISimpleType<"ConfigurationEditorWidget">;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree';
|
|
2
1
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
2
|
+
import { types } from 'mobx-state-tree';
|
|
3
3
|
export default function stateModelFactory(pluginManager) {
|
|
4
4
|
return types
|
|
5
5
|
.model('ConfigurationEditorWidget', {
|
|
6
6
|
id: ElementId,
|
|
7
7
|
type: types.literal('ConfigurationEditorWidget'),
|
|
8
|
-
// If you add different types of targets, don't forget to account for that
|
|
9
|
-
// in the key of ./components/ConfigurationEditor.js
|
|
10
8
|
target: types.safeReference(pluginManager.pluggableConfigSchemaType('track')),
|
|
11
9
|
})
|
|
12
10
|
.actions(self => ({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
+
import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
5
|
+
import type { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util/simpleFeature';
|
|
6
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
7
7
|
export declare function makeFeatures(fdata: SimpleFeatureSerialized[]): Map<string, Feature[]>;
|
|
8
8
|
export default class FromConfigAdapter extends BaseFeatureDataAdapter {
|
|
9
9
|
protected features: Map<string, Feature[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
1
2
|
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import SimpleFeature from '@jbrowse/core/util/simpleFeature';
|
|
3
3
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
4
|
-
import
|
|
4
|
+
import SimpleFeature from '@jbrowse/core/util/simpleFeature';
|
|
5
5
|
export function makeFeatures(fdata) {
|
|
6
6
|
const features = new Map();
|
|
7
7
|
for (const entry of fdata) {
|
|
@@ -14,7 +14,6 @@ export function makeFeatures(fdata) {
|
|
|
14
14
|
}
|
|
15
15
|
bucket.push(f);
|
|
16
16
|
}
|
|
17
|
-
// sort the features on each reference sequence by start coordinate
|
|
18
17
|
for (const refFeatures of features.values()) {
|
|
19
18
|
refFeatures.sort((a, b) => a.get('start') - b.get('start'));
|
|
20
19
|
}
|
|
@@ -47,5 +46,5 @@ export default class FromConfigAdapter extends BaseFeatureDataAdapter {
|
|
|
47
46
|
observer.complete();
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
|
-
freeResources(
|
|
49
|
+
freeResources() { }
|
|
51
50
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config FromConfigAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const configSchema = ConfigurationSchema('FromConfigAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
features: {
|
|
11
5
|
type: 'frozen',
|
|
12
6
|
defaultValue: [],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function FromConfigAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { BaseAdapter
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
* Adapter that just returns the features defined in its `features` configuration
|
|
7
|
-
* key, like:
|
|
8
|
-
* `"features": [ { "refName": "ctgA", "start":1, "end":20 }, ... ]`
|
|
9
|
-
*/
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
+
import type { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
5
|
+
import type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
10
6
|
export default class FromConfigRegionsAdapter extends BaseAdapter implements RegionsAdapter {
|
|
11
7
|
private features;
|
|
12
8
|
constructor(config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
|
|
13
|
-
/**
|
|
14
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
15
|
-
*/
|
|
16
9
|
getRegions(): Promise<{
|
|
17
10
|
refName: string;
|
|
18
11
|
start: number;
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
3
|
import { makeFeatures } from '../FromConfigAdapter/FromConfigAdapter';
|
|
4
|
-
/**
|
|
5
|
-
* Adapter that just returns the features defined in its `features` configuration
|
|
6
|
-
* key, like:
|
|
7
|
-
* `"features": [ { "refName": "ctgA", "start":1, "end":20 }, ... ]`
|
|
8
|
-
*/
|
|
9
4
|
export default class FromConfigRegionsAdapter extends BaseAdapter {
|
|
10
5
|
constructor(config, getSubAdapter, pluginManager) {
|
|
11
6
|
super(config, getSubAdapter, pluginManager);
|
|
12
7
|
const f = readConfObject(config, 'features');
|
|
13
8
|
this.features = makeFeatures(f);
|
|
14
9
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
17
|
-
*/
|
|
18
10
|
async getRegions() {
|
|
19
11
|
const regions = [];
|
|
20
|
-
// recall: features are stored in this object sorted by start coordinate
|
|
21
12
|
for (const [refName, features] of this.features) {
|
|
22
13
|
let currentRegion;
|
|
23
14
|
for (const feature of features) {
|
|
@@ -41,9 +32,8 @@ export default class FromConfigRegionsAdapter extends BaseAdapter {
|
|
|
41
32
|
regions.push(currentRegion);
|
|
42
33
|
}
|
|
43
34
|
}
|
|
44
|
-
// sort the regions by refName
|
|
45
35
|
regions.sort((a, b) => a.refName.localeCompare(b.refName));
|
|
46
36
|
return regions;
|
|
47
37
|
}
|
|
48
|
-
freeResources(
|
|
38
|
+
freeResources() { }
|
|
49
39
|
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config FromConfigRegionsAdapter
|
|
4
|
-
* used for specifying refNames+sizes of an assembly
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
7
3
|
const regionsConfigSchema = ConfigurationSchema('FromConfigRegionsAdapter', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
4
|
features: {
|
|
12
5
|
type: 'frozen',
|
|
13
6
|
defaultValue: [],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function FromConfigRegionsAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
import { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
2
|
-
import { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
3
|
-
import { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
1
|
import FromConfigAdapter from '../FromConfigAdapter/FromConfigAdapter';
|
|
2
|
+
import type { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util/simpleFeature';
|
|
4
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
5
5
|
export default class FromConfigSequenceAdapter extends FromConfigAdapter implements RegionsAdapter {
|
|
6
|
-
/**
|
|
7
|
-
* Fetch features for a certain region
|
|
8
|
-
* @param region - Region
|
|
9
|
-
* @returns Observable of Feature objects in the region
|
|
10
|
-
*/
|
|
11
6
|
getFeatures(region: NoAssemblyRegion): import("rxjs").Observable<Feature>;
|
|
12
|
-
/**
|
|
13
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
14
|
-
*/
|
|
15
7
|
getRegions(): Promise<{
|
|
16
8
|
start: number;
|
|
17
9
|
end: number;
|
|
18
10
|
refName: string;
|
|
19
11
|
}[]>;
|
|
20
|
-
/**
|
|
21
|
-
* called to provide a hint that data tied to a certain region
|
|
22
|
-
* will not be needed for the foreseeable future and can be purged
|
|
23
|
-
* from caches, etc
|
|
24
|
-
*/
|
|
25
12
|
freeResources(): void;
|
|
26
13
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import SimpleFeature from '@jbrowse/core/util/simpleFeature';
|
|
2
1
|
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
2
|
+
import SimpleFeature from '@jbrowse/core/util/simpleFeature';
|
|
3
|
+
import { firstValueFrom } from 'rxjs';
|
|
3
4
|
import { toArray } from 'rxjs/operators';
|
|
4
|
-
// locals
|
|
5
5
|
import FromConfigAdapter from '../FromConfigAdapter/FromConfigAdapter';
|
|
6
|
-
import { firstValueFrom } from 'rxjs';
|
|
7
6
|
export default class FromConfigSequenceAdapter extends FromConfigAdapter {
|
|
8
|
-
/**
|
|
9
|
-
* Fetch features for a certain region
|
|
10
|
-
* @param region - Region
|
|
11
|
-
* @returns Observable of Feature objects in the region
|
|
12
|
-
*/
|
|
13
7
|
getFeatures(region) {
|
|
14
8
|
return ObservableCreate(async (observer) => {
|
|
15
9
|
const feats = await firstValueFrom(super.getFeatures(region).pipe(toArray()));
|
|
@@ -26,12 +20,8 @@ export default class FromConfigSequenceAdapter extends FromConfigAdapter {
|
|
|
26
20
|
observer.complete();
|
|
27
21
|
});
|
|
28
22
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
31
|
-
*/
|
|
32
23
|
async getRegions() {
|
|
33
24
|
const regions = [];
|
|
34
|
-
// recall: features are stored in this object sorted by start coordinate
|
|
35
25
|
for (const [refName, features] of this.features) {
|
|
36
26
|
let currentRegion;
|
|
37
27
|
for (const feature of features) {
|
|
@@ -57,10 +47,5 @@ export default class FromConfigSequenceAdapter extends FromConfigAdapter {
|
|
|
57
47
|
}
|
|
58
48
|
return regions;
|
|
59
49
|
}
|
|
60
|
-
|
|
61
|
-
* called to provide a hint that data tied to a certain region
|
|
62
|
-
* will not be needed for the foreseeable future and can be purged
|
|
63
|
-
* from caches, etc
|
|
64
|
-
*/
|
|
65
|
-
freeResources( /* { region } */) { }
|
|
50
|
+
freeResources() { }
|
|
66
51
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config FromConfigSequenceAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
6
3
|
const sequenceConfigSchema = ConfigurationSchema('FromConfigSequenceAdapter', {
|
|
7
|
-
/**
|
|
8
|
-
* #slot
|
|
9
|
-
*/
|
|
10
4
|
features: {
|
|
11
5
|
type: 'frozen',
|
|
12
6
|
defaultValue: [],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function FromConfigSequenceAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { BaseRefNameAliasAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
3
|
export default class NcbiSequenceReportAliasAdapter extends BaseAdapter implements BaseRefNameAliasAdapter {
|
|
3
4
|
getRefNameAliases(): Promise<{
|
|
4
5
|
refName: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAdapter
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
2
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
3
|
export default class NcbiSequenceReportAliasAdapter extends BaseAdapter {
|
|
4
4
|
async getRefNameAliases() {
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config NcbiSequenceReportAliasAdapter
|
|
4
|
-
* can read "sequence_report.tsv" type files from NCBI
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
7
3
|
const NcbiSequenceReportAliasAdapterConfigSchema = ConfigurationSchema('NcbiSequenceReportAliasAdapter', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
4
|
location: {
|
|
12
5
|
type: 'fileLocation',
|
|
13
6
|
defaultValue: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function NcbiSequenceReportAliasAdapterF(pluginManager: PluginManager): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import type { BaseRefNameAliasAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
3
|
export default class RefNameAliasAdapter extends BaseAdapter implements BaseRefNameAliasAdapter {
|
|
3
4
|
getRefNameAliases(): Promise<{
|
|
4
5
|
refName: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAdapter
|
|
1
|
+
import { BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
2
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
3
|
export default class RefNameAliasAdapter extends BaseAdapter {
|
|
4
4
|
async getRefNameAliases() {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const RefNameAliasAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
location: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,11 +6,6 @@ declare const RefNameAliasAdapter: import("@jbrowse/core/configuration/configura
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
|
-
/**
|
|
13
|
-
* #slot
|
|
14
|
-
* by default, the "ref names that match the fasta" are assumed to be in the
|
|
15
|
-
* first column (0), change this variable if needed
|
|
16
|
-
*/
|
|
17
9
|
refNameColumn: {
|
|
18
10
|
type: string;
|
|
19
11
|
defaultValue: number;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
3
|
-
* #config RefNameAliasAdapter
|
|
4
|
-
* can read "chromAliases" type files from UCSC or any tab separated file of
|
|
5
|
-
* refName aliases
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
function x() { }
|
|
8
3
|
const RefNameAliasAdapter = ConfigurationSchema('RefNameAliasAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
4
|
location: {
|
|
13
5
|
type: 'fileLocation',
|
|
14
6
|
defaultValue: {
|
|
@@ -16,11 +8,6 @@ const RefNameAliasAdapter = ConfigurationSchema('RefNameAliasAdapter', {
|
|
|
16
8
|
locationType: 'UriLocation',
|
|
17
9
|
},
|
|
18
10
|
},
|
|
19
|
-
/**
|
|
20
|
-
* #slot
|
|
21
|
-
* by default, the "ref names that match the fasta" are assumed to be in the
|
|
22
|
-
* first column (0), change this variable if needed
|
|
23
|
-
*/
|
|
24
11
|
refNameColumn: {
|
|
25
12
|
type: 'number',
|
|
26
13
|
defaultValue: 0,
|