diff --git a/src/app/components/analysis-window/analysis-window.component.ts b/src/app/components/analysis-window/analysis-window.component.ts index 2ae8f512e1ff986ef2483925deebb6e67efc01cc..21b92fea561c404669568638635108bdcdb1f001 100644 --- a/src/app/components/analysis-window/analysis-window.component.ts +++ b/src/app/components/analysis-window/analysis-window.component.ts @@ -125,20 +125,27 @@ export class AnalysisWindowComponent implements OnInit, OnChanges { this.showDetailsChange.emit(null); }); + this.network.on('doubleClick', (properties) => { + const nodeIds: Array<string> = properties.nodes; + if (nodeIds.length > 0) { + const nodeId = nodeIds[0]; + const node = this.nodeData.nodes.get(nodeId); + const wrapper = node.wrapper; + if (this.analysis.inSelection(wrapper)) { + this.analysis.removeItem(wrapper); + this.analysis.getCount(); + } else { + this.analysis.addItem(wrapper); + this.analysis.getCount(); + } + } + }); + this.network.on('click', (properties) => { const selectedNodes = this.nodeData.nodes.get(properties.nodes); if (selectedNodes.length > 0) { const selectedNode = selectedNodes[0]; const wrapper = selectedNode.wrapper; - - if (properties.event.srcEvent.ctrlKey) { - if (this.analysis.inSelection(wrapper)) { - this.analysis.removeItem(wrapper); - } else { - this.analysis.addItem(wrapper); - this.analysis.getCount(); - } - } this.showDetailsChange.emit(wrapper); } else { this.showDetailsChange.emit(null); diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index ff8a1cf7623c5e3e02697a192750819ae1dfcc0d..ae27326a3e78b40fa6a160e15c647a158f361cf7 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -396,7 +396,7 @@ </tbody> </table> <i *ngIf="analysis.getCount() === 0"> - To select proteins, click them while pressing CTRL. + Double-click on a protein to select it for the analysis. </i> </div> <footer class="card-footer"> diff --git a/src/app/pages/explorer-page/explorer-page.component.ts b/src/app/pages/explorer-page/explorer-page.component.ts index 1f3f29c18c927d5d29e56b8afdab693280a259b9..e4e0ba4bca34714230683c8cb0e1d53ec974ceaa 100644 --- a/src/app/pages/explorer-page/explorer-page.component.ts +++ b/src/app/pages/explorer-page/explorer-page.component.ts @@ -193,22 +193,27 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { const container = this.networkEl.nativeElement; const options = NetworkSettings.getOptions('main'); this.network = new vis.Network(container, this.nodeData, options); - this.network.on('click', (properties) => { + this.network.on('doubleClick', (properties) => { const nodeIds: Array<string> = properties.nodes; if (nodeIds.length > 0) { const nodeId = nodeIds[0]; const node = this.nodeData.nodes.get(nodeId); const wrapper = node.wrapper; - if (properties.event.srcEvent.ctrlKey) { - if (this.analysis.inSelection(wrapper)) { - this.analysis.removeItem(wrapper); - } else { - this.analysis.addItem(wrapper); - } - this.openSummary(wrapper, false); + if (this.analysis.inSelection(wrapper)) { + this.analysis.removeItem(wrapper); } else { - this.openSummary(wrapper, false); + this.analysis.addItem(wrapper); } + } + }); + + this.network.on('click', (properties) => { + const nodeIds: Array<string> = properties.nodes; + if (nodeIds.length > 0) { + const nodeId = nodeIds[0]; + const node = this.nodeData.nodes.get(nodeId); + const wrapper = node.wrapper; + this.openSummary(wrapper, false); } else { this.closeSummary(); }