mirror of
				https://github.com/Telecominfraproject/oopt-gnpy-web-gui.git
				synced 2025-10-31 01:57:55 +00:00 
			
		
		
		
	Highlighted color should be uniform and with some glowing effects while selecting multiple fibers
This commit is contained in:
		| @@ -238,6 +238,13 @@ | |||||||
|     "fiber_category": "Dual Fiber", |     "fiber_category": "Dual Fiber", | ||||||
|     "width": 2, |     "width": 2, | ||||||
|     "options": { |     "options": { | ||||||
|  |       "shadow": { | ||||||
|  |         "enabled": true, | ||||||
|  |         "color": "orange", | ||||||
|  |         "size": 2, | ||||||
|  |         "x": 2, | ||||||
|  |         "y": 2 | ||||||
|  |       }, | ||||||
|       "color": { |       "color": { | ||||||
|         "color": "blue", |         "color": "blue", | ||||||
|         "highlight": "blue", |         "highlight": "blue", | ||||||
| @@ -281,6 +288,13 @@ | |||||||
|     "fiber_category": "Single Fiber", |     "fiber_category": "Single Fiber", | ||||||
|     "width": 2, |     "width": 2, | ||||||
|     "options": { |     "options": { | ||||||
|  |       "shadow": { | ||||||
|  |         "enabled": true, | ||||||
|  |         "color": "orange", | ||||||
|  |         "size": 2, | ||||||
|  |         "x": 2, | ||||||
|  |         "y": 2 | ||||||
|  |       }, | ||||||
|       "w_color": { |       "w_color": { | ||||||
|         "color": "gray", |         "color": "gray", | ||||||
|         "highlight": "gray", |         "highlight": "gray", | ||||||
| @@ -353,6 +367,13 @@ | |||||||
|     "component_type": "Service", |     "component_type": "Service", | ||||||
|     "width": 2, |     "width": 2, | ||||||
|     "options": { |     "options": { | ||||||
|  |       "shadow": { | ||||||
|  |         "enabled": true, | ||||||
|  |         "color": "orange", | ||||||
|  |         "size": 2, | ||||||
|  |         "x": 2, | ||||||
|  |         "y": 2 | ||||||
|  |       }, | ||||||
|       "color": { |       "color": { | ||||||
|         "color": "red", |         "color": "red", | ||||||
|         "highlight": "red", |         "highlight": "red", | ||||||
| @@ -398,6 +419,13 @@ | |||||||
|     "patch_category": "Single Patch", |     "patch_category": "Single Patch", | ||||||
|     "width": 2, |     "width": 2, | ||||||
|     "options": { |     "options": { | ||||||
|  |       "shadow": { | ||||||
|  |         "enabled": true, | ||||||
|  |         "color": "orange", | ||||||
|  |         "size": 2, | ||||||
|  |         "x": 2, | ||||||
|  |         "y": 2 | ||||||
|  |       }, | ||||||
|       "color": { |       "color": { | ||||||
|         "color": "black", |         "color": "black", | ||||||
|         "highlight": "black", |         "highlight": "black", | ||||||
| @@ -442,6 +470,13 @@ | |||||||
|     "patch_category": "Dual Patch", |     "patch_category": "Dual Patch", | ||||||
|     "width": 2, |     "width": 2, | ||||||
|     "options": { |     "options": { | ||||||
|  |       "shadow": { | ||||||
|  |         "enabled": true, | ||||||
|  |         "color": "orange", | ||||||
|  |         "size": 2, | ||||||
|  |         "x": 2, | ||||||
|  |         "y": 2 | ||||||
|  |       }, | ||||||
|       "color": { |       "color": { | ||||||
|         "color": "black", |         "color": "black", | ||||||
|         "highlight": "black", |         "highlight": "black", | ||||||
|   | |||||||
| @@ -276,7 +276,7 @@ function addFiberComponent(cmode, cfrom, cto, clabel, ctext, isImport) { | |||||||
|                 smooth: fiberSmooth, |                 smooth: fiberSmooth, | ||||||
|                 fiber_type: fiber_Type, span_length: span_Length, |                 fiber_type: fiber_Type, span_length: span_Length, | ||||||
|                 loss_coefficient: loss_Coefficient, connector_in: connector_IN, connector_out: connector_OUT, |                 loss_coefficient: loss_Coefficient, connector_in: connector_IN, connector_out: connector_OUT, | ||||||
|                 span_loss: span_Loss, |                 span_loss: span_Loss | ||||||
|             }); |             }); | ||||||
|  |  | ||||||
|             realUpdate(); |             realUpdate(); | ||||||
| @@ -865,7 +865,7 @@ function updateSingleFiber(fiberID) { | |||||||
|             if (fiberID.length > 1) { |             if (fiberID.length > 1) { | ||||||
|  |  | ||||||
|                 for (var i = 0; i < fiberID.length; i++) { |                 for (var i = 0; i < fiberID.length; i++) { | ||||||
|                     if (network.body.data.edges.get(fiberID[i].id).color == singleFiberJSON.options.h_color || network.body.data.edges.get(fiberID[i].id).color == singleFiberJSON.options.fh_color) { |                     if (network.body.data.edges.get(fiberID[i].id).shadow == singleFiberJSON.options.shadow) { | ||||||
|  |  | ||||||
|                         var fiber = network.body.data.edges.get(fiberID[i].id); |                         var fiber = network.body.data.edges.get(fiberID[i].id); | ||||||
|                         preUpdateList.push(fiber); |                         preUpdateList.push(fiber); | ||||||
| @@ -940,12 +940,12 @@ function clearSingleFiber() { | |||||||
| function deleteFiber(fiberList) { | function deleteFiber(fiberList) { | ||||||
|  |  | ||||||
|     removeEdgeList = []; |     removeEdgeList = []; | ||||||
|     var h_color; |     var shadow; | ||||||
|     for (var i = 0; i < fiberList.length; i++) { |     for (var i = 0; i < fiberList.length; i++) { | ||||||
|         if (fiberList.length > 1) { |         if (fiberList.length > 1) { | ||||||
|             h_color = network.body.data.edges.get(fiberList[i].id).color; |             shadow = network.body.data.edges.get(fiberList[i].id).shadow; | ||||||
|  |  | ||||||
|             if (h_color == singleFiberJSON.options.h_color || h_color == singleFiberJSON.options.fh_color) |             if (shadow == singleFiberJSON.options.shadow) | ||||||
|                 removeFiber(fiberList[i].id, true); |                 removeFiber(fiberList[i].id, true); | ||||||
|  |  | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -1058,27 +1058,22 @@ function draw(isImport) { | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             if (params.event.srcEvent.ctrlKey) { |             if (params.event.srcEvent.ctrlKey) { | ||||||
|                 var color; |                 var shadow; | ||||||
|                 if (edgeDetails.component_type == singleFiberJSON.component_type) { |                 if (edgeDetails.component_type == singleFiberJSON.component_type) { | ||||||
|                     if (edgeDetails.color == singleFiberJSON.options.h_color || edgeDetails.color == singleFiberJSON.options.fh_color) { |                     var highlight = false; | ||||||
|                         color = edgeDetails.h_color; |                     if (edgeDetails.shadow == singleFiberJSON.options.shadow) { | ||||||
|  |                         shadow = []; | ||||||
|                     } |                     } | ||||||
|                     else { |                     else { | ||||||
|                         if (edgeDetails.color == singleFiberJSON.options.w_color) |                         shadow = singleFiberJSON.options.shadow; | ||||||
|                             color = singleFiberJSON.options.h_color; |                         highlight = true; | ||||||
|                         else if (edgeDetails.color == singleFiberJSON.options.color) |  | ||||||
|                             color = singleFiberJSON.options.fh_color; |  | ||||||
|                     } |                     } | ||||||
|                 } |  | ||||||
|                 if (color) { |  | ||||||
|                     var highlight = true; |  | ||||||
|                     if (color == singleFiberJSON.options.color || color == singleFiberJSON.options.w_color) |  | ||||||
|                         highlight = false; |  | ||||||
|  |  | ||||||
|                     network.body.data.edges.update({ |                     network.body.data.edges.update({ | ||||||
|                         id: edgeDetails.id, color: color, h_color: edgeDetails.color, is_highlight: highlight |                         id: edgeDetails.id, shadow: shadow, is_highlight: highlight | ||||||
|                     }); |                     }); | ||||||
|                 } |                 } | ||||||
|  |                  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| @@ -3418,7 +3413,7 @@ function remove_NodeFiberHighlight() { | |||||||
|     }); |     }); | ||||||
|     for (var i = 0; i < hEdges.length; i++) { |     for (var i = 0; i < hEdges.length; i++) { | ||||||
|         network.body.data.edges.update({ |         network.body.data.edges.update({ | ||||||
|             id: hEdges[i].id, color: hEdges[i].h_color, h_color: hEdges[i].color, is_highlight: false |             id: hEdges[i].id, shadow: [], is_highlight: false | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Reference in New Issue
	
	Block a user
	 sakv2e10204
					sakv2e10204