export const defaultEdge = {
labels: [
{
attrs: {
label: {
text: '待配置',
fill: 'var(--main)',
fontSize: 12,
textAnchor: 'middle',
pointerEvents: 'none'
},
body: {
ref: 'label',
fill: 'var(--white8)',
stroke: 'none',
strokeWidth: 1,
rx: 4,
ry: 4,
refWidth: '140%',
refHeight: '140%',
refX: '-20%',
refY: '-20%'
}
},
position: {
distance: 0.5
}
}
],
attrs: {
line: {
strokeDasharray: '4,2',
stroke: 'var(--textDisable)',
strokeWidth: 1,
targetMarker: {
name: 'block',
fill: '#8c8c8c',
args: {
size: '8'
},
offset: -15
}
}
}
}
// 边设置业务数据后的 配置
export const hasDataEdgeAttrs = {
labels: [
{
attrs: {
label: {
text: '待配置',
fill: 'var(--main)',
fontSize: 12,
textAnchor: 'middle',
pointerEvents: 'none'
},
body: {
ref: 'label',
fill: 'var(--main5)',
stroke: 'none',
strokeWidth: 1,
rx: 4,
ry: 4,
refWidth: '140%',
refHeight: '140%',
refX: '-20%',
refY: '-20%'
}
},
position: {
distance: 0.5
}
}
],
attrs: {
line: {
strokeDasharray: '4,2',
stroke: 'var(--textDisable)',
strokeWidth: 1,
targetMarker: {
name: 'block',
fill: '#8c8c8c',
args: {
size: '8'
},
offset: -15
}
}
}
}
// 边 tool 工具
export const edgeTool = [
{
// 在指定的位置处,渲染一个删除按钮
name: 'button-remove',
args: {
x: '100%',
y: 0,
offset: { x: 0, y: 0 }
}
}
]