[TASK] Fastd lines and gravity
This commit is contained in:
parent
10356c59ea
commit
bbed795188
@ -349,7 +349,7 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
ctx.moveTo(d.source.x + dx * nodeRadius, d.source.y + dy * nodeRadius);
|
ctx.moveTo(d.source.x + dx * nodeRadius, d.source.y + dy * nodeRadius);
|
||||||
ctx.lineTo(d.target.x - dx * nodeRadius, d.target.y - dy * nodeRadius);
|
ctx.lineTo(d.target.x - dx * nodeRadius, d.target.y - dy * nodeRadius);
|
||||||
ctx.strokeStyle = d.o.type === "Kabel" ? cableColor : d.color;
|
ctx.strokeStyle = d.o.type === "Kabel" ? cableColor : d.color;
|
||||||
ctx.globalAlpha = d.o.type === "fastd" || d.o.type === "L2TP" ? 0.1 : 0.8;
|
ctx.globalAlpha = d.o.type === "fastd" || d.o.type === "L2TP" ? 0.2 : 0.8;
|
||||||
ctx.lineWidth = d.o.type === "fastd" || d.o.type === "L2TP" ? 1.5 : 2.5;
|
ctx.lineWidth = d.o.type === "fastd" || d.o.type === "L2TP" ? 1.5 : 2.5;
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
});
|
});
|
||||||
@ -619,7 +619,7 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
})
|
})
|
||||||
.linkStrength(function (d) {
|
.linkStrength(function (d) {
|
||||||
if (d.o.type === "fastd" || d.o.type === "L2TP") {
|
if (d.o.type === "fastd" || d.o.type === "L2TP") {
|
||||||
return 0;
|
return 0.02;
|
||||||
} else {
|
} else {
|
||||||
return Math.max(0.5, 1 / d.o.tq);
|
return Math.max(0.5, 1 / d.o.tq);
|
||||||
}
|
}
|
||||||
@ -674,12 +674,7 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
e.o = d;
|
e.o = d;
|
||||||
e.source = newNodesDict[d.source.id];
|
e.source = newNodesDict[d.source.id];
|
||||||
e.target = newNodesDict[d.target.id];
|
e.target = newNodesDict[d.target.id];
|
||||||
|
e.color = linkScale(d.tq).hex();
|
||||||
if (d.type === "fastd" || d.type === "L2TP") {
|
|
||||||
e.color = "rgba(255, 255, 255, " + (0.6 / d.tq) + ")";
|
|
||||||
} else {
|
|
||||||
e.color = linkScale(d.tq).hex();
|
|
||||||
}
|
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
});
|
});
|
||||||
@ -722,15 +717,6 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
d.labelB = offset + buffer.height / (2 * scale);
|
d.labelB = offset + buffer.height / (2 * scale);
|
||||||
});
|
});
|
||||||
|
|
||||||
intLinks.forEach(function (d) {
|
|
||||||
d.source.neighbours[d.target.o.id] = {node: d.target, link: d};
|
|
||||||
d.target.neighbours[d.source.o.id] = {node: d.source, link: d};
|
|
||||||
|
|
||||||
if (d.o.source && d.o.target) {
|
|
||||||
linksDict[d.o.id] = d;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
intNodes.forEach(function (d) {
|
intNodes.forEach(function (d) {
|
||||||
d.neighbours = Object.keys(d.neighbours).map(function (k) {
|
d.neighbours = Object.keys(d.neighbours).map(function (k) {
|
||||||
return d.neighbours[k];
|
return d.neighbours[k];
|
||||||
|
@ -114,15 +114,8 @@ define(["moment", "router", "leaflet", "gui", "helper", "moment.de"],
|
|||||||
});
|
});
|
||||||
|
|
||||||
links.forEach(function (d) {
|
links.forEach(function (d) {
|
||||||
if (d.type === "tunnel" || d.type === "fastd") {
|
if (d.target.node.flags.gateway === true || (d.source.node !== undefined && d.source.node.flags.gateway === true)) {
|
||||||
d.type = "fastd";
|
d.type = "fastd";
|
||||||
} else if (d.type === "l2tp") {
|
|
||||||
d.type = "L2TP";
|
|
||||||
d.target.node.flags.uplink = true;
|
|
||||||
} else if (d.type === "wireless") {
|
|
||||||
d.type = "Wifi";
|
|
||||||
} else if (d.type === "other") {
|
|
||||||
d.type = "Kabel";
|
|
||||||
} else {
|
} else {
|
||||||
d.type = "N/A";
|
d.type = "N/A";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user