@antv/g6 5.0.0-alpha.3 → 5.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +9 -9
- package/esm/item/edge.js +6 -3
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.js +2 -9
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.js +2 -2
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/item.js +9 -7
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.js +5 -1
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.js +0 -1
- package/esm/stdlib/behavior/hover-activate.js.map +1 -1
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +8 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js +27 -3
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +8 -0
- package/esm/stdlib/behavior/zoom-canvas.js +8 -1
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/item/node/base.js +1 -1
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/util/animate.d.ts +5 -0
- package/esm/util/animate.js +11 -5
- package/esm/util/animate.js.map +1 -1
- package/lib/item/edge.js +6 -3
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.js +1 -8
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.js +2 -2
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/item.js +9 -7
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.js +5 -1
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.js +0 -1
- package/lib/stdlib/behavior/hover-activate.js.map +1 -1
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +8 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js +27 -3
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +8 -0
- package/lib/stdlib/behavior/zoom-canvas.js +8 -1
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/item/node/base.js +1 -1
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/util/animate.d.ts +5 -0
- package/lib/util/animate.js +13 -6
- package/lib/util/animate.js.map +1 -1
- package/package.json +1 -1
- package/src/item/edge.ts +4 -3
- package/src/item/item.ts +2 -7
- package/src/item/node.ts +2 -2
- package/src/runtime/controller/item.ts +11 -7
- package/src/stdlib/behavior/drag-node.ts +5 -1
- package/src/stdlib/behavior/hover-activate.ts +0 -2
- package/src/stdlib/behavior/zoom-canvas-3d.ts +45 -2
- package/src/stdlib/behavior/zoom-canvas.ts +15 -0
- package/src/stdlib/item/node/base.ts +1 -0
- package/src/util/animate.ts +12 -5
package/src/util/animate.ts
CHANGED
|
@@ -331,7 +331,7 @@ export const animateShapes = (
|
|
|
331
331
|
let i = 0;
|
|
332
332
|
const groupKeys = Object.keys(timingAnimateGroups);
|
|
333
333
|
if (!groupKeys.length) return;
|
|
334
|
-
|
|
334
|
+
const animations = [];
|
|
335
335
|
let canceled = false;
|
|
336
336
|
const onfinish = () => {
|
|
337
337
|
if (i >= groupKeys.length) {
|
|
@@ -350,11 +350,8 @@ export const animateShapes = (
|
|
|
350
350
|
).filter(Boolean);
|
|
351
351
|
groupAnimations.forEach((animation) => {
|
|
352
352
|
animation.onframe = onAnimatesFrame;
|
|
353
|
+
animations.push(animation);
|
|
353
354
|
});
|
|
354
|
-
if (i === 0) {
|
|
355
|
-
// collect the first group animations
|
|
356
|
-
animations = groupAnimations;
|
|
357
|
-
}
|
|
358
355
|
i++;
|
|
359
356
|
};
|
|
360
357
|
onfinish();
|
|
@@ -428,3 +425,13 @@ export const fadeOut = (id, shape, hiddenShape, animateConfig) => {
|
|
|
428
425
|
const animation = shape.animate([{ opacity }, { opacity: 0 }], animateConfig);
|
|
429
426
|
animation.onfinish = () => shape.hide();
|
|
430
427
|
};
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Make the animation to the end frame and clear it from the target shape.
|
|
431
|
+
* @param animation
|
|
432
|
+
*/
|
|
433
|
+
export const stopAnimate = (animation) => {
|
|
434
|
+
const timing = animation.effect.getTiming();
|
|
435
|
+
animation.currentTime = Number(timing.duration) + Number(timing.delay || 0);
|
|
436
|
+
animation.cancel();
|
|
437
|
+
};
|