Socket
Socket
Sign inDemoInstall

@antv/g

Package Overview
Dependencies
Maintainers
4
Versions
349
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g - npm Package Compare versions

Comparing version 2.0.5-beta.2 to 2.0.5-beta.3

dist/g-2.0.5-beta.3.min.js

2

package.json
{
"name": "@antv/g",
"version": "2.0.5-beta.2",
"version": "2.0.5-beta.3",
"description": "A canvas library which providing 2d draw for G2.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -125,3 +125,3 @@ # G

* zIndex 层次索引值,决定分组在父容器中的位置
* visibile 是否可见
* visible 是否可见
* children 嵌套的图形元素,只读

@@ -171,3 +171,3 @@

* zIndex 层次索引值,决定分组在父容器中的位置
* visibile 是否可见
* visible 是否可见
* attrs 图形属性,通用的图形属性如下:

@@ -174,0 +174,0 @@ + transform 进行几何变换的矩阵

@@ -205,6 +205,10 @@ const Util = require('../util/index');

const destroyed = this.get('destroyed');
if (destroyed) {
return;
}
// 如果正在执行动画,清理动画
if (this.get('animating')) {
const timer = this.get('animateTimer');
timer && timer.stop();
}
this.__cfg = {};

@@ -211,0 +215,0 @@ this.__attrs = null;

@@ -9,2 +9,25 @@ const MatrixUtil = require('../../util/matrix');

module.exports = {
stopAnimate() {
const self = this;
const canvas = self.get('canvas');
if (self.get('destroyed')) {
return;
}
if (self.get('animating')) {
const timer = self.get('animateTimer');
timer && timer.stop();
const animateCfg = self.get('animateCfg');
self.attr(animateCfg.toAttrs);
if (animateCfg.toM) {
self.setMatrix(animateCfg.toM);
}
if (animateCfg.callback) {
animateCfg.callback();
}
self.setSilent('animating', false); // 动画停止
self.setSilent('animateCfg', null);
self.setSilent('animateTimer', null);
canvas.draw();
}
},
/**

@@ -26,5 +49,21 @@ * 执行动画

const fromM = Util.clone(self.getMatrix());
easing = easing ? easing : 'easeLinear';
// 可能不设置 easing
if (Util.isNumber(callback)) {
delay = callback;
callback = null;
}
if (Util.isFunction(easing)) {
callback = easing;
easing = 'easeLinear';
} else {
easing = easing ? easing : 'easeLinear';
}
self.setSilent('animating', true); // 处于动画状态
self.setSilent('animateCfg', {
toAttrs,
toM,
callback
});
// 执行动画

@@ -40,2 +79,4 @@ const timer = d3Timer.timer(elapsed => {

self.setSilent('animating', false); // 动画停止
self.setSilent('animateCfg', null);
self.setSilent('animateTimer', null);
timer.stop();

@@ -45,2 +86,4 @@ }

self.setSilent('animateTimer', timer);
function update(ratio) {

@@ -47,0 +90,0 @@ const cProps = {}; // 此刻属性

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc