Skip to content

Commit 5e491cc

Browse files
committed
Calculate intersection client-side #1348
1 parent d88d1db commit 5e491cc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/client/features/enrichment/enrichment-tooltip.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ class EnrichmentTooltip extends React.Component {
4949
let {node} = this.props;
5050
let { description, name } = this.state;
5151
let title = node.data('name');
52-
// See #1348 https://github.com/PathwayCommons/app-ui/issues/1348
53-
// let sharedGeneList = node.data('intersection').sort();
54-
// let sharedGeneCount = sharedGeneList.length;
52+
let sharedGeneList = node.data('intersection').sort();
53+
let sharedGeneCount = sharedGeneList.length;
5554
let url = node.data('uri');
5655

5756
if( !this.state.descriptionLoaded ){
@@ -84,11 +83,10 @@ class EnrichmentTooltip extends React.Component {
8483
]),
8584
h('div.cy-tooltip-body', [
8685
descriptionSection,
87-
// See #1348 https://github.com/PathwayCommons/app-ui/issues/1348
88-
// h('div.cy-tooltip-section', [
89-
// h('div.cy-tooltip-field-name', 'Genes Shared with Entered List (' + sharedGeneCount + ')'),
90-
// h('div.cy-tooltip-field-value', sharedGeneList.join(', ')),
91-
// ])
86+
h('div.cy-tooltip-section', [
87+
h('div.cy-tooltip-field-name', 'Genes Shared with Entered List (' + sharedGeneCount + ')'),
88+
h('div.cy-tooltip-field-value', sharedGeneList.join(', ')),
89+
])
9290
]),
9391
h('div.cy-tooltip-call-to-action', [
9492
h('a', {

src/client/features/enrichment/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ class Enrichment extends React.Component {
4848
let { pathways } = await ServerAPI.enrichmentAPI({ query: sources}, 'analysis');
4949
let enrichmentNetwork = await ServerAPI.enrichmentAPI({ pathways }, 'visualization');
5050
let networkHasZeroNodes = enrichmentNetwork.graph.elements.nodes.length === 0;
51+
enrichmentNetwork.graph.elements.nodes.forEach( node => {
52+
const intersection = _.intersection( node.data.geneSet, sources );
53+
_.assign( node.data, { intersection } );
54+
});
5155

5256
cy.remove('*');
5357
cy.add({

0 commit comments

Comments
 (0)