Skip to content

Commit db711fa

Browse files
author
Oskar Howe
committed
merge: Merge branch 'OHOW/highlight_adj_edges_III'
2 parents fb5d5c4 + 0d83459 commit db711fa

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/charts/CytoViz/CytoViz.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,15 @@ export const CytoViz = (props) => {
9797
cytoscapeRef.removeAllListeners();
9898
// Prevent multiple selection & init elements selection behavior
9999
cytoscapeRef.on('select', 'node, edge', function (e) {
100-
cytoscapeRef.elements().not(e.target).unselect();
100+
cytoscapeRef.edges().data({ asInEdgeHighlighted: false, asOutEdgeHighlighted: false });
101101
const selectedElement = e.target;
102+
selectedElement.select();
103+
selectedElement.outgoers('edge').data('asOutEdgeHighlighted', true);
104+
selectedElement.incomers('edge').data('asInEdgeHighlighted', true);
102105
setCurrentElementDetails(getElementDetailsCallback(selectedElement));
103106
});
104107
cytoscapeRef.on('unselect', 'node, edge', function (e) {
108+
cytoscapeRef.edges().data({ asInEdgeHighlighted: false, asOutEdgeHighlighted: false });
105109
setCurrentElementDetails(null);
106110
});
107111
// Add handling of double click events

src/charts/CytoViz/components/ElementData/ElementData.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ import useStyles from './style';
77

88
const _generateAttributeDetails = (classes, labels, attributeName, attributeValue) => {
99
const attributeLabel = labels?.attributes?.[attributeName] || attributeName;
10-
const attributesToIgnore = ['label', 'Label', 'parent', 'source', 'target'];
10+
const attributesToIgnore = [
11+
'label',
12+
'Label',
13+
'parent',
14+
'source',
15+
'target',
16+
'asOutEdgeHighlighted',
17+
'asInEdgeHighlighted',
18+
];
1119
if (attributesToIgnore.indexOf(attributeName) !== -1) {
1220
return null;
1321
}

0 commit comments

Comments
 (0)