This commit is contained in:
Fine 2022-08-25 11:40:53 +08:00
parent a68f55f281
commit 8d74554639

View File

@ -69,25 +69,25 @@ export const anchorElement = (graph: any, funcs: any, tip: any) => {
.attr("text-anchor", "middle") .attr("text-anchor", "middle")
.attr("x", (d: Call) => { .attr("x", (d: Call) => {
const p = getMidpoint(d); const p = getMidpoint(d);
return p[0] + 2; return p[0] + 10;
}) })
.attr("y", (d: Call) => { .attr("y", (d: Call) => {
const p = getMidpoint(d); const p = getMidpoint(d);
return p[1] + 5; return p[1] + 3;
}) })
.text((d: Call) => { .text((d: Call) => {
const types = [...d.sourceComponents, ...d.targetComponents]; const types = [...d.sourceComponents, ...d.targetComponents];
if (types.includes("tcp")) { if (types.includes("tcp")) {
return "tcp"; return "TCP";
} }
if (types.includes("https")) { if (types.includes("https")) {
return "https"; return "HTTPS";
} }
if (types.includes("http")) { if (types.includes("http")) {
return "http"; return "HTTP";
} }
if (types.includes("tls")) { if (types.includes("tls")) {
return "tls"; return "TLS";
} }
}); });
linkEnter linkEnter
@ -96,11 +96,11 @@ export const anchorElement = (graph: any, funcs: any, tip: any) => {
.attr("height", 15) .attr("height", 15)
.attr("x", (d: Call) => { .attr("x", (d: Call) => {
const p = getMidpoint(d); const p = getMidpoint(d);
return p[0] - 6; return p[0] - 16;
}) })
.attr("y", (d: Call) => { .attr("y", (d: Call) => {
const p = getMidpoint(d); const p = getMidpoint(d);
return p[1] - 16; return p[1] - 9;
}) })
.attr("xlink:href", (d: Call) => { .attr("xlink:href", (d: Call) => {
const types = [...d.sourceComponents, ...d.targetComponents]; const types = [...d.sourceComponents, ...d.targetComponents];