Simon Hunt
Committed by Gerrit Code Review

GUI -- TopoView - Changed link "enhancement" to be addition of glow filter via 'enhanced' CSS class.

- removed unnecessary properties of link data object (delegate to source and target for endpoints).
- removed feature envy for existing links.

Change-Id: I9f96792d5665665a3467e419d80803e1b0db389b
......@@ -432,6 +432,13 @@
opacity: .9;
}
.light #ov-topo svg .link.enhanced {
filter: url(#blue-glow);
}
.dark #ov-topo svg .link.enhanced {
filter: url(#yellow-glow);
}
#ov-topo svg .link.inactive {
opacity: .5;
stroke-dasharray: 8 4;
......
......@@ -332,15 +332,6 @@
// ==========================
// updateLinks - subfunctions
function linkExisting(d) {
// this is supposed to be an existing link, but we have observed
// occasions (where links are deleted and added rapidly?) where
// the DOM element has not been defined. So protection against that...
if (d.el) {
api.restyleLinkElement(d, true);
}
}
function linkEntering(d) {
var link = d3.select(this);
d.el = link;
......@@ -466,7 +457,6 @@
hostExit: hostExit,
deviceExit: deviceExit,
linkExisting: linkExisting,
linkEntering: linkEntering,
applyLinkLabels: applyLinkLabels,
......
......@@ -508,16 +508,23 @@
.data(network.links, function (d) { return d.key; });
// operate on existing links:
link.each(td3.linkExisting);
link.each(function (d) {
// this is supposed to be an existing link, but we have observed
// occasions (where links are deleted and added rapidly?) where
// the DOM element has not been defined. So protect against that...
if (d.el) {
restyleLinkElement(d, true);
}
});
// operate on entering links:
var entering = link.enter()
.append('line')
.attr({
x1: function (d) { return d.x1; },
y1: function (d) { return d.y1; },
x2: function (d) { return d.x2; },
y2: function (d) { return d.y2; },
x1: function (d) { return d.source.x; },
y1: function (d) { return d.source.y; },
x2: function (d) { return d.target.x; },
y2: function (d) { return d.target.y; },
stroke: linkConfig[th].inColor,
'stroke-width': linkConfig.inWidth
});
......
......@@ -189,12 +189,12 @@
}
function unenhance(d) {
d.el.style('stroke', '#666');
d.el.classed('enhanced', false);
$log.debug('UN-enhancing link: ', d.key);
}
function enhance(d) {
d.el.style('stroke', 'gold');
d.el.classed('enhanced', true);
$log.debug('enhancing link: ', d.key);
}
......
......@@ -219,10 +219,6 @@
return {
source: srcNode,
target: dstNode,
x1: srcNode.x,
y1: srcNode.y,
x2: dstNode.x,
y2: dstNode.y
};
}
......