INNER CODE UNIT · TypeScript

cp3x

margelo/react-native-graph · src/CreateGraphPath.ts:231

    const cp3x = (p0.x + 4 * p1.x + point.x) / 6;
    const cp3y = (p0.y + 4 * p1.y + point.y) / 6;

    path.cubicTo(cp1x, cp1y, cp2x, cp2y, cp3x, cp3y);

    if (i === points.length - 1) {
      path.cubicTo(point.x, point.y, point.x, point.y, point.x, point.y);
    }
  }

  if (!shouldFillGradient) return path;

  const gradientPath = path.copy();

  gradientPath.lineTo(endX, height + verticalPadding);
  gradientPath.lineTo(0 + horizontalPadding, height + verticalPadding);

  return { path: path, gradientPath: gradientPath };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…