Skip to content

Commit

Permalink
also impact edges when hovering node colors legend (closes #482)
Browse files Browse the repository at this point in the history
  • Loading branch information
boogheta committed Aug 30, 2023
1 parent c531b54 commit 69962ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hyphe_frontend/app/components/webentitiesNetworkWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,23 @@ angular.module('hyphe.webentitiesNetworkWidgetComponent', [])
$scope.highlightGroup = function(selection) {
if ($scope.nodeColorMode === '')
return

var keptNodes = {};
g.forEachNode(function(nid, attrs){
var val = attrs.status
if ($scope.nodeColorMode !== '_webentitystatus')
val = (((attrs.tags || {}).USER || {})[$scope.nodeColorMode] || [""])[0];
g.setNodeAttribute(nid, 'color', val === selection ? attrs.color : "rgba(0,0,0, 0.15)")
if (val === selection) keptNodes[nid] = true;
g.setNodeAttribute(nid, 'color', val === selection ? attrs.color : "#E9E9E9")
})
g.forEachEdge(function(e, attrs, n1, n2) {
g.setEdgeAttribute(e, 'color', keptNodes[n1] || keptNodes[n2] ? attrs.color : "#F9F9F9");
})
}

$scope.resetHighlight = function() {
updateNodeColors();
setEdgesToGrey();
}

// Init
Expand Down

0 comments on commit 69962ed

Please sign in to comment.