interpolatePath()
属于 @remotion/paths 软件包的一部分.
🌐 Part of the @remotion/paths package.
在两个 SVG 路径之间进行插值。该函数接受三个参数:
🌐 Interpolates between two SVG paths. The function takes three arguments:
value,这是一个数字。- 如果是
0,则返回第一条路径。 - 如果是
1,则返回第二个路径。 - 如果它位于范围之间或范围之外,路径将被插值。
- 如果是
firstPath,它必须是一个有效的 SVG 路径。secondPath,它必须是一个有效的 SVG 路径。
import { interpolatePath } from "@remotion/paths";
const interpolated = interpolatePath (0.5, "M 0 0 L 100 0", "M 100 0 L 0 0");
console .log (interpolated ); // "M 50 0 L 50 0"鸣谢
🌐 Credits
源代码主要来自 d3-interpolate-path。
🌐 Source code stems mostly from d3-interpolate-path.
另请参阅
🌐 See also