GUI - Converted Instances to use Glyph icons instead of png's.
Change-Id: I6a2e04135eea29e3baad32c7cfc36e8e34ee3b10
Showing
2 changed files
with
42 additions
and
8 deletions
... | @@ -32,6 +32,7 @@ | ... | @@ -32,6 +32,7 @@ |
32 | 32 | ||
33 | /* TODO: move glyphs into framework */ | 33 | /* TODO: move glyphs into framework */ |
34 | 34 | ||
35 | +#topo-oibox svg .glyphIcon, | ||
35 | #topo svg .glyphIcon { | 36 | #topo svg .glyphIcon { |
36 | fill: black; | 37 | fill: black; |
37 | stroke: none; | 38 | stroke: none; |
... | @@ -269,11 +270,24 @@ svg .node.host circle { | ... | @@ -269,11 +270,24 @@ svg .node.host circle { |
269 | color: black; | 270 | color: black; |
270 | } | 271 | } |
271 | 272 | ||
272 | -#topo-oibox .onosInst img { | 273 | +#topo-oibox .onosInst svg .glyphIcon { |
273 | opacity: 0.5; | 274 | opacity: 0.5; |
274 | - padding: 3px; | 275 | + fill: black; |
276 | + stroke: none; | ||
277 | + fill-rule: evenodd; | ||
278 | +} | ||
279 | +#topo-oibox .onosInst.online svg .glyphIcon { | ||
280 | + opacity: 1; | ||
281 | + fill: black; | ||
282 | + stroke: none; | ||
283 | + fill-rule: evenodd; | ||
275 | } | 284 | } |
276 | 285 | ||
286 | +/*#topo-oibox .onosInst img {*/ | ||
287 | + /*opacity: 0.5;*/ | ||
288 | + /*padding: 3px;*/ | ||
289 | +/*}*/ | ||
290 | + | ||
277 | #topo-oibox .onosInst.online img { | 291 | #topo-oibox .onosInst.online img { |
278 | opacity: 1.0; | 292 | opacity: 1.0; |
279 | padding: 3px; | 293 | padding: 3px; | ... | ... |
... | @@ -74,7 +74,7 @@ | ... | @@ -74,7 +74,7 @@ |
74 | linkInColor: '#66f', | 74 | linkInColor: '#66f', |
75 | linkInWidth: 14, | 75 | linkInWidth: 14, |
76 | linkOutColor: '#f00', | 76 | linkOutColor: '#f00', |
77 | - linkOutWidth: 30 | 77 | + linkOutWidth: 14 |
78 | }, | 78 | }, |
79 | icons: { | 79 | icons: { |
80 | w: 30, | 80 | w: 30, |
... | @@ -885,6 +885,9 @@ | ... | @@ -885,6 +885,9 @@ |
885 | }); | 885 | }); |
886 | } | 886 | } |
887 | 887 | ||
888 | + function stripPx(s) { | ||
889 | + return s.replace(/px$/,''); | ||
890 | + } | ||
888 | // ============================== | 891 | // ============================== |
889 | // onos instance panel functions | 892 | // onos instance panel functions |
890 | 893 | ||
... | @@ -904,12 +907,29 @@ | ... | @@ -904,12 +907,29 @@ |
904 | entering.each(function (d, i) { | 907 | entering.each(function (d, i) { |
905 | var el = d3.select(this), | 908 | var el = d3.select(this), |
906 | img; | 909 | img; |
910 | + var css = window.getComputedStyle(this), | ||
911 | + w = stripPx(css.width), | ||
912 | + h = stripPx(css.height) / 2; | ||
907 | 913 | ||
908 | - $('<img src="img/node.png">').appendTo(el); | 914 | + var svg = el.append('svg').attr({ |
909 | - img = el.select('img') | 915 | + width: w, |
910 | - .attr({ | 916 | + height: h |
911 | - width: 30 | 917 | + }); |
912 | - }); | 918 | + var dim = 30; |
919 | + svg.append('use').attr({ | ||
920 | + class: 'glyphIcon', | ||
921 | + transform: translate(2,2), | ||
922 | + 'xlink:href': '#node', | ||
923 | + width: dim, | ||
924 | + height: dim | ||
925 | + | ||
926 | + }); | ||
927 | + | ||
928 | + //$('<img src="img/node.png">').appendTo(el); | ||
929 | + //img = el.select('img') | ||
930 | + // .attr({ | ||
931 | + // width: 30 | ||
932 | + // }); | ||
913 | 933 | ||
914 | $('<div>').attr('class', 'onosTitle').text(d.id).appendTo(el); | 934 | $('<div>').attr('class', 'onosTitle').text(d.id).appendTo(el); |
915 | 935 | ... | ... |
-
Please register or login to post a comment