highlight args when click input/output

This commit is contained in:
codetypes committed 2025-03-16 22:46:34 +08:00
1 parent b9345c6706
commit fea5e0cad8
4 files changed
+87 -19

No files matched your search

+15 -1
View File
@@ -351,6 +351,19 @@ G6.registerNode(
const args: any = data.args;
if (nodeDef.args && args && Object.keys(args).length > 0) {
const { str, line } = toBreakWord(`${i18n.t("regnode.args")}${JSON.stringify(args)}`, 200);
if (data.highlightArgs) {
addShape("rect", {
attrs: {
x: x - 2,
y: y + 17,
width: w - 6,
height: 18,
fill: "#0d1117",
radius: [r, r, r, r],
},
name: "args-text-bg",
});
}
addShape("text", {
attrs: {
textBaseline: "top",
@@ -359,7 +372,8 @@ G6.registerNode(
w,
lineHeight: 20,
text: str,
fill: textColor,
fill: data.highlightArgs ? "white" : textColor,
fontWeight: data.highlightArgs ? "bolder" : undefined,
},
name: "args-text",
});