Simon Hunt

Fixed bug whereby port labels did not fade in filtered views.

...@@ -211,6 +211,8 @@ ...@@ -211,6 +211,8 @@
211 function showAllLayers() { 211 function showAllLayers() {
212 network.node.classed('inactive', false); 212 network.node.classed('inactive', false);
213 network.link.classed('inactive', false); 213 network.link.classed('inactive', false);
214 + d3.selectAll('svg .port').classed('inactive', false)
215 + d3.selectAll('svg .portText').classed('inactive', false)
214 } 216 }
215 217
216 function showPacketLayer() { 218 function showPacketLayer() {
...@@ -227,6 +229,9 @@ ...@@ -227,6 +229,9 @@
227 d3.select(this).classed('inactive', true); 229 d3.select(this).classed('inactive', true);
228 } 230 }
229 }); 231 });
232 +
233 + // deactivate non-packet ports
234 + d3.selectAll('svg .optPort').classed('inactive', true)
230 } 235 }
231 236
232 function showOpticalLayer() { 237 function showOpticalLayer() {
...@@ -243,6 +248,9 @@ ...@@ -243,6 +248,9 @@
243 d3.select(this).classed('inactive', true); 248 d3.select(this).classed('inactive', true);
244 } 249 }
245 }); 250 });
251 +
252 + // deactivate non-packet ports
253 + d3.selectAll('svg .pktPort').classed('inactive', true)
246 } 254 }
247 255
248 function setUpKeyHandler() { 256 function setUpKeyHandler() {
...@@ -582,42 +590,39 @@ ...@@ -582,42 +590,39 @@
582 pw = config.labels.port.width, 590 pw = config.labels.port.width,
583 ph = config.labels.port.height; 591 ph = config.labels.port.height;
584 592
585 - network.link.filter('.infra').each(function(d, i) { 593 + network.link.filter('.infra').each(function(d) {
594 + var srcType = d.source.type === 'roadm' ? 'optPort' : 'pktPort',
595 + tgtType = d.target.type === 'roadm' ? 'optPort' : 'pktPort';
596 +
597 + if (d.source.type)
598 +
586 network.linkSrcPort.append('rect').attr({ 599 network.linkSrcPort.append('rect').attr({
587 id: 'srcPort-' + safeId(d.id), 600 id: 'srcPort-' + safeId(d.id),
588 - class: 'port', 601 + class: 'port ' + srcType,
589 width: pw, 602 width: pw,
590 height: ph, 603 height: ph,
591 - Xx: i * 20,
592 - Xy: 0,
593 rx: 4, 604 rx: 4,
594 ry: 4 605 ry: 4
595 }).style('visibility', portVis); 606 }).style('visibility', portVis);
596 607
597 network.linkTgtPort.append('rect').attr({ 608 network.linkTgtPort.append('rect').attr({
598 id: 'tgtPort-' + safeId(d.id), 609 id: 'tgtPort-' + safeId(d.id),
599 - class: 'port', 610 + class: 'port ' + tgtType,
600 width: pw, 611 width: pw,
601 height: ph, 612 height: ph,
602 - Xx: i * 20,
603 - Xy: 20,
604 rx: 4, 613 rx: 4,
605 ry: 4 614 ry: 4
606 }).style('visibility', portVis); 615 }).style('visibility', portVis);
607 616
608 network.linkSrcPort.append('text').attr({ 617 network.linkSrcPort.append('text').attr({
609 id: 'srcText-' + safeId(d.id), 618 id: 'srcText-' + safeId(d.id),
610 - class: 'portText', 619 + class: 'portText ' + srcType
611 - Xx: i * 20,
612 - Xy: 0
613 }).text(d.srcPort) 620 }).text(d.srcPort)
614 .style('visibility', portVis); 621 .style('visibility', portVis);
615 622
616 network.linkTgtPort.append('text').attr({ 623 network.linkTgtPort.append('text').attr({
617 id: 'tgtText-' + safeId(d.id), 624 id: 'tgtText-' + safeId(d.id),
618 - class: 'portText', 625 + class: 'portText ' + tgtType
619 - Xx: i * 20,
620 - Xy: 20
621 }).text(d.tgtPort) 626 }).text(d.tgtPort)
622 .style('visibility', portVis); 627 .style('visibility', portVis);
623 }); 628 });
......
...@@ -166,6 +166,8 @@ svg .node.selected circle { ...@@ -166,6 +166,8 @@ svg .node.selected circle {
166 } 166 }
167 167
168 svg .link.inactive, 168 svg .link.inactive,
169 +svg .port.inactive,
170 +svg .portText.inactive,
169 svg .node.inactive rect, 171 svg .node.inactive rect,
170 svg .node.inactive circle, 172 svg .node.inactive circle,
171 svg .node.inactive text, 173 svg .node.inactive text,
......