UNPKG

@devexperts/dxcharts-lite

Version:
76 lines (75 loc) 3.23 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 { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container'; import { FullChartConfig } from '../../chart.config'; import { DrawingManager } from '../../drawers/drawing-manager'; import { CrossEventProducerComponent } from '../../inputhandlers/cross-event-producer.component'; import { HoverProducerComponent } from '../../inputhandlers/hover-producer.component'; import { BaselineModel } from '../../model/baseline.model'; import { CanvasModel } from '../../model/canvas.model'; import { ChartBaseElement } from '../../model/chart-base-element'; import { ChartModel } from '../chart/chart.model'; import { PaneManager } from '../pane/pane-manager.component'; import { CrossToolTypeDrawer } from './cross-tool.drawer'; import { CrossToolModel, CrossToolType } from './cross-tool.model'; export type MagnetTarget = 'O' | 'H' | 'L' | 'C' | 'OHLC' | 'none'; /** * Default bundled chart cross tool. */ export declare class CrossToolComponent extends ChartBaseElement { private config; private crossToolCanvasModel; private canvasBoundsContainer; private drawingManager; private paneManager; private crossEventProducer; private hoverProducer; private baselineModel; private chartModel; readonly model: CrossToolModel; private readonly crossToolTypeDrawers; constructor(config: FullChartConfig, crossToolCanvasModel: CanvasModel, canvasBoundsContainer: CanvasBoundsContainer, drawingManager: DrawingManager, paneManager: PaneManager, crossEventProducer: CrossEventProducerComponent, hoverProducer: HoverProducerComponent, baselineModel: BaselineModel, chartModel: ChartModel); /** * Registers default drawer types for the chart. * @private * @function * @name registerDefaultDrawerTypes * * @returns {void} */ private registerDefaultDrawerTypes; /** * Sets the cross tool visibility. * @param visible */ setVisible(visible: boolean): void; /** * Sets the crosstool type. * - cross-and-labels - both the crosshair and X/Y labels * - only-labels - only the X/Y label * - none * @param type */ setType(type: CrossToolType): void; /** * Returns an Observable that emits the current hover subject. */ observeCrossToolChanged(): import("rxjs").BehaviorSubject<import("./cross-tool.model").CrossToolHover | null>; /** * Sets magnet target for cross tool. * Supported only for 'cross-and-labels' type. * Default magnet target is none. * @param target */ setMagnetTarget(target: MagnetTarget): void; /** * Adds a new drawer type for cross tool, so you can add your own implementation of cross tool * (or override existing) * @param drawerName - an unique drawer type name * @param drawerImpl - CrossToolTypeDrawer object */ registerCrossToolTypeDrawer(drawerName: CrossToolType, drawerImpl: CrossToolTypeDrawer): void; }