UNPKG

@devexperts/dxcharts-lite

Version:
39 lines (38 loc) 2.07 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 { NumericAxisLabel, NumericAxisLabelsGenerator } from '../labels_generator/numeric-axis-labels.generator'; import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container'; import { ChartBaseElement } from '../../model/chart-base-element'; import { ScaleModel } from '../../model/scale.model'; export declare class YAxisBaseLabelsModel extends ChartBaseElement { private scale; private labelsGenerator; private canvasBoundsContainer; private paneUUID; private extentIdx; labels: Array<NumericAxisLabel>; private prevYAxisHeight; private animFrameId; constructor(scale: ScaleModel, labelsGenerator: NumericAxisLabelsGenerator, canvasBoundsContainer: CanvasBoundsContainer, paneUUID: string, extentIdx: number); /** * This method is used to activate the component. It calls the parent's doActivate method and subscribes to the merge of two observables: * - this.scale.yChanged * - this.canvasBoundsContainer.observeBoundsChanged * The merge of these two observables is used to update the labels of the component when either the y-axis scale model changes or the canvas bounds change. * If the height of the canvas bounds changes by more than 1.5 times the previous height, the labels cache is invalidated and the previous y-axis height is updated. */ protected doActivate(): void; /** * Generates new labels with labelsGenerator * Then, it calls the updateYAxisWidth method to update the width of the y-axis. */ recalculateLabels(): void; /** * Updates the labels of the chart's y-axis by generating new numeric labels using the yAxisLabelsGenerator object. * Then, it calls the updateYAxisWidth method to update the width of the y-axis. */ updateLabels(): void; }