How to use the @antv/g2.Global.renderer 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 / liquid / geometry / shape / liquid.ts View on Github external
const bbox = clip.getBBox();
  const width = bbox.maxX - bbox.minX;
  const height = bbox.maxY - bbox.minY;
  const duration = 5000;
  const delayDiff = 300;
  for (let i = 0; i < waveCount; i++) {
    const wave = group.addShape('path', {
      attrs: {
        path: getWaterWavePath(radius, bbox.minY + height * level, width / 4, 0, width / 64, x, y),
        fill: colors[i],
        clip,
        opacity: 0.8,
      },
    });
    // FIXME wave animation error in svg
    if (Global.renderer === 'canvas') {
      wave.animate(
        {
          transform: [['t', width / 2, 0]],
          repeat: true,
        },
        duration - i * delayDiff
      );
    }
  }
}