/** @jsxImportSource react */ import { Widget, WidgetConfig } from "../ui/Widget"; import { Instance } from "../ui/Instance"; import { RenderingContext } from "../ui/RenderingContext"; import { NumberProp, BooleanProp, StringProp, RecordsProp, StyleProp } from "../ui/Prop"; import type { ChartRenderingContext } from "./Chart"; import { ClassProp } from "../ui/Prop"; interface LinePoint { x: number; y: number; y0: number; } export interface LineGraphConfig extends WidgetConfig { /** Data for the graph. Each entry should be an object with at least two properties * whose names should match the `xField` and `yField` values. */ data?: RecordsProp; /** Index of a color from the standard palette of colors. 0-15. */ colorIndex?: NumberProp; /** Used to automatically assign a color based on the `name` and the contextual `ColorMap` widget. */ colorMap?: StringProp; /** Name used to resolve the color. If not provided, `name` is used instead. */ colorName?: StringProp; /** Name of the item as it will appear in the legend. */ name?: StringProp; /** Used to indicate if an item is active or not. Inactive items are shown only in the legend. */ active?: BooleanProp; /** Name of the stack. If multiple stacks are used, each should have a unique name. Default value is `stack`. */ stack?: StringProp; /** Indicate that values should be stacked on top of the other values. Default value is `false`. */ stacked?: BooleanProp; /** Set to `true` to enable smooth (curved) line rendering. */ smooth?: BooleanProp; /** Controls the curvature of smooth lines. Value should be between 0 and 0.4. Default is 0.05. */ smoothingRatio?: NumberProp; /** Name of the horizontal axis. Default value is `x`. */ xAxis?: string; /** Name of the vertical axis. Default value is `y`. */ yAxis?: string; /** Name of the property which holds the x value. Default value is `x`. */ xField?: string; /** Name of the property which holds the y value. Default value is `y`. */ yField?: string; /** Name of the property which holds the base value. Default value is `false`, meaning y0 is used instead. */ y0Field?: string | false; /** Base value. Default value is `0`. */ y0?: NumberProp; /** Hide the base value. */ hiddenBase?: boolean; /** Set to `true` to enable area rendering. */ area?: BooleanProp; /** Set to `false` to disable line rendering. Default is `true`. */ line?: BooleanProp; /** Style for the line element. */ lineStyle?: StyleProp; /** Style for the area element. */ areaStyle?: StyleProp; /** Name of the legend to be used. Default is `legend`. Set to `false` to hide the legend entry. */ legend?: string | false; /** Action to perform on legend item click. Default is `auto`. */ legendAction?: string; /** Shape to use in legend. */ legendShape?: string; /** * Additional CSS classes to be applied to the field. * If an object is provided, all keys with a "truthy" value will be added to the CSS class list. */ class?: ClassProp; /** * Additional CSS classes to be applied to the field. * If an object is provided, all keys with a "truthy" value will be added to the CSS class list. */ className?: ClassProp; } export interface LineGraphInstance extends Instance { xAxis: any; yAxis: any; axes: Record; colorMap: any; lineSpans: LinePoint[][] | null; } export declare class LineGraph extends Widget { baseClass: string; xAxis: string; yAxis: string; xField: string; yField: string; y0Field: string | false; y0: number; hiddenBase: boolean; area: boolean; line: boolean; active: boolean; legend: string | false; legendAction: string; legendShape: string; stack: string; smooth: boolean; smoothingRatio: number; constructor(config: LineGraphConfig); declareData(...args: any[]): void; prepareData(context: RenderingContext, instance: LineGraphInstance): void; explore(context: ChartRenderingContext, instance: LineGraphInstance): void; prepare(context: ChartRenderingContext, instance: LineGraphInstance): void; onLegendClick(e: MouseEvent, instance: LineGraphInstance): void; calculateLineSpans(context: RenderingContext, instance: LineGraphInstance): LinePoint[][] | null; render(context: RenderingContext, instance: LineGraphInstance, key: string): React.ReactNode; getCurvedPathSegment(p: LinePoint, points: LinePoint[], i1: number, i2: number, j1: number, j2: number, r: number, yField?: "y" | "y0"): string; getControlPoint({ cp, pp, np, r, reverse, yField, }: { cp: LinePoint; pp: LinePoint | undefined; np: LinePoint | undefined; r: number; reverse?: boolean; yField?: "y" | "y0"; }): [number, number]; getLineInfo(p1x: number, p1y: number, p2x: number, p2y: number): { length: number; angle: number; }; } export {}; //# sourceMappingURL=LineGraph.d.ts.map