import type { MouseHandler } from "./interactive"; import type { Interval } from "./interval"; import type { Coord } from "../interactive2/types"; import type { GraphieLabelElement } from "../types"; export declare function polar(r: number | Coord, th: number): Coord; interface RaphaelElement { type: string; attrs: Record; node: { style: { shapeRendering: "crispEdges" | "geometricPrecision"; }; }; } type PositionedShape = { wrapper: HTMLDivElement; visibleShape: RaphaelElement; }; type StyleParams = { fill?: string; labelDistance?: number; opacity?: number; step?: Coord; stroke?: string; strokeWidth?: number; }; type LabelPosition = "center" | "above" | "below" | "right" | "left" | "above right" | "above left" | "below right" | "below left"; interface LabelMethod { (point: Coord, text: string, position: LabelPosition): GraphieLabelElement; (point: Coord, text: string, position: LabelPosition, renderTex: boolean): GraphieLabelElement; (point: Coord, text: string, position: LabelPosition, style: StyleParams): GraphieLabelElement; (point: Coord, text: string, position: LabelPosition, renderTex: boolean, style: StyleParams): GraphieLabelElement; } export declare class Graphie { #private; el: Element; raphael?: any; mouselayer?: any; _mouselayerWrapper?: HTMLDivElement; _visiblelayerWrapper?: HTMLDivElement; isMobile: boolean; currentStyle: any; range?: [Interval, Interval]; scale?: Coord; dimensions?: Coord; xpixels?: number; ypixels?: number; isDragging?: boolean; constructor(el: Element); init(options: { range: [Interval, Interval]; scale?: number | Coord; isMobile?: boolean; }): this; graphInit(options: { range?: [Interval, Interval] | Coord; grid?: boolean; gridRange?: [Interval, Interval] | Coord; scale: Coord | number; axes?: boolean; axisArrows?: "<->" | "->" | true | ""; axisOpacity?: number; axisCenter?: Coord; axisLabels?: [string, string] | false; gridOpacity?: number; gridStep?: Coord | number; ticks?: boolean; tickStep?: Coord | number; tickLen?: Coord | number; tickOpacity?: number; labels?: boolean; labelStep?: number; labelOpacity?: number; labelFormat?: (a: number) => string; yLabelFormat?: (y: number) => string; xLabelFormat?: (x: number) => string; unityLabels?: boolean | [boolean, boolean]; isMobile?: boolean; }): void; private drawingTransform; private bounds; style(attrs: any, fn?: (this: Graphie) => T): T | undefined; grid(xr: Interval, yr: Interval, style?: StyleParams): unknown; arc(center: Coord, radius: Coord, startAngle: number, endAngle: number, sector: boolean, style?: StyleParams): RaphaelElement; circle(center: Coord, radius: number, style?: StyleParams): any; rect(x: any, y: any, width: any, height: any, style?: StyleParams): any; ellipse(center: any, radii: any, style?: StyleParams): any; fixedEllipse(center: number | Coord, radii: number | [number, number], maxScale: number, padding: number, style?: StyleParams): PositionedShape; private unstyledPath; path(points: Coord[], style?: StyleParams): RaphaelElement; fixedPath(points: Coord[], center: Coord | null, createPath: (scaledPoints: Coord[]) => string): PositionedShape; scaledPath(points: Coord[], style?: StyleParams): RaphaelElement; line(start: Coord, end: Coord, style?: StyleParams): RaphaelElement; parabola(a: number, b: number, c: number, style?: StyleParams): RaphaelElement; fixedLine(start: Coord, end: Coord, thickness: number): PositionedShape; sinusoid(a: number, b: number, c: number, d: number, style?: StyleParams): RaphaelElement; label: LabelMethod; plotParametric(fn: (t: number) => Coord, range: Interval, style?: StyleParams): RaphaelElement; plot(fn: (x: number) => number, range: Interval, style?: StyleParams): RaphaelElement; svgPath: (points: (Coord | true)[], alreadyScaled?: boolean) => string; svgParabolaPath: (a: number, b: number, c: number) => string; svgSinusoidPath: (a: number, b: number, c: number, d: number) => string; private withStyle; private postprocessDrawingResult; private addArrowheads; scalePoint: (point: number | Coord) => Coord; scaleVector: (point: number | Coord) => any; unscalePoint: (point: number | Coord) => any; unscaleVector: (point: number | Coord) => any; private processAttributes; addMouseLayer(options: { onClick?: MouseHandler; onMouseMove?: MouseHandler; onMouseDown?: MouseHandler | null; onMouseOver?: MouseHandler | null; onMouseOut?: MouseHandler | null; onMouseUp?: MouseHandler | null; allowScratchpad?: boolean; setDrawingAreaAvailable?: (available: boolean) => void; }): void; addToMouseLayerWrapper(el: HTMLElement): void; addToVisibleLayerWrapper(el: HTMLElement): void; /** * Get mouse coordinates in pixels */ getMousePx(event: Readonly<{ pageX?: number; pageY?: number; }>): Coord; /** * Get mouse coordinates in graph coordinates */ getMouseCoord(event: Readonly<{ pageX?: number; pageY?: number; }>): Coord; } type RangeSpecifier = [Interval, Interval] | Coord | number; export declare function normalizeRange(range: RangeSpecifier): [Interval, Interval]; export declare function normalizeRange(range: RangeSpecifier | undefined): [Interval, Interval] | undefined; declare const GraphUtils: { Graphie: typeof Graphie; createGraphie: (el: Element) => Graphie; unscaledSvgPath: (points: (Coord | true)[]) => string; getDistance: (point1: Coord, point2: Coord) => number; findAngleDeprecated: (point1: Coord, point2: Coord, vertex?: Coord) => any; graphs: {}; }; export default GraphUtils;