From 6b60d36094d76ca2a1197f283f11631d42a20d7f Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 5 Apr 2016 14:38:22 +0200 Subject: [PATCH] Improve the colors. --- .../include/javascript/map/MapController.js | 17 ++++++++++++++--- .../javascript/map/NetworkmapController.js | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index e6d3c28aff..0f6fd563d0 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -2236,27 +2236,38 @@ MapController.prototype.select_node = function(node_id, type) { case 'over': d3.select(self._target + " #node_" + node_id) .classed("over", true); + + var over_color = + d3.rgb( + d3.select(self._target + " #node_" + node_id) + .style("fill")) + .brighter(1).toString(); + if (d3.select(self._target + " #node_" + node_id) .classed("select")) { d3.select(self._target + " #node_" + node_id) - .attr("style", "fill: rgb(128, 128, 50);"); + .style("fill", over_color); data = "select over"; } else { d3.select(self._target + " #node_" + node_id) - .attr("style", "fill: rgb(128, 50, 50);"); + .style("fill", over_color); data = "over"; } break; case 'off': + var status_color = d3 + .select(self._target + " #node_" + node_id) + .attr("data-status_color"); + d3.select(self._target + " #node_" + node_id) .classed("select", false); d3.select(self._target + " #node_" + node_id) - .attr("style", "fill: rgb(50, 50, 128);"); + .style("fill", status_color); break; } diff --git a/pandora_console/include/javascript/map/NetworkmapController.js b/pandora_console/include/javascript/map/NetworkmapController.js index 3d575ad5ff..eb31c609d4 100644 --- a/pandora_console/include/javascript/map/NetworkmapController.js +++ b/pandora_console/include/javascript/map/NetworkmapController.js @@ -391,7 +391,8 @@ NetworkmapController.prototype.paint_node = function(g_node, node) { .attr("style", "fill: rgb(50, 50, 128);") .attr("data-id", node['id']) .attr("data-graph_id", node['graph_id']) - .attr("data-type", node['type']); + .attr("data-type", node['type']) + .attr("data-status_color", node['color']); switch (node['shape']) { case 'rect':