How to use the @antv/path-util.path2Curve function in @antv/path-util

To help you get started, we’ve selected a few @antv/path-util 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 / G2 / packages / g2 / src / animate / action.ts View on Github external
function pathOut(shape, animateCfg) {
  if (shape.get('type') !== 'path') {
    return;
  }
  const path = pathUtil.path2Curve(shape.attr('path'));
  const endState = {
    path: [path[0]],
  };
  animateCfg.callback = () => shape.remove();

  doAnimation(shape, endState, animateCfg);
}
github antvis / G2 / packages / g2 / src / animate / action.ts View on Github external
function pathIn(shape, animateCfg) {
  if (shape.get('type') !== 'path') {
    return;
  }
  const path = pathUtil.path2Curve(shape.attr('path'));
  shape.attr('path', [path[0]]);
  const endState = {
    path,
  };

  doAnimation(shape, endState, animateCfg);
}

@antv/path-util

A common util collection for antv projects

MIT
Latest version published 3 years ago

Package Health Score

63 / 100
Full package analysis