ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
119 lines (118 loc) • 5.52 kB
TypeScript
import type { ColorSpace, InternalAgColorType, NormalisedColorType, NormalisedGradientColorStop, NormalisedSeriesSegmentation, RequiredInternalAgGradientColor, RequiredInternalAgImageFill, RequiredInternalAgPatternColor } from 'ag-charts-core';
import { BaseProperties, PropertiesArray } from 'ag-charts-core';
import type { AgColorRepeat, AgGradientColorBounds, AgGradientColorStop, AgGradientType, AgImageFillFit, AgPatternName, AgSelectionContainment, AgSeriesShapeSegmentOptions, CssColor, InteractionRange, Opacity, PixelSize, HighlightState as PublicHighlightState, SelectionState as PublicSelectionState } from 'ag-charts-types';
import type { SeriesTooltip } from './seriesTooltip';
import { HighlightState, SelectionState } from './seriesTypes';
export declare const highlightStates: HighlightState[];
export type HighlightStyleOptionKey = 'highlightedItem' | 'unhighlightedItem' | 'highlightedSeries' | 'unhighlightedSeries';
export type SelectionStyleOptionKey = 'selectedItem' | 'unselectedItem' | 'unselectedSeries';
export declare function getHighlightStyleOptionKeys(highlightState: HighlightState): HighlightStyleOptionKey[];
export declare function getSelectionStyleOptionKeys(selectionState: SelectionState): SelectionStyleOptionKey[];
type StyleMixins = {
fill: NormalisedColorType;
fillOpacity: number;
stroke: string;
strokeWidth: number;
strokeOpacity: number;
lineDash: number[];
lineDashOffset: number;
opacity: number;
};
export declare function toHighlightString(state: HighlightState): PublicHighlightState;
export declare function toSelectionString(state: SelectionState | undefined): PublicSelectionState | undefined;
export declare function isUnselected(state: SelectionState | undefined): boolean;
export declare function isRelevantSelectionState(state: SelectionState | undefined): state is Exclude<SelectionState, SelectionState.None>;
export declare function stagedSelectionState(selectionState: SelectionState | undefined, candidateState: SelectionState | undefined): SelectionState | undefined;
type HighlightOptions<TOpts extends object> = Partial<TOpts & StyleMixins>;
type SelectionOptions<TOpts extends object> = Partial<TOpts & StyleMixins>;
export type SeriesItemHighlightStyle = HighlightOptions<object>;
export declare class HighlightProperties<TOpts extends object> extends BaseProperties {
enabled: boolean;
range: 'tooltip' | 'node';
bringToFront: boolean;
readonly highlightedItem: HighlightOptions<TOpts>;
readonly unhighlightedItem: HighlightOptions<TOpts>;
readonly highlightedSeries: HighlightOptions<TOpts>;
readonly unhighlightedSeries: HighlightOptions<TOpts>;
getStyle(highlightState: HighlightState): HighlightOptions<TOpts>;
}
export declare class SeriesSelectionProperties<TOpts extends object> extends BaseProperties {
enabled: boolean;
containment: AgSelectionContainment;
readonly selectedItem: SelectionOptions<TOpts>;
readonly unselectedItem: SelectionOptions<TOpts>;
readonly unselectedSeries: SelectionOptions<TOpts>;
selectedOffset: number;
getStyle(selectionState: SelectionState): SelectionOptions<TOpts>;
}
export declare class SegmentOptions extends BaseProperties implements AgSeriesShapeSegmentOptions {
start?: number;
stop?: number;
fill: InternalAgColorType;
fillOpacity: number;
stroke: string;
strokeWidth: number;
strokeOpacity: number;
lineDash: number[];
lineDashOffset: number;
}
export declare class Segmentation implements NormalisedSeriesSegmentation {
enabled?: boolean;
key: 'x' | 'y';
segments: PropertiesArray<SegmentOptions>;
}
export declare class FillGradientDefaults extends BaseProperties<RequiredInternalAgGradientColor> implements RequiredInternalAgGradientColor {
type: 'gradient';
colorStops: NormalisedGradientColorStop[];
bounds: AgGradientColorBounds;
gradient: AgGradientType;
rotation: number;
reverse: boolean;
colorSpace: ColorSpace;
}
export declare class FillPatternDefaults extends BaseProperties<RequiredInternalAgPatternColor> implements RequiredInternalAgPatternColor {
type: 'pattern';
colorStops: AgGradientColorStop[];
bounds: AgGradientColorBounds;
gradient: AgGradientType;
rotation: number;
scale: number;
reverse: boolean;
path?: string;
pattern: AgPatternName;
width: number;
height: number;
padding: number;
fill: CssColor;
fillOpacity: Opacity;
backgroundFill: CssColor;
backgroundFillOpacity: Opacity;
stroke: CssColor;
strokeOpacity: number;
strokeWidth: PixelSize;
}
export declare class FillImageDefaults extends BaseProperties<RequiredInternalAgImageFill> implements RequiredInternalAgImageFill {
type: 'image';
url: string;
rotation: number;
scale: number;
backgroundFill: CssColor;
backgroundFillOpacity: Opacity;
repeat: AgColorRepeat;
fit: AgImageFillFit;
}
export declare abstract class SeriesProperties<T extends object> extends BaseProperties<T> {
id?: string;
protected readonly visible: boolean;
focusPriority?: number;
showInLegend: boolean;
cursor: string;
nodeClickRange: InteractionRange;
readonly highlight: HighlightProperties<T>;
readonly selection: SeriesSelectionProperties<T>;
abstract tooltip: SeriesTooltip<never>;
context?: unknown;
allowNullKeys?: boolean;
handleUnknownProperties(unknownKeys: Set<unknown>, properties: T): void;
}
export {};