How to use the @antv/path-util.parsePathString 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 / element / shape / point.ts View on Github external
const pathMetaParser = _.memoize((path: string) => {
  const segments = pathUtil.parsePathString(path);
  const nums = _.flatten(segments).filter((num) => _.isNumber(num));
  return {
    range: Math.max.apply(null, nums) - Math.min.apply(null, nums),
    segments,
  };
});
github antvis / G2 / src / geometry / shape / base.ts View on Github external
parsePath(path: string, isLineToArc: boolean = true): PathCommand[] {
    const coordinate = this.coordinate;
    let parsedPath = parsePathString(path);
    if (coordinate.isPolar && isLineToArc !== false) {
      parsedPath = convertPolarPath(coordinate, parsedPath);
    } else {
      parsedPath = convertNormalPath(coordinate, parsedPath);
    }
    return parsedPath;
  },
  /**

@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