UNPKG

@devexperts/dxcharts-lite

Version:
70 lines (69 loc) 3.03 kB
/* * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { BehaviorSubject, Subscription } from 'rxjs'; import { CanvasBoundsContainer, HitBoundsTest, HitBoundsTestOptionsPartial } from '../canvas/canvas-bounds-container'; import { CanvasInputListenerComponent } from '../inputlisteners/canvas-input-listener.component'; import { ChartBaseElement } from '../model/chart-base-element'; import { Unsubscriber } from '../utils/function.utils'; import { Pixel } from '../model/scaling/viewport.model'; import { Hover } from './hover-producer.component'; /** * [x, y, uuid - Unique identifier for the subscription] */ export type CrossEvent = [number, number, string]; interface CrossToolTouchInfo { fixed: { x: Pixel; y: Pixel; }; temp: { x: Pixel; y: Pixel; }; isSet: boolean; /** * additional flag to determine ordinary and long taps * crosstool shouldn't be hidden after longtouch event even if coordinates are the same * becomes true after touchStart and false after longTouchStart */ isCommonTap: boolean; } export declare class CrossEventProducerComponent extends ChartBaseElement { private canvasInputListener; private canvasBoundsContainer; panesSubscriptions: Partial<Record<string, Subscription>>; crossSubject: BehaviorSubject<CrossEvent | null>; crossToolHover: Hover | null; crossToolTouchInfo: CrossToolTouchInfo; constructor(canvasInputListener: CanvasInputListenerComponent, canvasBoundsContainer: CanvasBoundsContainer); protected doActivate(): void; /** * Emits a null value to the `cross` subject, effectively closing the current cross. */ fireCrossClose(): void; /** * Unsubscribes from the mouse over event for a specific pane. * @param {string} uuid - The unique identifier of the pane. * @returns {void} */ unsubscribeMouseOver(uuid: string): void; /** * Subscribes to mouse over event on canvas elements. * @param {string} uuid - Unique identifier for the subscription. * @param {string[]} canvasElementNames - Array of canvas element names to subscribe to. * @param {HitBoundsTestOptionsPartial} [options] - Optional hit bounds test options. * @returns {Subscription} - Returns a subscription object. */ subscribeMouseOver(uuid: string, canvasElementNames: string[], options?: HitBoundsTestOptionsPartial): Unsubscriber; /** * Subscribes to mouse over event on a hit test area identified by uuid. * @param {string} uuid - The unique identifier of the hit test area. * @param {HitBoundsTest} hitTest - The hit test area. * @returns {Subscription} - The subscription object. */ subscribeMouseOverHT(uuid: string, hitTest: HitBoundsTest): Unsubscriber; } export {};