UNPKG

1.56 kBTypeScriptView Raw
1import { Point } from '../../../dependents';
2import { FilterCondition, EventPayload } from '../../../interface';
3import { View } from '../../../chart';
4import Action from '../base';
5/** range-filter 只用于:brush-filter, brush-x-filter, brush-y-filter */
6declare enum EVENTS {
7 FILTER = "brush-filter-processing",
8 RESET = "brush-filter-reset",
9 BEFORE_FILTER = "brush-filter:beforefilter",
10 AFTER_FILTER = "brush-filter:afterfilter",
11 BEFORE_RESET = "brush-filter:beforereset",
12 AFTER_RESET = "brush-filter:afterreset"
13}
14export { EVENTS as BRUSH_FILTER_EVENTS };
15/**
16 * 范围过滤的 Action
17 * @ignore
18 */
19declare class RangeFilter extends Action {
20 /** 允许外部传入 dims */
21 protected cfgFields: ['dims'];
22 /**
23 * 范围过滤生效的字段/维度,可以是 x, y
24 */
25 protected dims: string[];
26 /** 起始点 */
27 protected startPoint: Point;
28 private isStarted;
29 private hasDim;
30 /**
31 * 开始范围过滤,记录范围过滤的起点
32 */
33 start(): void;
34 /**
35 * 过滤,以开始的点和当前点对数据进行过滤
36 */
37 filter(): void;
38 /**
39 * 结束
40 */
41 end(): void;
42 /**
43 * 取消同当前 Action 相关的过滤,指定的 x,y
44 */
45 reset(): void;
46 /**
47 * 对 view 进行过滤
48 */
49 protected filterView(view: View, field: string, filter: FilterCondition): void;
50 /**
51 * 重新渲染
52 * @param view
53 */
54 protected reRender(view: View, payload?: EventPayload): void;
55}
56export default RangeFilter;