refactor: extract edge's attrs config

This commit is contained in:
zhaoying
2026-01-20 15:56:21 +08:00
parent 804d87bca2
commit cb62608dbd
7 changed files with 41 additions and 204 deletions

View File

@@ -517,6 +517,8 @@ interface NodeConfig {
ports?: PortsConfig;
}
export const edge_color = '#155EEF';
export const edge_selected_color = '#4DA8FF'
// 统一的端口 markup 配置
export const portMarkup = [
{
@@ -534,9 +536,9 @@ export const portAttrs = {
body: {
r: 6,
magnet: true,
stroke: '#155EEF',
stroke: edge_color,
strokeWidth: 2,
fill: '#155EEF',
fill: edge_color,
},
label: {
text: '+',
@@ -776,4 +778,18 @@ export const outputVariable: { [key: string]: OutputVariable } = {
{ name: "output", type: "string" },
],
},
}
export const edgeAttrs = {
attrs: {
line: {
stroke: edge_color,
strokeWidth: 1,
targetMarker: {
name: 'block',
width: 4,
height: 4,
},
},
},
}