Improve the colors.

This commit is contained in:
mdtrooper 2016-04-05 14:38:22 +02:00
parent 20a5b55977
commit 6b60d36094
2 changed files with 16 additions and 4 deletions

View File

@ -2236,27 +2236,38 @@ MapController.prototype.select_node = function(node_id, type) {
case 'over': case 'over':
d3.select(self._target + " #node_" + node_id) d3.select(self._target + " #node_" + node_id)
.classed("over", true); .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) if (d3.select(self._target + " #node_" + node_id)
.classed("select")) { .classed("select")) {
d3.select(self._target + " #node_" + node_id) d3.select(self._target + " #node_" + node_id)
.attr("style", "fill: rgb(128, 128, 50);"); .style("fill", over_color);
data = "select over"; data = "select over";
} }
else { else {
d3.select(self._target + " #node_" + node_id) d3.select(self._target + " #node_" + node_id)
.attr("style", "fill: rgb(128, 50, 50);"); .style("fill", over_color);
data = "over"; data = "over";
} }
break; break;
case 'off': case 'off':
var status_color = d3
.select(self._target + " #node_" + node_id)
.attr("data-status_color");
d3.select(self._target + " #node_" + node_id) d3.select(self._target + " #node_" + node_id)
.classed("select", false); .classed("select", false);
d3.select(self._target + " #node_" + node_id) d3.select(self._target + " #node_" + node_id)
.attr("style", "fill: rgb(50, 50, 128);"); .style("fill", status_color);
break; break;
} }

View File

@ -391,7 +391,8 @@ NetworkmapController.prototype.paint_node = function(g_node, node) {
.attr("style", "fill: rgb(50, 50, 128);") .attr("style", "fill: rgb(50, 50, 128);")
.attr("data-id", node['id']) .attr("data-id", node['id'])
.attr("data-graph_id", node['graph_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']) { switch (node['shape']) {
case 'rect': case 'rect':