How to use the @antv/g2.Animate.registerAnimation function in @antv/g2

To help you get started, we’ve selected a few @antv/g2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / G2Plot / src / plots / line / animation / clipIn-with-data.ts View on Github external
/*if(i !== index){
          dataPoints = dataPoints.splice(i,1);
          index = i;
      }*/
      const y = current.y + m * (currentX - current.x);
      return [currentX, y];
    }
  }
}

function getDataByPosition(scale, y, coord) {
  const yRatio = (y - coord.start.y) / (coord.end.y - coord.start.y);
  return scale.invert(yRatio).toFixed(2);
}

Animate.registerAnimation('appear', 'clipingWithData', clipingWithData);
github antvis / G2Plot / src / sparkline / ring-progress / animation / index.ts View on Github external
minX = minX > point.x ? point.x : minX;
    maxX = maxX < point.x ? point.x : maxX;
    minY = minY > point.y ? point.y : minY;
    maxY = maxY < point.y ? point.y : maxY;
  });
  return {
    minX,
    maxX,
    minY,
    maxY,
    centerX: (minX + maxX) / 2,
    centerY: (minY + maxY) / 2,
  };
}

Animate.registerAnimation('update', 'groupProgress', progressUpdate);