liusuyi
2023-04-24 4737f1e038743ced243c9e52423404d9034d6107
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import { ComponentOption, ZRColor, VisualOptionFixed } from '../../util/types.js';
import ComponentModel from '../../model/Component.js';
import BrushTargetManager from '../helper/BrushTargetManager.js';
import { BrushCoverCreatorConfig, BrushMode, BrushCoverConfig, BrushDimensionMinMax, BrushAreaRange, BrushTypeUncertain, BrushType } from '../helper/BrushController.js';
import { ModelFinderObject } from '../../util/model.js';
/**
 * The input to define brush areas.
 * (1) Can be created by user when calling dispatchAction.
 * (2) Can be created by `BrushController`
 * for brush behavior. area params are picked from `cover.__brushOptoin`.
 * In `BrushController`, "covers" are create or updated for each "area".
 */
export interface BrushAreaParam extends ModelFinderObject {
    brushType: BrushCoverConfig['brushType'];
    id?: BrushCoverConfig['id'];
    range?: BrushCoverConfig['range'];
    panelId?: BrushCoverConfig['panelId'];
    coordRange?: BrushAreaRange;
    coordRanges?: BrushAreaRange[];
    __rangeOffset?: {
        offset: BrushDimensionMinMax[] | BrushDimensionMinMax;
        xyMinMax: BrushDimensionMinMax[];
    };
}
/**
 * Generated by `brushModel.setAreas`, which merges
 * `area: BrushAreaParam` and `brushModel.option: BrushOption`.
 * See `generateBrushOption`.
 */
export interface BrushAreaParamInternal extends BrushAreaParam {
    brushMode: BrushMode;
    brushStyle: BrushCoverConfig['brushStyle'];
    transformable: BrushCoverConfig['transformable'];
    removeOnClick: BrushCoverConfig['removeOnClick'];
    z: BrushCoverConfig['z'];
    __rangeOffset?: {
        offset: BrushDimensionMinMax | BrushDimensionMinMax[];
        xyMinMax: BrushDimensionMinMax[];
    };
}
export declare type BrushToolboxIconType = BrushType | 'keep' | 'clear';
export interface BrushOption extends ComponentOption, ModelFinderObject {
    mainType?: 'brush';
    toolbox?: BrushToolboxIconType[];
    brushLink?: number[] | 'all' | 'none';
    throttleType?: 'fixRate' | 'debounce';
    throttleDelay?: number;
    inBrush?: VisualOptionFixed;
    outOfBrush?: VisualOptionFixed;
    brushType?: BrushTypeUncertain;
    brushStyle?: {
        borderWidth?: number;
        color?: ZRColor;
        borderColor?: ZRColor;
    };
    transformable?: boolean;
    brushMode?: BrushMode;
    removeOnClick?: boolean;
}
declare class BrushModel extends ComponentModel<BrushOption> {
    static type: "brush";
    type: "brush";
    static dependencies: string[];
    static defaultOption: BrushOption;
    /**
     * @readOnly
     */
    areas: BrushAreaParamInternal[];
    /**
     * Current activated brush type.
     * If null, brush is inactived.
     * see module:echarts/component/helper/BrushController
     * @readOnly
     */
    brushType: BrushTypeUncertain;
    /**
     * Current brush painting area settings.
     * @readOnly
     */
    brushOption: BrushCoverCreatorConfig;
    brushTargetManager: BrushTargetManager;
    optionUpdated(newOption: BrushOption, isInit: boolean): void;
    /**
     * If `areas` is null/undefined, range state remain.
     */
    setAreas(areas?: BrushAreaParam[]): void;
    /**
     * Set the current painting brush option.
     */
    setBrushOption(brushOption: BrushCoverCreatorConfig): void;
}
export default BrushModel;