UNPKG

ag-charts-enterprise

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

54 lines (53 loc) 2.43 kB
import { type AgCrosshairLabelFormatterParams, type ContextDefault, type FormatterParams, type TextValue, _ModuleSupport } from 'ag-charts-community'; import { AbstractModuleInstance, type NormalisedCrosshairOptions } from 'ag-charts-core'; export declare class Crosshair extends AbstractModuleInstance implements _ModuleSupport.AxisFormattableLabel<AgCrosshairLabelFormatterParams<ContextDefault>, FormatterParams> { private readonly ctx; static readonly className = "Crosshair"; readonly id: string; private options; /** * Read by `CartesianChart.adjustAxisWidth` to skip axis-bleeding-width * adjustment when a crosshair is active (so the axis-label space the * crosshair would otherwise occupy is not reclaimed by the layout). * Pre-Phase-5 this was the `@Property enabled` field; after the * options-reference migration it lives inside `options.enabled`. */ get enabled(): boolean; private readonly labels; private readonly axisCtx; private seriesRect; private bounds; private axisLayout?; private cachedFormatter; private readonly crosshairGroup; protected readonly lineGroup: _ModuleSupport.Group<unknown>; protected lineGroupSelection: _ModuleSupport.Selection<string, _ModuleSupport.Line<string>>; private activeHighlight?; private activeHighlightInViewport; constructor(ctx: _ModuleSupport.ChartAxisRegistry<_ModuleSupport.AxisContext>); applyOptions(options: NormalisedCrosshairOptions): void; formatValue(callWithContext: (formatter: (params: AgCrosshairLabelFormatterParams<ContextDefault>) => TextValue | undefined, params: AgCrosshairLabelFormatterParams<ContextDefault>) => TextValue | undefined, type: 'number' | 'date' | 'category', value: any, params: FormatterParams<any>): string | undefined; private checkInteractionState; private layout; private updateSelections; private updateLabels; private updateLabel; private updateLines; private isVertical; private isHover; private formatScaleText; private onClick; private onMouseHoverLike; private onMouseOut; private onKeyPress; private onHighlightChange; private isInRange; private refreshPositions; private updatePositions; private getData; private getActiveHighlightData; private getLabelHtml; private showLabel; private hideCrosshairs; private hideLabel; }