@antv/g2plot
Version:
G2 Plot, a market of plots built with the Grammar of Graphics'
93 lines (92 loc) • 3.44 kB
TypeScript
import { LayerConfig } from '../../base/layer';
import ViewLayer, { ViewConfig } from '../../base/view-layer';
import { ElementOption, DataItem } from '../../interface/config';
import './theme';
import './component/label/funnel-label';
import './animation/funnel-scale-in-x';
import './animation/funnel-scale-in-y';
import './geometry/shape/funnel-basic-rect';
import './geometry/shape/funnel-dynamic-rect';
export interface FunnelStyle {
[k: string]: any;
}
export interface FunnelViewConfig extends ViewConfig {
funnelStyle?: FunnelStyle | ((...args: any[]) => FunnelStyle);
percentage?: Partial<{
visible: boolean;
line: Partial<{
visible: boolean;
style: {};
}>;
text: Partial<{
visible: boolean;
content: string;
style: {};
}>;
value: Partial<{
visible: boolean;
style: {};
formatter: (yValueUpper: any, yValueLower: any) => string;
}>;
offsetX: number;
offsetY: number;
spacing: number;
}>;
transpose?: boolean;
dynamicHeight?: boolean;
compareField?: string;
compareText: Partial<{
visible: boolean;
offsetX: number;
offsetY: number;
style: {};
}>;
}
export interface FunnelLayerConfig extends FunnelViewConfig, LayerConfig {
}
export default class FunnelLayer<T extends FunnelLayerConfig = FunnelLayerConfig> extends ViewLayer<T> {
static getDefaultOptions(props?: Partial<FunnelViewConfig>): Partial<FunnelViewConfig>;
funnel: any;
type: string;
private animationAppearTimeoutHandler;
private legendsListenerAttached;
private shouldShowLabels;
private shouldResetPercentages;
private shouldResetCompareTexts;
constructor(props: T);
protected coord(): void;
protected axis(): void;
protected adjustFunnel(funnel: ElementOption): void;
protected tooltip(): void;
protected addGeometry(): void;
protected animation(): void;
protected geometryParser(dim: any, type: any): any;
afterRender(): void;
updateConfig(cfg: Partial<T>): void;
changeData(data: DataItem[]): void;
protected extractLabel(): false | import("../../interface/types").LooseMap<any>;
protected showLabels(shape?: any): void;
protected adjustProps(props: Partial<T>): Partial<T>;
protected resetPercentages(): void;
protected fadeInPercentages(duration?: any, callback?: any): void;
protected fadeOutPercentages(duration?: any, callback?: any): void;
protected refreshPercentages(callback?: any): void;
private _calcRefreshFadeDurations;
private _findPercentageContainer;
private _findPercentageMembersInContainerByShape;
private _genCustomFieldForDynamicHeight;
protected resetCompareTexts(): void;
protected fadeInCompareTexts(duration?: any, callback?: any): void;
protected fadeOutCompareTexts(duration?: any, callback?: any): void;
protected refreshCompareTexts(callback?: any): void;
private _findCompareTextContainer;
private _reduceDataForCompare;
private _updateDataForCompare;
private _findCheckedData;
private _findCheckedDataInNewData;
private _findCheckedDataByMouseDownLegendItem;
private _setupAnimationMask;
private _teardownAnimationMask;
private _refreshAnimationMaskForPercentageRefresh;
private _onLegendContainerMouseDown;
}