G6.registerEdge(
'circle-running',
{
afterDraw(cfg, group) {
const shape = group.get('children')[0];
const startPoint = shape.getPoint(0);
const circle = group.addShape('circle', {
attrs: {
x: startPoint.x,
y: startPoint.y,
fill: '#5B8FF9',
r: 3
},
name: 'circle-shape'
});
circle.animate(
ratio => {
const tmpPoint = shape.getPoint(ratio);
return {
x: tmpPoint.x,
y: tmpPoint.y
};
},
{
repeat: true,
duration: 1000
}
);
}
},
'line'
)