import type { Animation } from "../util/Entity"; import type { Time } from "../util/Animation"; import type { Sprite } from "./Sprite"; import { RoundedRectangle } from "../render/RoundedRectangle"; import { Container, IContainerPrivate, IContainerSettings, IContainerEvents } from "./Container"; import { Button } from "./Button"; export interface IScrollbarSettings extends IContainerSettings { /** * Orientation of the scrollbar. */ orientation: "horizontal" | "vertical"; /** * Start of the selected range, from `0` to `1`: `0` is the left end, or * the top on a vertical scrollbar. * * @default 0 */ start?: number; /** * End of the selected range, from `0` to `1`: `1` is the right end, or * the bottom on a vertical scrollbar. * * @default 1 */ end?: number; /** * Duration in milliseconds of scroll animations, such as after a click on * the scrollbar's background. */ animationDuration?: number; /** * Easing function of scroll animations. * * @see {@link https://docs.amcharts.com/v5/concepts/animations/#easing-functions} for more info */ animationEasing?: (t: Time) => Time; /** * Puts the scrollbar on the opposite side of the chart: a horizontal * scrollbar below the plot area instead of above it, a vertical one on the * left instead of the right. It can be changed at any time. * * Works only for scrollbars set as a chart's `scrollbarX` or `scrollbarY`. * * @default false * @since 5.20.2 */ opposite?: boolean; /** * Where the scrollbar sits relative to the axes on its side: `true` beyond * them (outermost), `false` between them and the plot area. If not set, * the chart decides. It can be changed at any time. * * Like `opposite`, works only for scrollbars set as a chart's `scrollbarX` * or `scrollbarY`. * * @since 5.21.0 */ outsideAxes?: boolean; /** * Hides the scrollbar where the chart is this many pixels across it or * less: a vertical scrollbar when the chart is that narrow, a horizontal * one when it is that low, so the plot gets the room. While it is hidden, * the chart turns on `pinchZoomX` or `pinchZoomY`, unless that is set in * code, as on a phone a chart is zoomed by pinching. A scrollbar with * `forceHidden` set in code is left alone. On a stock chart, the whole * stock chart is measured, not the panel the scrollbar is on. * * Works only for scrollbars set as a chart's `scrollbarX` or `scrollbarY`. * * @since 5.22.0 * @see {@link https://docs.amcharts.com/v5/charts/xy-chart/scrollbars/#hiding-on-small-charts} for more info */ autoHide?: number; } export interface IScrollbarPrivate extends IContainerPrivate { /** * Whether `autoHide` hides the scrollbar. * * @ignore */ autoHidden?: boolean; /** * @ignore */ isBusy?: boolean; /** * @ignore */ positionTextFunction?: (position: number, isEnd?: boolean) => string; /** * Returns `true` if values go against the scrollbar's direction (bottom to * top on a vertical one). Screen readers then read the start grip as the * end of the range and the end grip as its start, and `positionTextFunction` * gets positions flipped (`1 - position`). * * @ignore */ reversedFunction?: () => boolean; } export interface IScrollbarEvents extends IContainerEvents { /** * The selected range (`start` or `end`) changed. */ rangechanged: { start: number; end: number; grip?: "start" | "end"; }; /** * The pointer was released after pressing a grip or the thumb. */ released: {}; } /** * A control for selecting a range, such as the zoom of a chart's axes: the * grips resize the range, the thumb between them moves it. * * @see {@link https://docs.amcharts.com/v5/charts/xy-chart/scrollbars/} for more info */ export declare class Scrollbar extends Container { _addOrientationClass(): void; _settings: IScrollbarSettings; _privateSettings: IScrollbarPrivate; _events: IScrollbarEvents; static className: string; static classNames: Array; /** * The draggable bar between the grips, which moves the selected range. * Double-clicking it selects the full range. */ thumb: RoundedRectangle; /** * The grip that drags the start of the range. */ startGrip: Button; /** * The grip that drags the end of the range. */ endGrip: Button; protected _thumbBusy: boolean; protected _startDown: boolean; protected _endDown: boolean; protected _thumbDown: boolean; protected _gripDown?: "start" | "end"; protected _makeButton(): Button; protected _makeThumb(): RoundedRectangle; protected _handleAnimation(animation: Animation): void; protected _afterNew(): void; _updateChildren(): void; _changed(): void; protected _released(): void; /** * @ignore */ updateGrips(): void; protected _setAria(target: Sprite, key: "ariaLabel" | "ariaValueNow" | "ariaValueText" | "ariaValueMin" | "ariaValueMax", value: string): void; /** * The selected range as screen readers read it: percentages and texts for * its start and end, in the direction values go. */ protected _readout(): { from: number; to: number; fromText: string; toText: string; reversed: boolean; }; protected _updateThumb(): void; protected _updateGripsByThumb(): void; } //# sourceMappingURL=Scrollbar.d.ts.map