zhangjian
2023-06-05 0976d2d0f90cff460cedfdc8bd74e98c2c31a58c
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
93
94
95
import * as matrix from 'zrender/lib/core/matrix.js';
import ParallelAxis from './ParallelAxis.js';
import * as graphic from '../../util/graphic.js';
import ParallelModel from './ParallelModel.js';
import GlobalModel from '../../model/Global.js';
import ExtensionAPI from '../../core/ExtensionAPI.js';
import { DimensionName, ScaleDataValue } from '../../util/types.js';
import { CoordinateSystem, CoordinateSystemMaster } from '../CoordinateSystem.js';
import { ParallelActiveState } from './AxisModel.js';
import SeriesData from '../../data/SeriesData.js';
export interface ParallelAxisLayoutInfo {
    position: number[];
    rotation: number;
    transform: matrix.MatrixArray;
    axisNameAvailableWidth: number;
    axisLabelShow: boolean;
    nameTruncateMaxWidth: number;
    tickDirection: -1 | 1;
    labelDirection: -1 | 1;
}
declare type SlidedAxisExpandBehavior = 'none' | 'slide' | 'jump';
declare class Parallel implements CoordinateSystemMaster, CoordinateSystem {
    readonly type = "parallel";
    /**
     * key: dimension
     */
    private _axesMap;
    /**
     * key: dimension
     * value: {position: [], rotation, }
     */
    private _axesLayout;
    /**
     * Always follow axis order.
     */
    readonly dimensions: ParallelModel['dimensions'];
    private _rect;
    private _model;
    name: string;
    model: ParallelModel;
    constructor(parallelModel: ParallelModel, ecModel: GlobalModel, api: ExtensionAPI);
    private _init;
    /**
     * Update axis scale after data processed
     */
    update(ecModel: GlobalModel, api: ExtensionAPI): void;
    containPoint(point: number[]): boolean;
    getModel(): ParallelModel;
    /**
     * Update properties from series
     */
    private _updateAxesFromSeries;
    /**
     * Resize the parallel coordinate system.
     */
    resize(parallelModel: ParallelModel, api: ExtensionAPI): void;
    getRect(): graphic.BoundingRect;
    private _makeLayoutInfo;
    private _layoutAxes;
    /**
     * Get axis by dim.
     */
    getAxis(dim: DimensionName): ParallelAxis;
    /**
     * Convert a dim value of a single item of series data to Point.
     */
    dataToPoint(value: ScaleDataValue, dim: DimensionName): number[];
    /**
     * Travel data for one time, get activeState of each data item.
     * @param start the start dataIndex that travel from.
     * @param end the next dataIndex of the last dataIndex will be travel.
     */
    eachActiveState(data: SeriesData, callback: (activeState: ParallelActiveState, dataIndex: number) => void, start?: number, end?: number): void;
    /**
     * Whether has any activeSet.
     */
    hasAxisBrushed(): boolean;
    /**
     * Convert coords of each axis to Point.
     *  Return point. For example: [10, 20]
     */
    axisCoordToPoint(coord: number, dim: DimensionName): number[];
    /**
     * Get axis layout.
     */
    getAxisLayout(dim: DimensionName): ParallelAxisLayoutInfo;
    /**
     * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.
     */
    getSlidedAxisExpandWindow(point: number[]): {
        axisExpandWindow: number[];
        behavior: SlidedAxisExpandBehavior;
    };
}
export default Parallel;