If ever you haven't found the solution to highlight children of a node when mouse hover one, here is my attempt and it works nice:
Event handler:
cy.on('mouseover', 'node', function(e){
var sel = e.target;
cy.elements().difference(sel.outgoers()).not(sel).addClass('semitransp');
sel.addClass('highlight').outgoers().addClass('highlight');
});
cy.on('mouseout', 'node', function(e){
var sel = e.target;
cy.elements().removeClass('semitransp');
sel.removeClass('highlight').outgoers().removeClass('highlight');
});
Basically, all elements are filtered if they're not the hovered node or its direct children ("outgoers") and the class 'semitransp' is added to them.
Then, the class 'highlight' is added to the hovered node and all its children.
Example of style for 'highlight' and 'semitransp' class:
var cy = cytoscape({
elements: [ {...} ]
style: [
{...},
{
selector: 'node.highlight',
style: {
'border-color': '#FFF',
'border-width': '2px'
}
},
{
selector: 'node.semitransp',
style:{ 'opacity': '0.5' }
},
{
selector: 'edge.highlight',
style: { 'mid-target-arrow-color': '#FFF' }
},
{
selector: 'edge.semitransp',
style:{ 'opacity': '0.2' }
}
]
});