-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sorting and collapsing options to the hierarchical track selector (…
- Loading branch information
Showing
21 changed files
with
1,342 additions
and
1,410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
plugins/data-management/src/HierarchicalTrackSelectorWidget/components/util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
plugins/data-management/src/HierarchicalTrackSelectorWidget/filterTracks.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { | ||
AnyConfigurationModel, | ||
readConfObject, | ||
} from '@jbrowse/core/configuration' | ||
import { getEnv, getSession, notEmpty } from '@jbrowse/core/util' | ||
import { hasAllOverlap, hasAnyOverlap } from './util' | ||
|
||
export function filterTracks( | ||
tracks: AnyConfigurationModel[], | ||
self: { | ||
view?: { | ||
type: string | ||
trackSelectorAnyOverlap?: boolean | ||
} | ||
assemblyNames: string[] | ||
}, | ||
) { | ||
const { assemblyManager } = getSession(self) | ||
const { pluginManager } = getEnv(self) | ||
const { view } = self | ||
|
||
if (!view) { | ||
return [] | ||
} | ||
const trackListAssemblies = self.assemblyNames | ||
.map(a => assemblyManager.get(a)) | ||
.filter(notEmpty) | ||
return tracks | ||
.filter(c => { | ||
const trackAssemblyNames = readConfObject(c, 'assemblyNames') as string[] | ||
const trackAssemblies = trackAssemblyNames | ||
?.map(name => assemblyManager.get(name)) | ||
.filter(notEmpty) | ||
return view.trackSelectorAnyOverlap | ||
? hasAnyOverlap(trackAssemblies, trackListAssemblies) | ||
: hasAllOverlap(trackAssemblies, trackListAssemblies) | ||
}) | ||
.filter(c => { | ||
const { displayTypes } = pluginManager.getViewType(view.type) | ||
const compatDisplays = displayTypes.map(d => d.name) | ||
const trackDisplays = c.displays.map((d: { type: string }) => d.type) | ||
return hasAnyOverlap(compatDisplays, trackDisplays) | ||
}) | ||
} |
Oops, something went wrong.