@visactor/vrender-components
Version:
components library for dp visualization
128 lines (127 loc) • 4 kB
TypeScript
import type { IGroup, ISymbol, IGraphic, ISymbolGraphicAttribute, IText } from '@visactor/vrender-core';
import { AbstractComponent } from '../core/base';
import type { SliderAttributes } from './type';
import type { ComponentOptions } from '../interface';
export declare class Slider extends AbstractComponent<Required<SliderAttributes>> {
name: string;
static defaultAttributes: {
slidable: boolean;
layout: string;
align: string;
height: number;
showHandler: boolean;
handlerSize: number;
handlerStyle: {
symbolType: string;
fill: string;
stroke: string;
lineWidth: number;
};
tooltip: {
shapeStyle: {
symbolType: string;
fill: string;
stroke: string;
lineWidth: number;
};
text: {
style: {
fill: string;
fontSize: number;
};
};
};
railStyle: {
fill: string;
};
trackStyle: {
fill: string;
};
showValue: boolean;
valueStyle: {
fill: string;
fontSize: number;
};
startText: {
style: {
fill: string;
fontSize: number;
};
};
endText: {
style: {
fill: string;
fontSize: number;
};
};
handlerText: {
visible: boolean;
space: number;
precision: number;
style: {
fill: string;
fontSize: number;
};
};
};
protected _isHorizontal: boolean;
protected _innerView: IGroup;
protected _mainContainer: IGroup;
protected _startHandler: ISymbol | null;
protected _endHandler: ISymbol | null;
protected _startHandlerText: IText | null;
protected _endHandlerText: IText | null;
protected _railContainer: IGroup;
protected _rail: IGraphic;
protected _track: IGraphic;
private _prePos;
private _currentHandler;
private _currentValue;
private _tooltipState;
private _isChanging?;
protected _tooltipShape?: ISymbol;
protected _tooltipText?: IText;
get track(): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
get currentValue(): {
startValue?: number;
endValue?: number;
startPos?: number;
endPos?: number;
};
get startHandler(): ISymbol;
get endHandler(): ISymbol;
get tooltipShape(): ISymbol;
constructor(attributes: SliderAttributes, options?: ComponentOptions);
protected calculatePosByValue(value: number, pos?: 'start' | 'end'): number;
protected calculateValueByPos(pos: number): number;
setValue(value: number | number[]): void;
render(): void;
protected _renderRail(container: IGroup): import("@visactor/vrender-core").IRect;
protected _renderHandlers(container: IGroup): void;
protected _renderTrack(container: IGroup): void;
protected _renderHandler(style: Partial<ISymbolGraphicAttribute>): ISymbol;
private _renderHandlerText;
private _renderTooltip;
private _updateTooltip;
private _bindEvents;
private _bindTooltipEvents;
private _onTooltipShow;
private _onTooltipUpdate;
private _onTooltipHide;
private _onHandlerPointerdown;
private _clearAllDragEvents;
private _onHandlerPointerMove;
private _onHandlerPointerUp;
private _handleTouchMove;
private _onTrackPointerdown;
private _onTrackPointerMove;
private _onTrackPointerUp;
private _onRailPointerDown;
private _updateTrack;
private _updateHandler;
private _updateHandlerText;
private _dispatchChangeEvent;
private _dispatchTooltipEvent;
private _getHandlers;
release(all?: boolean): void;
}