@jbrowse/plugin-data-management 2.5.0 → 2.6.1
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/AddConnectionWidget/components/AddConnectionWidget.d.ts +2 -1
- package/dist/AddConnectionWidget/components/ConfigureConnection.d.ts +2 -1
- package/dist/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +2 -1
- package/dist/AddTrackWidget/components/AddTrackWidget.d.ts +2 -1
- package/dist/AddTrackWidget/components/ConfirmTrack.d.ts +2 -1
- package/dist/AddTrackWidget/components/DefaultAddTrackWorkflow.d.ts +2 -1
- package/dist/AddTrackWidget/components/DefaultAddTrackWorkflow.js +1 -1
- package/dist/AddTrackWidget/components/DefaultAddTrackWorkflow.js.map +1 -1
- package/dist/AddTrackWidget/components/PasteConfigWorkflow.d.ts +2 -1
- package/dist/AddTrackWidget/components/PasteConfigWorkflow.js +1 -0
- package/dist/AddTrackWidget/components/PasteConfigWorkflow.js.map +1 -1
- package/dist/AddTrackWidget/components/TextIndexingConfig.d.ts +2 -1
- package/dist/AddTrackWidget/components/TrackAdapterSelector.d.ts +2 -1
- package/dist/AddTrackWidget/components/TrackSourceSelect.d.ts +2 -1
- package/dist/AddTrackWidget/components/TrackTypeSelector.d.ts +2 -1
- package/dist/AssemblyManager/AssemblyAddForm.d.ts +2 -1
- package/dist/AssemblyManager/AssemblyEditor.d.ts +2 -1
- package/dist/AssemblyManager/AssemblyManager.d.ts +2 -1
- package/dist/AssemblyManager/AssemblyTable.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalFab.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js +4 -9
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/ShoppingCart.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.d.ts +8 -8
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.js +6 -10
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/DeleteConnectionDialog.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/ManageConnectionsDialog.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/ToggleConnectionsDialog.d.ts +3 -3
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/ToggleConnectionsDialog.js +27 -22
- package/dist/HierarchicalTrackSelectorWidget/components/dialogs/ToggleConnectionsDialog.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedDialog.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +32 -31
- package/dist/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.d.ts +3 -3
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js +36 -41
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.d.ts +3 -3
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js +2 -2
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js.map +1 -1
- package/dist/HierarchicalTrackSelectorWidget/components/tree/HierarchicalTree.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackCategory.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/components/tree/TrackListNode.d.ts +2 -1
- package/dist/HierarchicalTrackSelectorWidget/model.d.ts +69 -5
- package/dist/HierarchicalTrackSelectorWidget/model.js +100 -53
- package/dist/HierarchicalTrackSelectorWidget/model.js.map +1 -1
- package/dist/PluginStoreWidget/components/CustomPluginForm.d.ts +2 -1
- package/dist/PluginStoreWidget/components/InstalledPlugin.d.ts +2 -1
- package/dist/PluginStoreWidget/components/InstalledPluginsList.d.ts +2 -1
- package/dist/PluginStoreWidget/components/PluginCard.d.ts +2 -1
- package/dist/PluginStoreWidget/components/PluginStoreWidget.d.ts +2 -1
- package/dist/SetDefaultSession/SetDefaultSession.d.ts +2 -1
- package/dist/index.d.ts +4 -4
- package/dist/ucsc-trackhub/model.d.ts +12 -0
- package/dist/ucsc-trackhub/model.js +45 -12
- package/dist/ucsc-trackhub/model.js.map +1 -1
- package/esm/AddConnectionWidget/components/AddConnectionWidget.d.ts +2 -1
- package/esm/AddConnectionWidget/components/ConfigureConnection.d.ts +2 -1
- package/esm/AddConnectionWidget/components/ConnectionTypeSelect.d.ts +2 -1
- package/esm/AddTrackWidget/components/AddTrackWidget.d.ts +2 -1
- package/esm/AddTrackWidget/components/ConfirmTrack.d.ts +2 -1
- package/esm/AddTrackWidget/components/DefaultAddTrackWorkflow.d.ts +2 -1
- package/esm/AddTrackWidget/components/DefaultAddTrackWorkflow.js +1 -1
- package/esm/AddTrackWidget/components/DefaultAddTrackWorkflow.js.map +1 -1
- package/esm/AddTrackWidget/components/PasteConfigWorkflow.d.ts +2 -1
- package/esm/AddTrackWidget/components/PasteConfigWorkflow.js +1 -0
- package/esm/AddTrackWidget/components/PasteConfigWorkflow.js.map +1 -1
- package/esm/AddTrackWidget/components/TextIndexingConfig.d.ts +2 -1
- package/esm/AddTrackWidget/components/TrackAdapterSelector.d.ts +2 -1
- package/esm/AddTrackWidget/components/TrackSourceSelect.d.ts +2 -1
- package/esm/AddTrackWidget/components/TrackTypeSelector.d.ts +2 -1
- package/esm/AssemblyManager/AssemblyAddForm.d.ts +2 -1
- package/esm/AssemblyManager/AssemblyEditor.d.ts +2 -1
- package/esm/AssemblyManager/AssemblyManager.d.ts +2 -1
- package/esm/AssemblyManager/AssemblyTable.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalFab.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js +4 -9
- package/esm/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/ShoppingCart.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.d.ts +8 -8
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.js +7 -11
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/DeleteConnectionDialog.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/ManageConnectionsDialog.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/ToggleConnectionsDialog.d.ts +3 -3
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/ToggleConnectionsDialog.js +27 -22
- package/esm/HierarchicalTrackSelectorWidget/components/dialogs/ToggleConnectionsDialog.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetFilters.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedDialog.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedHeader.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js +32 -31
- package/esm/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.d.ts +3 -3
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js +37 -42
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.d.ts +3 -3
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js +2 -2
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.js.map +1 -1
- package/esm/HierarchicalTrackSelectorWidget/components/tree/HierarchicalTree.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackCategory.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/components/tree/TrackListNode.d.ts +2 -1
- package/esm/HierarchicalTrackSelectorWidget/model.d.ts +69 -5
- package/esm/HierarchicalTrackSelectorWidget/model.js +101 -54
- package/esm/HierarchicalTrackSelectorWidget/model.js.map +1 -1
- package/esm/PluginStoreWidget/components/CustomPluginForm.d.ts +2 -1
- package/esm/PluginStoreWidget/components/InstalledPlugin.d.ts +2 -1
- package/esm/PluginStoreWidget/components/InstalledPluginsList.d.ts +2 -1
- package/esm/PluginStoreWidget/components/PluginCard.d.ts +2 -1
- package/esm/PluginStoreWidget/components/PluginStoreWidget.d.ts +2 -1
- package/esm/SetDefaultSession/SetDefaultSession.d.ts +2 -1
- package/esm/index.d.ts +4 -4
- package/esm/ucsc-trackhub/model.d.ts +12 -0
- package/esm/ucsc-trackhub/model.js +20 -10
- package/esm/ucsc-trackhub/model.js.map +1 -1
- package/package.json +2 -2
- package/src/AddConnectionWidget/components/AddConnectionWidget.test.tsx +1 -1
- package/src/AddTrackWidget/components/DefaultAddTrackWorkflow.tsx +1 -1
- package/src/AddTrackWidget/components/PasteConfigWorkflow.tsx +1 -0
- package/src/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.tsx +11 -21
- package/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap +89 -24
- package/src/HierarchicalTrackSelectorWidget/components/dialogs/CloseConnectionDialog.tsx +9 -13
- package/src/HierarchicalTrackSelectorWidget/components/dialogs/ToggleConnectionsDialog.tsx +69 -39
- package/src/HierarchicalTrackSelectorWidget/components/faceted/FacetedSelector.tsx +14 -18
- package/src/HierarchicalTrackSelectorWidget/components/tree/HamburgerMenu.tsx +46 -51
- package/src/HierarchicalTrackSelectorWidget/components/tree/HierarchicalHeader.tsx +1 -3
- package/src/HierarchicalTrackSelectorWidget/model.ts +120 -65
- package/src/PluginStoreWidget/model.test.tsx +1 -1
- package/src/ucsc-trackhub/model.ts +28 -24
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
3
|
import { BasePlugin } from '@jbrowse/core/util/types';
|
|
3
4
|
import { PluginStoreModel } from '../model';
|
|
@@ -5,6 +6,6 @@ declare function InstalledPlugin({ plugin, model, pluginManager, }: {
|
|
|
5
6
|
plugin: BasePlugin;
|
|
6
7
|
model: PluginStoreModel;
|
|
7
8
|
pluginManager: PluginManager;
|
|
8
|
-
}): JSX.Element;
|
|
9
|
+
}): React.JSX.Element;
|
|
9
10
|
declare const _default: typeof InstalledPlugin;
|
|
10
11
|
export default _default;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
3
|
import { PluginStoreModel } from '../model';
|
|
3
4
|
declare function InstalledPluginsList({ pluginManager, model, }: {
|
|
4
5
|
pluginManager: PluginManager;
|
|
5
6
|
model: PluginStoreModel;
|
|
6
|
-
}): JSX.Element;
|
|
7
|
+
}): React.JSX.Element;
|
|
7
8
|
declare const _default: typeof InstalledPluginsList;
|
|
8
9
|
export default _default;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { JBrowsePlugin } from '@jbrowse/core/util/types';
|
|
2
3
|
import { PluginStoreModel } from '../model';
|
|
3
4
|
declare const _default: ({ plugin, model, adminMode, }: {
|
|
4
5
|
plugin: JBrowsePlugin;
|
|
5
6
|
model: PluginStoreModel;
|
|
6
7
|
adminMode: boolean;
|
|
7
|
-
}) => JSX.Element;
|
|
8
|
+
}) => React.JSX.Element;
|
|
8
9
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { PluginStoreModel } from '../model';
|
|
2
3
|
declare function PluginStoreWidget({ model }: {
|
|
3
4
|
model: PluginStoreModel;
|
|
4
|
-
}): JSX.Element;
|
|
5
|
+
}): React.JSX.Element;
|
|
5
6
|
declare const _default: typeof PluginStoreWidget;
|
|
6
7
|
export default _default;
|
package/esm/index.d.ts
CHANGED
|
@@ -4,22 +4,22 @@ import PluginManager from '@jbrowse/core/PluginManager';
|
|
|
4
4
|
declare const SetDefaultSession: import("react").LazyExoticComponent<({ rootModel, onClose }: {
|
|
5
5
|
rootModel?: unknown;
|
|
6
6
|
onClose: () => void;
|
|
7
|
-
}) => JSX.Element | null>;
|
|
7
|
+
}) => import("react").JSX.Element | null>;
|
|
8
8
|
declare const AssemblyManager: import("react").LazyExoticComponent<({ rootModel, onClose, }: {
|
|
9
9
|
rootModel: any;
|
|
10
10
|
onClose: (arg: boolean) => void;
|
|
11
|
-
}) => JSX.Element>;
|
|
11
|
+
}) => import("react").JSX.Element>;
|
|
12
12
|
export default class extends Plugin {
|
|
13
13
|
name: string;
|
|
14
14
|
exports: {
|
|
15
15
|
AssemblyManager: import("react").LazyExoticComponent<({ rootModel, onClose, }: {
|
|
16
16
|
rootModel: any;
|
|
17
17
|
onClose: (arg: boolean) => void;
|
|
18
|
-
}) => JSX.Element>;
|
|
18
|
+
}) => import("react").JSX.Element>;
|
|
19
19
|
SetDefaultSession: import("react").LazyExoticComponent<({ rootModel, onClose }: {
|
|
20
20
|
rootModel?: unknown;
|
|
21
21
|
onClose: () => void;
|
|
22
|
-
}) => JSX.Element | null>;
|
|
22
|
+
}) => import("react").JSX.Element | null>;
|
|
23
23
|
};
|
|
24
24
|
install(pluginManager: PluginManager): void;
|
|
25
25
|
configure(_pluginManager: PluginManager): void;
|
|
@@ -2,6 +2,18 @@ import PluginManager from '@jbrowse/core/PluginManager';
|
|
|
2
2
|
export default function UCSCTrackHubConnection(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
3
3
|
name: import("mobx-state-tree").ISimpleType<string>;
|
|
4
4
|
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
5
|
+
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
6
|
+
name: {
|
|
7
|
+
type: string;
|
|
8
|
+
defaultValue: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
assemblyNames: {
|
|
12
|
+
type: string;
|
|
13
|
+
defaultValue: never[];
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
|
|
5
17
|
} & {
|
|
6
18
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
7
19
|
hubTxtLocation: {
|
|
@@ -4,7 +4,6 @@ import { getSession } from '@jbrowse/core/util';
|
|
|
4
4
|
import { types } from 'mobx-state-tree';
|
|
5
5
|
// locals
|
|
6
6
|
import configSchema from './configSchema';
|
|
7
|
-
import { fetchGenomesFile, fetchHubFile, fetchTrackDbFile, generateTracks, } from './ucscTrackHub';
|
|
8
7
|
export default function UCSCTrackHubConnection(pluginManager) {
|
|
9
8
|
return types
|
|
10
9
|
.compose('UCSCTrackHubConnection', BaseConnectionModelFactory(pluginManager), types.model({
|
|
@@ -15,9 +14,10 @@ export default function UCSCTrackHubConnection(pluginManager) {
|
|
|
15
14
|
async connect() {
|
|
16
15
|
var _a;
|
|
17
16
|
const session = getSession(self);
|
|
17
|
+
const notLoadedAssemblies = [];
|
|
18
18
|
try {
|
|
19
|
-
const connectionName = getConf(self, 'name'); // NOTE: name comes from the base configuration
|
|
20
19
|
const hubFileLocation = getConf(self, 'hubTxtLocation');
|
|
20
|
+
const { generateTracks, fetchGenomesFile, fetchTrackDbFile, fetchHubFile, } = await import('./ucscTrackHub');
|
|
21
21
|
const hubFile = await fetchHubFile(hubFileLocation);
|
|
22
22
|
const genomeFile = hubFile.get('genomesFile');
|
|
23
23
|
if (!genomeFile) {
|
|
@@ -34,7 +34,7 @@ export default function UCSCTrackHubConnection(pluginManager) {
|
|
|
34
34
|
locationType: 'LocalPathLocation',
|
|
35
35
|
};
|
|
36
36
|
const genomesFile = await fetchGenomesFile(genomesFileLocation);
|
|
37
|
-
const
|
|
37
|
+
const map = {};
|
|
38
38
|
for (const [genomeName, genome] of genomesFile) {
|
|
39
39
|
const assemblyNames = getConf(self, 'assemblyNames');
|
|
40
40
|
if (assemblyNames.length > 0 &&
|
|
@@ -43,14 +43,15 @@ export default function UCSCTrackHubConnection(pluginManager) {
|
|
|
43
43
|
}
|
|
44
44
|
const conf = (_a = session.assemblyManager.get(genomeName)) === null || _a === void 0 ? void 0 : _a.configuration;
|
|
45
45
|
if (!conf) {
|
|
46
|
-
|
|
46
|
+
notLoadedAssemblies.push(genomeName);
|
|
47
|
+
continue;
|
|
47
48
|
}
|
|
48
49
|
const db = genome.get('trackDb');
|
|
49
50
|
if (!db) {
|
|
50
51
|
throw new Error('genomesFile not found on hub');
|
|
51
52
|
}
|
|
52
53
|
const base = new URL(genomeFile, hubUri);
|
|
53
|
-
const
|
|
54
|
+
const loc = hubUri
|
|
54
55
|
? {
|
|
55
56
|
uri: new URL(db, base).href,
|
|
56
57
|
locationType: 'UriLocation',
|
|
@@ -59,13 +60,22 @@ export default function UCSCTrackHubConnection(pluginManager) {
|
|
|
59
60
|
localPath: db,
|
|
60
61
|
locationType: 'LocalPathLocation',
|
|
61
62
|
};
|
|
62
|
-
const trackDb = await fetchTrackDbFile(
|
|
63
|
-
trackDbData.push([trackDbLoc, trackDb, genomeName, conf]);
|
|
64
|
-
}
|
|
65
|
-
for (const [trackDbLoc, trackDbFile, genomeName, conf,] of trackDbData) {
|
|
63
|
+
const trackDb = await fetchTrackDbFile(loc);
|
|
66
64
|
const seqAdapter = readConfObject(conf, ['sequence', 'adapter']);
|
|
67
|
-
|
|
65
|
+
const tracks = generateTracks(trackDb, loc, genomeName, seqAdapter);
|
|
66
|
+
self.addTrackConfs(tracks);
|
|
67
|
+
map[genomeName] = tracks.length;
|
|
68
68
|
}
|
|
69
|
+
const loadedAssemblies = Object.entries(map);
|
|
70
|
+
const str1 = loadedAssemblies.length
|
|
71
|
+
? `Loaded data from these assemblies: ${loadedAssemblies
|
|
72
|
+
.map(([key, val]) => `${key} (${val} tracks)`)
|
|
73
|
+
.join(', ')}`
|
|
74
|
+
: '';
|
|
75
|
+
const str2 = notLoadedAssemblies.length
|
|
76
|
+
? `Skipped data from these assemblies: ${notLoadedAssemblies.join(', ')}`
|
|
77
|
+
: '';
|
|
78
|
+
session.notify([str1, str2].filter(f => !!f).join('. '), 'success');
|
|
69
79
|
}
|
|
70
80
|
catch (e) {
|
|
71
81
|
console.error(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/ucsc-trackhub/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAA;AACvF,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,OAAO,GACR,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAA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AE,SAAS,CAAC,CAAA;aACpE;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAChB,OAAO,CAAC,MAAM,CACZ,yDAAyD,IAAI,CAAC,aAAa,CAAC,IAAI,6FAA6F,CAAC,GAAG,EACjL,OAAO,CACR,CAAA;gBACD,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;aAC5C;QACH,CAAC;KACF,CAAC,CAAC,CAAA;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-data-management",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "JBrowse 2 linear genome view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"distModule": "esm/index.js",
|
|
62
62
|
"srcModule": "src/index.ts",
|
|
63
63
|
"module": "esm/index.js",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "1cbe7ba097fb2d2763c776e5e429e4670cdd583c"
|
|
65
65
|
}
|
|
@@ -79,7 +79,7 @@ type bigWig
|
|
|
79
79
|
expect(session.connections.length).toBe(0)
|
|
80
80
|
fireEvent.mouseDown(getAllByRole('button')[0])
|
|
81
81
|
const ucscTrackHubSelection = await findAllByText('UCSC Track Hub')
|
|
82
|
-
fireEvent.click(ucscTrackHubSelection
|
|
82
|
+
fireEvent.click(ucscTrackHubSelection.at(-1)!)
|
|
83
83
|
fireEvent.click(await findByTestId('addConnectionNext'))
|
|
84
84
|
fireEvent.change(await findByDisplayValue('nameOfConnection'), {
|
|
85
85
|
target: { value: 'Test UCSC connection name' },
|
|
@@ -81,7 +81,7 @@ function AddTrackWorkflow({ model }: { model: AddTrackModel }) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const trackId = [
|
|
84
|
-
`${trackName.toLowerCase().
|
|
84
|
+
`${trackName.toLowerCase().replaceAll(' ', '_')}-${Date.now()}`,
|
|
85
85
|
`${session.adminMode ? '' : '-sessionTrack'}`,
|
|
86
86
|
].join('')
|
|
87
87
|
|
|
@@ -21,15 +21,13 @@ const AutoSizedHierarchicalTree = ({
|
|
|
21
21
|
}) => {
|
|
22
22
|
return typeof jest === 'undefined' ? (
|
|
23
23
|
<AutoSizer disableWidth>
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)
|
|
32
|
-
}}
|
|
24
|
+
{args => (
|
|
25
|
+
<HierarchicalTree
|
|
26
|
+
height={(args.height || offset) - offset}
|
|
27
|
+
model={model}
|
|
28
|
+
tree={tree}
|
|
29
|
+
/>
|
|
30
|
+
)}
|
|
33
31
|
</AutoSizer>
|
|
34
32
|
) : (
|
|
35
33
|
<HierarchicalTree height={9000} model={model} tree={tree} />
|
|
@@ -73,25 +71,17 @@ const HierarchicalTrackSelector = observer(function ({
|
|
|
73
71
|
model: HierarchicalTrackSelectorModel
|
|
74
72
|
toolbarHeight?: number
|
|
75
73
|
}) {
|
|
76
|
-
const [assemblyIdx, setAssemblyIdx] = useState(0)
|
|
77
74
|
const [headerHeight, setHeaderHeight] = useState(0)
|
|
78
|
-
|
|
79
|
-
const { assemblyNames } = model
|
|
80
|
-
const assemblyName = assemblyNames[assemblyIdx]
|
|
81
|
-
return assemblyName ? (
|
|
75
|
+
return (
|
|
82
76
|
<>
|
|
83
|
-
<HierarchicalHeader
|
|
84
|
-
model={model}
|
|
85
|
-
setHeaderHeight={setHeaderHeight}
|
|
86
|
-
setAssemblyIdx={setAssemblyIdx}
|
|
87
|
-
/>
|
|
77
|
+
<HierarchicalHeader model={model} setHeaderHeight={setHeaderHeight} />
|
|
88
78
|
<AutoSizedHierarchicalTree
|
|
89
|
-
tree={model.hierarchy
|
|
79
|
+
tree={model.hierarchy}
|
|
90
80
|
model={model}
|
|
91
81
|
offset={toolbarHeight + headerHeight}
|
|
92
82
|
/>
|
|
93
83
|
</>
|
|
94
|
-
)
|
|
84
|
+
)
|
|
95
85
|
})
|
|
96
86
|
|
|
97
87
|
export default HierarchicalTrackSelectorContainer
|
|
@@ -1,26 +1,91 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`renders nothing with no assembly 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
tabindex="0"
|
|
7
|
-
type="button"
|
|
4
|
+
<div
|
|
5
|
+
data-testid="hierarchical_track_selector"
|
|
8
6
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-havevq-MuiSvgIcon-root"
|
|
12
|
-
data-testid="AddIcon"
|
|
13
|
-
focusable="false"
|
|
14
|
-
viewBox="0 0 24 24"
|
|
7
|
+
<div
|
|
8
|
+
style="display: flex;"
|
|
15
9
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
<button
|
|
11
|
+
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-1kgqocu-MuiButtonBase-root-MuiIconButton-root-menuIcon"
|
|
12
|
+
tabindex="0"
|
|
13
|
+
type="button"
|
|
14
|
+
>
|
|
15
|
+
<svg
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-havevq-MuiSvgIcon-root"
|
|
18
|
+
data-testid="MenuIcon"
|
|
19
|
+
focusable="false"
|
|
20
|
+
viewBox="0 0 24 24"
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
<span
|
|
27
|
+
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
|
|
28
|
+
/>
|
|
29
|
+
</button>
|
|
30
|
+
<div
|
|
31
|
+
class="MuiFormControl-root MuiFormControl-marginDense MuiFormControl-fullWidth MuiTextField-root css-rlnh8o-MuiFormControl-root-MuiTextField-root-searchBox"
|
|
32
|
+
>
|
|
33
|
+
<label
|
|
34
|
+
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
|
|
35
|
+
data-shrink="false"
|
|
36
|
+
for="mui-1"
|
|
37
|
+
id="mui-1-label"
|
|
38
|
+
>
|
|
39
|
+
Filter tracks
|
|
40
|
+
</label>
|
|
41
|
+
<div
|
|
42
|
+
class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedEnd css-1blad95-MuiInputBase-root-MuiInput-root"
|
|
43
|
+
>
|
|
44
|
+
<input
|
|
45
|
+
aria-invalid="false"
|
|
46
|
+
class="MuiInputBase-input MuiInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedEnd css-nz481w-MuiInputBase-input-MuiInput-input"
|
|
47
|
+
id="mui-1"
|
|
48
|
+
type="text"
|
|
49
|
+
value=""
|
|
50
|
+
/>
|
|
51
|
+
<div
|
|
52
|
+
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-standard MuiInputAdornment-sizeSmall css-1laqsz7-MuiInputAdornment-root"
|
|
53
|
+
>
|
|
54
|
+
<button
|
|
55
|
+
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-9vna8i-MuiButtonBase-root-MuiIconButton-root"
|
|
56
|
+
tabindex="0"
|
|
57
|
+
type="button"
|
|
58
|
+
>
|
|
59
|
+
<svg
|
|
60
|
+
aria-hidden="true"
|
|
61
|
+
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-havevq-MuiSvgIcon-root"
|
|
62
|
+
data-testid="ClearIcon"
|
|
63
|
+
focusable="false"
|
|
64
|
+
viewBox="0 0 24 24"
|
|
65
|
+
>
|
|
66
|
+
<path
|
|
67
|
+
d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
68
|
+
/>
|
|
69
|
+
</svg>
|
|
70
|
+
<span
|
|
71
|
+
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
|
|
72
|
+
/>
|
|
73
|
+
</button>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<button
|
|
78
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall css-1c8zr45-MuiButtonBase-root-MuiButton-root-menuIcon"
|
|
79
|
+
tabindex="0"
|
|
80
|
+
type="button"
|
|
81
|
+
>
|
|
82
|
+
Open faceted selector
|
|
83
|
+
<span
|
|
84
|
+
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
|
|
85
|
+
/>
|
|
86
|
+
</button>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
24
89
|
`;
|
|
25
90
|
|
|
26
91
|
exports[`renders with a couple of categorized tracks 1`] = `
|
|
@@ -56,8 +121,8 @@ exports[`renders with a couple of categorized tracks 1`] = `
|
|
|
56
121
|
<label
|
|
57
122
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
|
|
58
123
|
data-shrink="false"
|
|
59
|
-
for="mui-
|
|
60
|
-
id="mui-
|
|
124
|
+
for="mui-6"
|
|
125
|
+
id="mui-6-label"
|
|
61
126
|
>
|
|
62
127
|
Filter tracks
|
|
63
128
|
</label>
|
|
@@ -67,7 +132,7 @@ exports[`renders with a couple of categorized tracks 1`] = `
|
|
|
67
132
|
<input
|
|
68
133
|
aria-invalid="false"
|
|
69
134
|
class="MuiInputBase-input MuiInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedEnd css-nz481w-MuiInputBase-input-MuiInput-input"
|
|
70
|
-
id="mui-
|
|
135
|
+
id="mui-6"
|
|
71
136
|
type="text"
|
|
72
137
|
value=""
|
|
73
138
|
/>
|
|
@@ -144,8 +209,8 @@ exports[`renders with a couple of uncategorized tracks 1`] = `
|
|
|
144
209
|
<label
|
|
145
210
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-standard css-1s1jvl0-MuiFormLabel-root-MuiInputLabel-root"
|
|
146
211
|
data-shrink="false"
|
|
147
|
-
for="mui-
|
|
148
|
-
id="mui-
|
|
212
|
+
for="mui-2"
|
|
213
|
+
id="mui-2-label"
|
|
149
214
|
>
|
|
150
215
|
Filter tracks
|
|
151
216
|
</label>
|
|
@@ -155,7 +220,7 @@ exports[`renders with a couple of uncategorized tracks 1`] = `
|
|
|
155
220
|
<input
|
|
156
221
|
aria-invalid="false"
|
|
157
222
|
class="MuiInputBase-input MuiInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedEnd css-nz481w-MuiInputBase-input-MuiInput-input"
|
|
158
|
-
id="mui-
|
|
223
|
+
id="mui-2"
|
|
159
224
|
type="text"
|
|
160
225
|
value=""
|
|
161
226
|
/>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {
|
|
3
|
-
Dialog,
|
|
4
|
-
DialogTitle,
|
|
5
3
|
DialogContent,
|
|
6
4
|
DialogContentText,
|
|
7
5
|
Button,
|
|
@@ -9,23 +7,23 @@ import {
|
|
|
9
7
|
ListItem,
|
|
10
8
|
DialogActions,
|
|
11
9
|
} from '@mui/material'
|
|
10
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
12
11
|
import { observer } from 'mobx-react'
|
|
13
12
|
|
|
14
|
-
function CloseConnectionDialog({
|
|
13
|
+
export default observer(function CloseConnectionDialog({
|
|
15
14
|
modalInfo = {},
|
|
16
|
-
|
|
15
|
+
onClose,
|
|
17
16
|
}: {
|
|
18
17
|
modalInfo?: {
|
|
19
18
|
name?: string
|
|
20
19
|
dereferenceTypeCount?: { [key: string]: number }
|
|
21
|
-
safelyBreakConnection?:
|
|
20
|
+
safelyBreakConnection?: () => void
|
|
22
21
|
}
|
|
23
|
-
|
|
22
|
+
onClose: () => void
|
|
24
23
|
}) {
|
|
25
24
|
const { name, dereferenceTypeCount, safelyBreakConnection } = modalInfo
|
|
26
25
|
return (
|
|
27
|
-
<Dialog open>
|
|
28
|
-
<DialogTitle>Close connection "{name}"</DialogTitle>
|
|
26
|
+
<Dialog open maxWidth="lg" title={`Close connection "${name}"`}>
|
|
29
27
|
<DialogContent>
|
|
30
28
|
{dereferenceTypeCount ? (
|
|
31
29
|
<>
|
|
@@ -44,7 +42,7 @@ function CloseConnectionDialog({
|
|
|
44
42
|
</DialogContentText>
|
|
45
43
|
</DialogContent>
|
|
46
44
|
<DialogActions>
|
|
47
|
-
<Button onClick={() =>
|
|
45
|
+
<Button onClick={() => onClose()} color="primary">
|
|
48
46
|
Cancel
|
|
49
47
|
</Button>
|
|
50
48
|
<Button
|
|
@@ -53,7 +51,7 @@ function CloseConnectionDialog({
|
|
|
53
51
|
modalInfo
|
|
54
52
|
? () => {
|
|
55
53
|
safelyBreakConnection?.()
|
|
56
|
-
|
|
54
|
+
onClose()
|
|
57
55
|
}
|
|
58
56
|
: () => {}
|
|
59
57
|
}
|
|
@@ -64,6 +62,4 @@ function CloseConnectionDialog({
|
|
|
64
62
|
</DialogActions>
|
|
65
63
|
</Dialog>
|
|
66
64
|
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default observer(CloseConnectionDialog)
|
|
65
|
+
})
|
|
@@ -27,7 +27,73 @@ const useStyles = makeStyles()(theme => ({
|
|
|
27
27
|
},
|
|
28
28
|
}))
|
|
29
29
|
|
|
30
|
-
function
|
|
30
|
+
const ConnectionRow = observer(function ConnectionRow({
|
|
31
|
+
conf,
|
|
32
|
+
session,
|
|
33
|
+
breakConnection,
|
|
34
|
+
}: {
|
|
35
|
+
conf: AnyConfigurationModel
|
|
36
|
+
session: AbstractSessionModel
|
|
37
|
+
breakConnection: (arg: AnyConfigurationModel) => void
|
|
38
|
+
}) {
|
|
39
|
+
const { connectionInstances: instances = [] } = session
|
|
40
|
+
const name = readConfObject(conf, 'name')
|
|
41
|
+
const assemblyNames = readConfObject(conf, 'assemblyNames')
|
|
42
|
+
const found = instances.find(conn => name === conn.name)
|
|
43
|
+
return (
|
|
44
|
+
<FormControlLabel
|
|
45
|
+
key={conf.connectionId}
|
|
46
|
+
control={
|
|
47
|
+
<Checkbox
|
|
48
|
+
checked={!!found}
|
|
49
|
+
onChange={() => {
|
|
50
|
+
if (found) {
|
|
51
|
+
breakConnection(conf)
|
|
52
|
+
} else {
|
|
53
|
+
session.makeConnection?.(conf)
|
|
54
|
+
}
|
|
55
|
+
}}
|
|
56
|
+
color="primary"
|
|
57
|
+
/>
|
|
58
|
+
}
|
|
59
|
+
label={[
|
|
60
|
+
name,
|
|
61
|
+
assemblyNames.length ? `(${ellipses(assemblyNames.join(','))})` : '',
|
|
62
|
+
]
|
|
63
|
+
.filter(f => !!f)
|
|
64
|
+
.join(' ')}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const ConnectionList = observer(function ConnectionsList({
|
|
70
|
+
session,
|
|
71
|
+
breakConnection,
|
|
72
|
+
}: {
|
|
73
|
+
session: AbstractSessionModel
|
|
74
|
+
breakConnection: (arg: AnyConfigurationModel) => void
|
|
75
|
+
}) {
|
|
76
|
+
const { classes } = useStyles()
|
|
77
|
+
return (
|
|
78
|
+
<div className={classes.connectionContainer}>
|
|
79
|
+
{!session.connections.length ? (
|
|
80
|
+
<Typography>No connections found</Typography>
|
|
81
|
+
) : (
|
|
82
|
+
session.connections.map((conf, idx) => (
|
|
83
|
+
<div key={conf.name + '_' + idx}>
|
|
84
|
+
<ConnectionRow
|
|
85
|
+
conf={conf}
|
|
86
|
+
session={session}
|
|
87
|
+
breakConnection={breakConnection}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
))
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
)
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
export default observer(function ToggleConnectionDialog({
|
|
31
97
|
session,
|
|
32
98
|
handleClose,
|
|
33
99
|
breakConnection,
|
|
@@ -36,8 +102,6 @@ function ToggleConnectionDialog({
|
|
|
36
102
|
session: AbstractSessionModel
|
|
37
103
|
breakConnection: (arg: AnyConfigurationModel) => void
|
|
38
104
|
}) {
|
|
39
|
-
const { classes } = useStyles()
|
|
40
|
-
const { connections, connectionInstances: instances = [] } = session
|
|
41
105
|
return (
|
|
42
106
|
<Dialog
|
|
43
107
|
open
|
|
@@ -47,39 +111,7 @@ function ToggleConnectionDialog({
|
|
|
47
111
|
>
|
|
48
112
|
<DialogContent>
|
|
49
113
|
<Typography>Use the checkbox to turn on/off connections</Typography>
|
|
50
|
-
<
|
|
51
|
-
{connections.map(conf => {
|
|
52
|
-
const name = readConfObject(conf, 'name')
|
|
53
|
-
const assemblyNames = readConfObject(conf, 'assemblyNames')
|
|
54
|
-
const found = instances.find(conn => name === conn.name)
|
|
55
|
-
return (
|
|
56
|
-
<FormControlLabel
|
|
57
|
-
key={conf.connectionId}
|
|
58
|
-
control={
|
|
59
|
-
<Checkbox
|
|
60
|
-
checked={!!found}
|
|
61
|
-
onChange={() => {
|
|
62
|
-
if (found) {
|
|
63
|
-
breakConnection(conf)
|
|
64
|
-
} else {
|
|
65
|
-
session.makeConnection?.(conf)
|
|
66
|
-
}
|
|
67
|
-
}}
|
|
68
|
-
color="primary"
|
|
69
|
-
/>
|
|
70
|
-
}
|
|
71
|
-
label={`${name} ${
|
|
72
|
-
assemblyNames.length
|
|
73
|
-
? '(' + ellipses(assemblyNames.join(',')) + ')'
|
|
74
|
-
: ''
|
|
75
|
-
}`}
|
|
76
|
-
/>
|
|
77
|
-
)
|
|
78
|
-
})}
|
|
79
|
-
{!connections.length ? (
|
|
80
|
-
<Typography>No connections found</Typography>
|
|
81
|
-
) : null}
|
|
82
|
-
</div>
|
|
114
|
+
<ConnectionList session={session} breakConnection={breakConnection} />
|
|
83
115
|
</DialogContent>
|
|
84
116
|
<DialogActions>
|
|
85
117
|
<Button
|
|
@@ -92,6 +124,4 @@ function ToggleConnectionDialog({
|
|
|
92
124
|
</DialogActions>
|
|
93
125
|
</Dialog>
|
|
94
126
|
)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export default observer(ToggleConnectionDialog)
|
|
127
|
+
})
|