How to use the @antv/g.Shapes function in @antv/g

To help you get started, we’ve selected a few @antv/g 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
function getClip(coord) {
  const { start, end, width, height } = coord;
  const clip = new G.Shapes.Rect({
    attrs: {
      x: start.x,
      y: end.y,
      width: 0,
      height,
    },
  });
  clip.set('isClip', true);
  return clip;
}
github antvis / G2Plot / src / sparkline / ring-progress / animation / index.ts View on Github external
function createClip(coord, from, to) {
  const margin = 200;
  const center = coord.getCenter();
  const radius = coord.getRadius();
  const clip = new G.Shapes.Fan({
    attrs: {
      x: center.x,
      y: center.y,
      rs: 0,
      re: radius + margin,
      startAngle: from,
      endAngle: to,
    },
  });
  return clip;
}