GUI -- TopoView - re-instated selection "glow" - themed (blue for light theme, y…
…ellow for dark theme). Change-Id: I3994d22889285547688429e490f6fa73ae4c768a
Showing
3 changed files
with
47 additions
and
13 deletions
... | @@ -125,15 +125,42 @@ | ... | @@ -125,15 +125,42 @@ |
125 | } | 125 | } |
126 | }); | 126 | }); |
127 | 127 | ||
128 | - return drag; } | 128 | + return drag; |
129 | + } | ||
130 | + | ||
131 | + | ||
132 | + function loadGlow(defs, r, g, b, id) { | ||
133 | + var glow = defs.append('filter') | ||
134 | + .attr('x', '-50%') | ||
135 | + .attr('y', '-50%') | ||
136 | + .attr('width', '200%') | ||
137 | + .attr('height', '200%') | ||
138 | + .attr('id', id); | ||
139 | + | ||
140 | + glow.append('feColorMatrix') | ||
141 | + .attr('type', 'matrix') | ||
142 | + .attr('values', | ||
143 | + '0 0 0 0 ' + r + ' ' + | ||
144 | + '0 0 0 0 ' + g + ' ' + | ||
145 | + '0 0 0 0 ' + b + ' ' + | ||
146 | + '0 0 0 1 0 '); | ||
147 | + | ||
148 | + glow.append('feGaussianBlur') | ||
149 | + .attr('stdDeviation', 3) | ||
150 | + .attr('result', 'coloredBlur'); | ||
151 | + | ||
152 | + glow.append('feMerge').selectAll('feMergeNode') | ||
153 | + .data(['coloredBlur', 'SourceGraphic']) | ||
154 | + .enter().append('feMergeNode') | ||
155 | + .attr('in', String); | ||
156 | + } | ||
129 | 157 | ||
130 | - function loadGlow() { | 158 | + function loadGlowDefs(defs) { |
131 | - $log.warn('SvgUtilService: loadGlow -- To Be Implemented'); | 159 | + loadGlow(defs, 0.0, 0.0, 0.7, 'blue-glow'); |
160 | + loadGlow(defs, 1.0, 1.0, 0.3, 'yellow-glow'); | ||
132 | } | 161 | } |
133 | 162 | ||
134 | // --- Ordinal scales for 7 values. | 163 | // --- Ordinal scales for 7 values. |
135 | - // TODO: tune colors for light and dark themes | ||
136 | - // Note: These colors look good on the white background. Still, need to tune for dark. | ||
137 | 164 | ||
138 | // blue brown brick red sea green purple dark teal lime | 165 | // blue brown brick red sea green purple dark teal lime |
139 | var lightNorm = ['#3E5780', '#78533B', '#CB4D28', '#018D61', '#8A2979', '#006D73', '#56AF00'], | 166 | var lightNorm = ['#3E5780', '#78533B', '#CB4D28', '#018D61', '#8A2979', '#006D73', '#56AF00'], |
... | @@ -249,7 +276,7 @@ | ... | @@ -249,7 +276,7 @@ |
249 | 276 | ||
250 | return { | 277 | return { |
251 | createDragBehavior: createDragBehavior, | 278 | createDragBehavior: createDragBehavior, |
252 | - loadGlow: loadGlow, | 279 | + loadGlowDefs: loadGlowDefs, |
253 | cat7: cat7, | 280 | cat7: cat7, |
254 | translate: translate, | 281 | translate: translate, |
255 | stripPx: stripPx, | 282 | stripPx: stripPx, | ... | ... |
... | @@ -290,9 +290,11 @@ | ... | @@ -290,9 +290,11 @@ |
290 | #topo-p-instance .onosInst.mastership.affinity { | 290 | #topo-p-instance .onosInst.mastership.affinity { |
291 | opacity: 1.0; | 291 | opacity: 1.0; |
292 | } | 292 | } |
293 | -#topo-p-instance .onosInst.mastership.affinity svg rect { | 293 | +.light #topo-p-instance .onosInst.mastership.affinity svg rect { |
294 | - /* TODO: add blue glow */ | 294 | + filter: url(#blue-glow); |
295 | - /*filter: url(#blue-glow);*/ | 295 | +} |
296 | +.dark #topo-p-instance .onosInst.mastership.affinity svg rect { | ||
297 | + filter: url(#yellow-glow); | ||
296 | } | 298 | } |
297 | 299 | ||
298 | 300 | ||
... | @@ -302,11 +304,15 @@ | ... | @@ -302,11 +304,15 @@ |
302 | cursor: pointer; | 304 | cursor: pointer; |
303 | } | 305 | } |
304 | 306 | ||
305 | -#ov-topo svg .node.selected rect, | 307 | +.light #ov-topo svg .node.selected rect, |
306 | -#ov-topo svg .node.selected circle { | 308 | +.light #ov-topo svg .node.selected circle { |
309 | + fill: #f90; | ||
310 | + filter: url(#blue-glow); | ||
311 | +} | ||
312 | +.dark #ov-topo svg .node.selected rect, | ||
313 | +.dark #ov-topo svg .node.selected circle { | ||
307 | fill: #f90; | 314 | fill: #f90; |
308 | - /* TODO: add blue glow filter */ | 315 | + filter: url(#yellow-glow); |
309 | - /*filter: url(#blue-glow);*/ | ||
310 | } | 316 | } |
311 | 317 | ||
312 | #ov-topo svg .node text { | 318 | #ov-topo svg .node text { | ... | ... |
-
Please register or login to post a comment