Showing
2 changed files
with
20 additions
and
16 deletions
... | @@ -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 | }); | ... | ... |
... | @@ -93,7 +93,6 @@ svg .link { | ... | @@ -93,7 +93,6 @@ svg .link { |
93 | stroke: #666; | 93 | stroke: #666; |
94 | stroke-width: 2.0px; | 94 | stroke-width: 2.0px; |
95 | opacity: .7; | 95 | opacity: .7; |
96 | - /*marker-end: url(#end);*/ | ||
97 | 96 | ||
98 | transition: opacity 250ms; | 97 | transition: opacity 250ms; |
99 | -webkit-transition: opacity 250ms; | 98 | -webkit-transition: opacity 250ms; |
... | @@ -110,7 +109,6 @@ svg g.portLayer rect.port { | ... | @@ -110,7 +109,6 @@ svg g.portLayer rect.port { |
110 | } | 109 | } |
111 | 110 | ||
112 | svg g.portLayer text { | 111 | svg g.portLayer text { |
113 | - Xstroke: #fff; | ||
114 | font: 8pt sans-serif; | 112 | font: 8pt sans-serif; |
115 | pointer-events: none; | 113 | pointer-events: none; |
116 | } | 114 | } |
... | @@ -126,7 +124,6 @@ svg .node.device rect { | ... | @@ -126,7 +124,6 @@ svg .node.device rect { |
126 | svg .node.device.fixed rect { | 124 | svg .node.device.fixed rect { |
127 | stroke-width: 1.5; | 125 | stroke-width: 1.5; |
128 | stroke: #ccc; | 126 | stroke: #ccc; |
129 | - Xstroke-dasharray: 4,2; | ||
130 | } | 127 | } |
131 | 128 | ||
132 | svg .node.device.roadm rect { | 129 | svg .node.device.roadm rect { |
... | @@ -166,6 +163,8 @@ svg .node.selected circle { | ... | @@ -166,6 +163,8 @@ svg .node.selected circle { |
166 | } | 163 | } |
167 | 164 | ||
168 | svg .link.inactive, | 165 | svg .link.inactive, |
166 | +svg .port.inactive, | ||
167 | +svg .portText.inactive, | ||
169 | svg .node.inactive rect, | 168 | svg .node.inactive rect, |
170 | svg .node.inactive circle, | 169 | svg .node.inactive circle, |
171 | svg .node.inactive text, | 170 | svg .node.inactive text, | ... | ... |
-
Please register or login to post a comment