@@ -310,7 +310,7 @@ var TopologyGraphLayout = function(vm, selector) {
310310 let id = "arrowhead-" + label ;
311311 defsMarker ( id , marker_refX , marker_refY , marker_black , marker_arrow ) ;
312312 }
313-
313+
314314 networkpolicyMarker ( "ingress" , "deny" , "begin" ) ;
315315 networkpolicyMarker ( "ingress" , "deny" , "end" ) ;
316316 networkpolicyMarker ( "ingress" , "allow" , "begin" ) ;
@@ -812,7 +812,7 @@ TopologyGraphLayout.prototype = {
812812 }
813813 }
814814
815- if ( node . metadata . Capture && node . metadata . Capture . State === "active" &&
815+ if ( node . metadata . Capture && node . metadata . Capture . State === "active" &&
816816 ( ! node . _metadata . Capture || node . _metadata . Capture . State !== "active" ) ) {
817817 this . captureStarted ( node ) ;
818818 } else if ( ! node . metadata . Capture && node . _metadata . Capture ) {
@@ -1518,19 +1518,15 @@ TopologyGraphLayout.prototype = {
15181518 . classed ( "link-label-alert" , function ( d ) { return d . alert ; } )
15191519 . text ( function ( d ) { return d . text ; } ) ;
15201520
1521- this . linkLabel . each ( function ( d ) {
1521+ enter . each ( function ( d ) {
15221522 self . g . select ( "#link-" + d . link . id )
15231523 . classed ( "link-label-active" , d . active )
15241524 . classed ( "link-label-warning" , d . warning )
15251525 . classed ( "link-label-alert" , d . alert )
15261526 . style ( "stroke-dasharray" , self . styleStrokeDasharray ( d ) )
15271527 . style ( "stroke-dashoffset" , self . styleStrokeDashoffset ( d ) )
1528- . style ( "animation" , self . styleAnimation ( d ) )
15291528 . style ( "stroke" , self . styleStroke ( d ) ) ;
15301529 } ) ;
1531-
1532- // force a tick
1533- this . tick ( ) ;
15341530 } ,
15351531
15361532 delLinkLabel : function ( link ) {
@@ -1656,6 +1652,9 @@ TopologyGraphLayout.prototype = {
16561652 . attr ( "class" , this . linkWrapClass )
16571653 . attr ( "marker-end" , function ( d ) { return self . arrowhead ( d . link ) ; } ) ;
16581654
1655+ linkWrapEnter . filter ( function ( d ) { return d . _emphasized ; } )
1656+ . each ( this . emphasizeEdge . bind ( this ) ) ;
1657+
16591658 this . linkWrap = linkWrapEnter . merge ( this . linkWrap ) ;
16601659
16611660 this . group = this . group . data ( this . groups , function ( d ) { return d . id ; } ) ;
@@ -1674,7 +1673,7 @@ TopologyGraphLayout.prototype = {
16741673 } ,
16751674
16761675 highlightLink : function ( d ) {
1677- if ( d . collapse ) return ;
1676+ if ( d . collapse || d . _emphasized ) return ;
16781677 var t = d3 . transition ( )
16791678 . duration ( 300 )
16801679 . ease ( d3 . easeLinear ) ;
@@ -1683,7 +1682,7 @@ TopologyGraphLayout.prototype = {
16831682 } ,
16841683
16851684 unhighlightLink : function ( d ) {
1686- if ( d . collapse ) return ;
1685+ if ( d . collapse || d . _emphasized ) return ;
16871686 var t = d3 . transition ( )
16881687 . duration ( 300 )
16891688 . ease ( d3 . easeLinear ) ;
@@ -1724,6 +1723,8 @@ TopologyGraphLayout.prototype = {
17241723 emphasizeNodeID : function ( id ) {
17251724 var self = this ;
17261725
1726+ if ( ! ( id in this . nodes ) && ! ( id in this . _nodes ) ) return ;
1727+
17271728 if ( id in this . nodes ) this . nodes [ id ] . _emphasized = true ;
17281729 if ( id in this . _nodes ) this . _nodes [ id ] . _emphasized = true ;
17291730
@@ -1741,17 +1742,52 @@ TopologyGraphLayout.prototype = {
17411742 . attr ( "r" , function ( d ) { return self . nodeSize ( d ) + 8 ; } ) ;
17421743 } ,
17431744
1744- deemphasizeNodeID : function ( id ) {
1745+ emphasizeEdgeID : function ( id ) {
1746+ var self = this ;
1747+
1748+ if ( ! ( id in this . links ) && ! ( id in this . _links ) ) return ;
1749+
1750+ if ( id in this . links ) this . links [ id ] . _emphasized = true ;
1751+ if ( id in this . _links ) this . _links [ id ] . _emphasized = true ;
1752+
1753+ var t = d3 . transition ( )
1754+ . duration ( 300 )
1755+ . ease ( d3 . easeLinear ) ;
1756+
1757+ this . g . select ( "#link-wrap-" + id ) . transition ( t ) . style ( "stroke" , "rgba(25, 251, 104, 0.50)" ) ;
1758+ this . g . select ( "#link-" + id ) . transition ( t ) . style ( "stroke-width" , 2 ) ;
1759+ } ,
1760+
1761+ emphasizeID : function ( id ) {
1762+ this . emphasizeNodeID ( id ) ;
1763+ this . emphasizeEdgeID ( id ) ;
1764+ } ,
1765+
1766+ deemphasizeID : function ( id ) {
17451767 if ( id in this . nodes ) this . nodes [ id ] . _emphasized = false ;
17461768 if ( id in this . _nodes ) this . _nodes [ id ] . _emphasized = false ;
17471769
1770+ if ( id in this . links ) this . links [ id ] . _emphasized = false ;
1771+ if ( id in this . _links ) this . _links [ id ] . _emphasized = false ;
1772+
17481773 this . g . select ( "#node-emphasize-" + id ) . remove ( ) ;
1774+
1775+ var t = d3 . transition ( )
1776+ . duration ( 300 )
1777+ . ease ( d3 . easeLinear ) ;
1778+
1779+ this . g . select ( "#link-wrap-" + id ) . transition ( t ) . style ( "stroke" , null ) ;
1780+ this . g . select ( "#link-" + id ) . transition ( t ) . style ( "stroke-width" , null ) ;
17491781 } ,
17501782
17511783 emphasizeNode : function ( d ) {
17521784 this . emphasizeNodeID ( d . id ) ;
17531785 } ,
17541786
1787+ emphasizeEdge : function ( d ) {
1788+ this . emphasizeEdgeID ( d . id ) ;
1789+ } ,
1790+
17551791 nodeClass : function ( d ) {
17561792 var clazz = "node " + d . metadata . Type ;
17571793
0 commit comments