UNPKG

@visactor/vrender-core

Version:

```typescript import { xxx } from '@visactor/vrender-core'; ```

68 lines (43 loc) 1.83 kB
import { genLinearSegments } from "./linear"; import { genBasisSegments } from "./basis"; import { genMonotoneXSegments, genMonotoneYSegments } from "./monotone"; import { genStepClosedSegments, genStepSegments } from "./step"; import { genLinearClosedSegments } from "./linear-closed"; import { genCatmullRomSegments } from "./catmull-rom"; import { genCatmullRomClosedSegments } from "./catmull-rom-close"; export * from "./linear"; export * from "./linear-closed"; export * from "./basis"; export * from "./monotone"; export * from "./step"; export * from "./curve/curve-context"; export * from "./curve/cubic-bezier"; export function calcLineCache(points, curveType, params) { var _a, _b; switch (curveType) { case "linear": default: return genLinearSegments(points, params); case "basis": return genBasisSegments(points, params); case "monotoneX": return genMonotoneXSegments(points, params); case "monotoneY": return genMonotoneYSegments(points, params); case "step": return genStepSegments(points, .5, params); case "stepClosed": return genStepClosedSegments(points, .5, params); case "stepBefore": return genStepSegments(points, 0, params); case "stepAfter": return genStepSegments(points, 1, params); case "catmullRom": return genCatmullRomSegments(points, null !== (_a = null == params ? void 0 : params.curveTension) && void 0 !== _a ? _a : .5, params); case "catmullRomClosed": return genCatmullRomClosedSegments(points, null !== (_b = null == params ? void 0 : params.curveTension) && void 0 !== _b ? _b : .5, params); case "linearClosed": return genLinearClosedSegments(points, params); } } //# sourceMappingURL=index.js.map