INNER CODE UNIT · TypeScript

cp1y

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

    const cp1y = (2 * p0.y + p1.y) / 3;
    const cp2x = (p0.x + 2 * p1.x) / 3;
    const cp2y = (p0.y + 2 * p1.y) / 3;
    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);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…