How to use the @antv/g.PathUtil.catmullRomToBezier 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 / G2 / src / component / axis / polyline.js View on Github external
getLinePath() {
    const self = this;
    const tickPoints = self.get('tickPoints');
    const start = self.get('start');
    const end = self.get('end');
    const points = [];
    points.push(start.x);
    points.push(start.y);
    Util.each(tickPoints, function(tick) {
      points.push(tick.x);
      points.push(tick.y);
    });
    points.push(end.x);
    points.push(end.y);

    const path = PathUtil.catmullRomToBezier(points);
    path.unshift([ 'M', start.x, start.y ]);
    return path;
  }
github antvis / G2 / src / component / axis / helix.js View on Github external
getLinePath() {
    const self = this;
    const crp = self.get('crp');
    const axisStart = self.get('axisStart');
    const path = PathUtil.catmullRomToBezier(crp);
    path.unshift([ 'M', axisStart.x, axisStart.y ]);
    return path;
  }