UNPKG

@antv/t8

Version:

T8 is a text visualization solution for unstructured data within the AntV technology stack, and it is a declarative T8 markdown syntax that can be used to describe the content of data interpretation reports.

59 lines 2.41 kB
/** * Path generators for SVG shapes * Creates SVG path data for lines, areas, and arcs */ import type { Scale, Point } from './types'; /** * Creates a line generator function * Converts data points to SVG path data for lines * * @param xScale - Scale function for X coordinates * @param yScale - Scale function for Y coordinates * @returns Function that generates SVG path data from data array */ export declare const line: (xScale: Scale, yScale: Scale, height: number) => (data: number[]) => string; /** * Creates an area generator function * Converts data points to SVG path data for filled areas * * @param xScale - Scale function for X coordinates * @param yScale - Scale function for Y coordinates * @param y0 - Baseline Y coordinate for the area * @returns Function that generates SVG path data from data array */ export declare const area: (xScale: Scale, yScale: Scale, y0: number) => (data: number[]) => string; /** * Creates an arc generator function * Converts angle data to SVG path data for arcs * * @param radius - radius of the arc * @returns Function that generates SVG path data from start and end angles */ export declare const arc: (radius: number) => (centerX: number, centerY: number, endAngle: number) => string; /** * Creates an arrow generator function * Converts start and end points to SVG path data for lines with arrowheads * * @param xScale - Scale function for X coordinates * @param yScale - Scale function for Y coordinates * @returns Function that generates SVG path data from start and end points */ export declare const arrow: (xScale: Scale, yScale: Scale, arrowheadLength?: number, arrowheadWidth?: number) => (startData: { index: number; value: number; }, endData: { index: number; value: number; }) => string; /** * Generates an SVG path string for a smooth Bézier curve (similar to d3.curveBasis) * based on a set of input points. * * NOTE: This is a simplified B-spline implementation suitable for smooth line generation, * * @param points - An array of coordinate pairs [[x0, y0], [x1, y1], ...] to be interpolated. * @returns A complete SVG path data string (starting with 'M' followed by 'C' segments). */ export declare function curveBasis(points: [number, number][]): string; export declare const createCurvePath: (xScale: Scale, yScale: Scale, data: Point[]) => string; //# sourceMappingURL=paths.d.ts.map