import type { TransformLineage } from './transform.js'; import type { Channel, ChannelOutput, CartesianScaleBindings, ChartKey, ChartLineStateStyle, ChartMark, ChartMarkMotionOptions, ChartMarkState, VisualChannel } from './types.js'; export type DifferenceIndependent = number | Date; export type DifferenceSign = 'positive' | 'negative'; /** One source or interpolated boundary point in a difference-area lobe. */ export interface DifferenceAreaDatum extends TransformLineage { readonly kind: 'difference-area'; readonly independent: TIndependent; readonly comparison: number; readonly primary: number; readonly sign: DifferenceSign; readonly segment: string; readonly crossing: boolean; readonly markKey: ChartKey; } /** Raw line data plus the derived, decorative difference-area data. */ export type DifferenceDatum = TDatum | DifferenceAreaDatum; interface DifferenceOptions extends CartesianScaleBindings, ChartMarkMotionOptions> { id?: string; z?: Channel; key?: Channel; positiveFill?: VisualChannel, string> | null; negativeFill?: VisualChannel, string> | null; fillOpacity?: number; positiveFillOpacity?: number; negativeFillOpacity?: number; /** Paint for the primary boundary line. */ stroke?: VisualChannel; strokeOpacity?: number; strokeWidth?: number; strokeDasharray?: string; /** Paint for the comparison boundary line. */ comparisonStroke?: VisualChannel; comparisonStrokeOpacity?: number; comparisonStrokeWidth?: number; comparisonStrokeDasharray?: string; points?: boolean; states?: readonly ChartMarkState>[]; comparisonStates?: readonly ChartMarkState>[]; } export interface DifferenceYOptions extends DifferenceOptions { x: Channel; y1: number | Channel; y2: number | Channel; } export interface DifferenceXOptions extends DifferenceOptions { x1: number | Channel; x2: number | Channel; y: Channel; } type IndependentOutput = Extract, DifferenceIndependent>; type DifferenceYCallOptions, DifferenceIndependent | null | undefined>> = Omit, IndependentOutput>, 'x'> & { x: TXChannel; }; type DifferenceXCallOptions, DifferenceIndependent | null | undefined>> = Omit, IndependentOutput>, 'y'> & { y: TYChannel; }; /** Compares two vertical values and fills their positive and negative lobes. */ export declare function differenceY, DifferenceIndependent | null | undefined>, const TXScaleId extends string = 'x', const TYScaleId extends string = 'y'>(source: Iterable, options: DifferenceYCallOptions & { xScale?: TXScaleId; yScale?: TYScaleId; }): ChartMark>, IndependentOutput, number, IndependentOutput, number, TXScaleId, TYScaleId>; /** Compares two horizontal values and fills their positive and negative lobes. */ export declare function differenceX, DifferenceIndependent | null | undefined>, const TXScaleId extends string = 'x', const TYScaleId extends string = 'y'>(source: Iterable, options: DifferenceXCallOptions & { xScale?: TXScaleId; yScale?: TYScaleId; }): ChartMark>, number, IndependentOutput, number, IndependentOutput, TXScaleId, TYScaleId>; export {};