diff --git a/demos/edge-animate.html b/demos/edge-animate.html index 530dd0e926..4f25a988f6 100644 --- a/demos/edge-animate.html +++ b/demos/edge-animate.html @@ -107,7 +107,7 @@ G6.registerEdge('line-dash', { afterDraw(cfg, group) { const shape = group.get('children')[0]; - const length = 200; // 后续 G 增加 totalLength 的接口 + const length = shape.getTotalLength(); // G 增加了 totalLength 的接口 let totalArray = []; for (var i = 0; i < length; i += interval) { totalArray = totalArray.concat(lineDash); @@ -129,7 +129,7 @@ G6.registerEdge('line-growth', { afterDraw(cfg, group) { const shape = group.get('children')[0]; - const length = 200; // 后续 G 增加 totalLength 的接口 + const length = shape.getTotalLength(); // G 增加了 totalLength 的接口 shape.animate({ onFrame(ratio) { diff --git a/demos/hover-animate.html b/demos/hover-animate.html new file mode 100644 index 0000000000..82161be497 --- /dev/null +++ b/demos/hover-animate.html @@ -0,0 +1,155 @@ + + +
+ +