import * as d3 from 'd3'; import { Point } from '../types/Point'; abstract class Path { abstract angleAlong (t: number, x: d3.ScaleLinear, y: d3.ScaleLinear): number; abstract apply (context: CanvasRenderingContext2D, x: d3.ScaleLinear, y: d3.ScaleLinear): void; abstract pointAlong (t: number, x: d3.ScaleLinear, y: d3.ScaleLinear): Point; abstract points(): Point[]; } function transformed (p: Point, x: d3.ScaleLinear, y: d3.ScaleLinear): Point { return { x: x(p.x) + (p.dx ? p.dx : 0), y: y(p.y) + (p.dy ? p.dy : 0) }; } export { Path, transformed }