From 61ca87f2888733a91ad948e5b6d1cff741c5c343 Mon Sep 17 00:00:00 2001 From: TripZz Date: Thu, 21 Dec 2023 12:27:15 +0100 Subject: [PATCH] NN-422 Added the specified selection window to subsets and enrichments TODO: EnrichmentLayers have no specified based selection --- .../pane/modules/subset/SubsetPane.vue | 19 ++++++---- .../src/components/toolbar/MainToolBar.vue | 6 ++-- .../toolbar/modules/SelectionList.vue | 36 +++++++++++++------ .../src/components/visualization/MainVis.vue | 7 ++-- frontend/src/views/ProteinView.vue | 2 ++ 5 files changed, 48 insertions(+), 22 deletions(-) diff --git a/frontend/src/components/pane/modules/subset/SubsetPane.vue b/frontend/src/components/pane/modules/subset/SubsetPane.vue index 21e9894b..d7672e3f 100644 --- a/frontend/src/components/pane/modules/subset/SubsetPane.vue +++ b/frontend/src/components/pane/modules/subset/SubsetPane.vue @@ -17,7 +17,7 @@
@@ -49,6 +49,7 @@ export default { }, data() { return { + subset: null, hide: true, expand_proteins: false, subset_item: { @@ -73,16 +74,20 @@ export default { return; } - com.subset_item.value = com.active_subset + com.subset = com.active_subset.selection ? com.active_subset.genes: com.active_subset + // if (com.active_subset.selection) com.subset = com.active_subset.genes + // else com.subset = com.active_subset + + com.subset_item.value = com.subset com.contained_edges = []; com.export_edges = []; com.subset_ids = []; var id_dict = {}; - for (var idX in com.active_subset){ - id_dict[com.active_subset[idX].id] = com.active_subset[idX].label; - com.subset_ids.push(com.active_subset[idX].id); + for (var idX in com.subset){ + id_dict[com.subset[idX].id] = com.subset[idX].label; + com.subset_ids.push(com.subset[idX].id); } var subset_proteins = new Set(com.subset_ids); for (var idx in com.gephi_data.edges) { @@ -112,13 +117,13 @@ export default { var com = this; var textToCopy = []; - for(var link of com.active_subset) textToCopy.push(link.label); + for(var link of com.subset) textToCopy.push(link.label); navigator.clipboard.writeText(textToCopy.join("\n")); }, show_layer(){ var com = this; - var subset_check = this.hide ? com.active_subset.map(node => node.attributes["Name"]) : null + var subset_check = this.hide ? com.subset.map(node => node.attributes["Name"]) : null this.emitter.emit("hideSubset", {subset: subset_check, mode: this.mode}); com.hide = !com.hide }, diff --git a/frontend/src/components/toolbar/MainToolBar.vue b/frontend/src/components/toolbar/MainToolBar.vue index 7fc9a00d..06f21df8 100644 --- a/frontend/src/components/toolbar/MainToolBar.vue +++ b/frontend/src/components/toolbar/MainToolBar.vue @@ -29,8 +29,10 @@ :mode = 'mode' @tools_active_changed = 'tools_active = $event' > - @@ -51,7 +53,7 @@ import SelectionList from '@/components/toolbar/modules/SelectionList.vue' export default { name: 'MainToolBar', - props: ['gephi_data', 'term_data'], + props: ['gephi_data', 'term_data','active_subset', 'active_term'], components: { MenuWindow, ProteinList, diff --git a/frontend/src/components/toolbar/modules/SelectionList.vue b/frontend/src/components/toolbar/modules/SelectionList.vue index 597d40cc..27091a31 100644 --- a/frontend/src/components/toolbar/modules/SelectionList.vue +++ b/frontend/src/components/toolbar/modules/SelectionList.vue @@ -90,11 +90,12 @@