@visactor/vchart-types 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/animation/utils.d.ts +1 -0
- package/types/chart/bar/bar-3d.d.ts +2 -2
- package/types/chart/cartesian/interface.d.ts +1 -1
- package/types/component/axis/cartesian/util/common.d.ts +0 -2
- package/types/component/axis/interface/common.d.ts +1 -0
- package/types/component/axis/polar/interface/common.d.ts +2 -3
- package/types/component/crosshair/base.d.ts +4 -5
- package/types/component/crosshair/cartesian.d.ts +11 -34
- package/types/component/crosshair/config.d.ts +6 -0
- package/types/component/crosshair/interface/spec.d.ts +7 -3
- package/types/component/crosshair/polar.d.ts +12 -54
- package/types/component/legend/continuous/interface.d.ts +1 -0
- package/types/component/marker/base-marker.d.ts +22 -24
- package/types/component/marker/interface.d.ts +19 -9
- package/types/component/marker/mark-area/interface/spec.d.ts +10 -12
- package/types/component/marker/mark-area/mark-area.d.ts +3 -2
- package/types/component/marker/mark-line/interface/spec.d.ts +20 -9
- package/types/component/marker/mark-line/mark-line.d.ts +4 -2
- package/types/component/marker/mark-point/interface/spec.d.ts +8 -6
- package/types/component/marker/mark-point/mark-point.d.ts +3 -2
- package/types/component/marker/utils.d.ts +13 -2
- package/types/data/transforms/aggregation.d.ts +3 -3
- package/types/model/interface.d.ts +1 -0
- package/types/series/util/utils.d.ts +5 -0
- package/types/typings/visual.d.ts +3 -2
|
@@ -8,6 +8,7 @@ import type { ISeriesMarkAttributeContext } from '../compile/mark';
|
|
|
8
8
|
export declare const AnimationStates: string[];
|
|
9
9
|
export declare function animationConfig<Preset extends string>(defaultConfig?: MarkAnimationSpec, userConfig?: Partial<Record<IAnimationState, boolean | IStateAnimateSpec<Preset> | IAnimationConfig | IAnimationConfig[]>>, params?: {
|
|
10
10
|
dataIndex: (datum: any) => number;
|
|
11
|
+
dataCount: () => number;
|
|
11
12
|
}): MarkAnimationSpec;
|
|
12
13
|
export declare function userAnimationConfig<M extends string, Preset extends string>(markName: SeriesMarkNameEnum | string, spec: IAnimationSpec<M, Preset>, ctx: ISeriesMarkAttributeContext): Partial<Record<"none" | "normal" | "state" | "update" | "appear" | "enter" | "exit" | "disappear", boolean | IAnimationConfig | IAnimationConfig[] | IStateAnimateSpec<string>>>;
|
|
13
14
|
export declare function shouldMarkDoMorph(spec: ISeriesSpec & IAnimationSpec<string, string>, markName: string): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class Bar3dChart extends
|
|
1
|
+
import { BarChart } from './bar';
|
|
2
|
+
export declare class Bar3dChart extends BarChart {
|
|
3
3
|
static readonly type: string;
|
|
4
4
|
static readonly view: string;
|
|
5
5
|
readonly type: string;
|
|
@@ -10,6 +10,6 @@ export interface ICartesianChartSpec extends IChartSpec {
|
|
|
10
10
|
axes?: ICartesianAxisSpec[];
|
|
11
11
|
crosshair?: ICartesianCrosshairSpec | ICartesianCrosshairSpec[];
|
|
12
12
|
markLine?: IMarkLineSpec | IMarkLineSpec[];
|
|
13
|
-
markArea?: IMarkAreaSpec |
|
|
13
|
+
markArea?: IMarkAreaSpec | IMarkAreaSpec[];
|
|
14
14
|
markPoint?: IMarkPointSpec | IMarkPointSpec[];
|
|
15
15
|
}
|
|
@@ -9,5 +9,3 @@ export declare function getOrient(spec: ICartesianAxisCommonSpec, whiteList?: st
|
|
|
9
9
|
export declare function getDirectionByOrient(orient: IOrientType): Direction;
|
|
10
10
|
export declare function isOrientInSameDirection(orient1: IOrientType, orient2: IOrientType): boolean;
|
|
11
11
|
export declare function transformInverse(spec: ICartesianAxisCommonSpec, isHorizontal: boolean): boolean;
|
|
12
|
-
export declare function scaleWholeRangeSize(count: number, bandwidth: number, paddingInner: number, paddingOuter: number): number;
|
|
13
|
-
export declare function bandSpace(count: number, paddingInner: number, paddingOuter: number): number;
|
|
@@ -15,6 +15,7 @@ export interface IAxis extends IComponent {
|
|
|
15
15
|
getScales: () => IBaseScale[];
|
|
16
16
|
getOrient: () => ICartesianAxisSpec['orient'] | IPolarOrientType;
|
|
17
17
|
visible: boolean;
|
|
18
|
+
directionStr?: 'l2r' | 'r2l' | 't2b' | 'b2t';
|
|
18
19
|
}
|
|
19
20
|
export interface IAxisItem<T> {
|
|
20
21
|
visible?: boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IBaseScale } from '@visactor/vscale';
|
|
2
|
-
import type { IComponent } from '../../../interface';
|
|
3
2
|
import type { IPoint, IPolarOrientType, IPolarPoint } from '../../../../typings';
|
|
4
|
-
import type { IGrid } from '../../interface';
|
|
3
|
+
import type { IAxis, IGrid } from '../../interface';
|
|
5
4
|
import type { ICompilableData } from '../../../../compile/data';
|
|
6
5
|
export type IPolarGrid = IGrid & {
|
|
7
6
|
smooth?: boolean;
|
|
@@ -16,7 +15,7 @@ export interface IPolarAxisHelper {
|
|
|
16
15
|
getBandwidth?: (depth?: number) => number;
|
|
17
16
|
getAxisId: () => number;
|
|
18
17
|
}
|
|
19
|
-
export interface IPolarAxis extends
|
|
18
|
+
export interface IPolarAxis extends IAxis {
|
|
20
19
|
startAngle: number;
|
|
21
20
|
endAngle: number;
|
|
22
21
|
getOrient: () => IPolarOrientType;
|
|
@@ -6,13 +6,13 @@ import type { IPadding, Maybe, StringOrNumber } from '../../typings';
|
|
|
6
6
|
import type { IComponentOption } from '../interface';
|
|
7
7
|
import type { ICrossHair, CrossHairTrigger, ICartesianCrosshairSpec, IPolarCrosshairSpec, ICrosshairTheme, ICrosshairCategoryFieldSpec } from './interface';
|
|
8
8
|
import type { IAxis } from '../axis/interface';
|
|
9
|
-
type IBound = {
|
|
9
|
+
export type IBound = {
|
|
10
10
|
x1: number;
|
|
11
11
|
y1: number;
|
|
12
12
|
x2: number;
|
|
13
13
|
y2: number;
|
|
14
14
|
};
|
|
15
|
-
type IAxisInfo<T> = Map<number, IBound & {
|
|
15
|
+
export type IAxisInfo<T> = Map<number, IBound & {
|
|
16
16
|
axis: T;
|
|
17
17
|
}>;
|
|
18
18
|
export interface IHair {
|
|
@@ -40,14 +40,14 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
|
|
|
40
40
|
triggerOff: CrossHairTrigger | 'none';
|
|
41
41
|
protected _theme: Maybe<ICrosshairTheme>;
|
|
42
42
|
get enableRemain(): boolean;
|
|
43
|
-
protected _crosshairConfig: ICartesianCrosshairSpec | IPolarCrosshairSpec;
|
|
44
43
|
private _limitBounds;
|
|
45
44
|
constructor(spec: T, options: IComponentOption);
|
|
46
|
-
protected abstract
|
|
45
|
+
protected abstract _showDefaultCrosshairBySpec(): void;
|
|
47
46
|
protected abstract _layoutCrosshair(x: number, y: number): void;
|
|
48
47
|
protected abstract _parseFieldInfo(): void;
|
|
49
48
|
abstract hide(): void;
|
|
50
49
|
protected _getLimitBounds(): IBoundsLike;
|
|
50
|
+
protected _showDefaultCrosshair(): void;
|
|
51
51
|
setAttrFromSpec(): void;
|
|
52
52
|
created(): void;
|
|
53
53
|
_compareSpec(): {
|
|
@@ -73,4 +73,3 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
|
|
|
73
73
|
protected _parseField(field: ICrosshairCategoryFieldSpec, fieldName: string): any;
|
|
74
74
|
protected _filterAxisByPoint<T>(axisMap: IAxisInfo<T>, relativeX: number, relativeY: number): IAxisInfo<T>;
|
|
75
75
|
}
|
|
76
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IComponentOption } from '../interface';
|
|
2
2
|
import { ComponentTypeEnum } from '../interface/type';
|
|
3
3
|
import type { ICartesianCrosshairSpec } from './interface';
|
|
4
|
-
import type { IHair } from './base';
|
|
5
4
|
import { BaseCrossHair } from './base';
|
|
6
5
|
import type { IGraphic } from '@visactor/vrender-core';
|
|
7
6
|
import type { IAxis } from '../axis/interface';
|
|
@@ -12,16 +11,8 @@ export declare class CartesianCrossHair<T extends ICartesianCrosshairSpec = ICar
|
|
|
12
11
|
static type: ComponentTypeEnum;
|
|
13
12
|
type: ComponentTypeEnum;
|
|
14
13
|
name: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
axis: IAxis;
|
|
18
|
-
}>;
|
|
19
|
-
currValueY: Map<number, {
|
|
20
|
-
v: StringOrNumber;
|
|
21
|
-
axis: IAxis;
|
|
22
|
-
}>;
|
|
23
|
-
xHair: IHair | undefined;
|
|
24
|
-
yHair: IHair | undefined;
|
|
14
|
+
private _xHair;
|
|
15
|
+
private _yHair;
|
|
25
16
|
private _cacheXCrossHairInfo;
|
|
26
17
|
private _cacheYCrossHairInfo;
|
|
27
18
|
private _xCrosshair;
|
|
@@ -30,37 +21,23 @@ export declare class CartesianCrossHair<T extends ICartesianCrosshairSpec = ICar
|
|
|
30
21
|
private _yCrosshair;
|
|
31
22
|
private _yLeftLabel;
|
|
32
23
|
private _yRightLabel;
|
|
24
|
+
private _currValueX;
|
|
25
|
+
private _currValueY;
|
|
33
26
|
static createComponent(spec: any, options: IComponentOption): CartesianCrossHair<any> | CartesianCrossHair<ICartesianCrosshairSpec>[];
|
|
34
27
|
constructor(spec: T, options: IComponentOption);
|
|
35
|
-
protected
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
x1: number;
|
|
40
|
-
y1: number;
|
|
41
|
-
x2: number;
|
|
42
|
-
y2: number;
|
|
43
|
-
} & {
|
|
44
|
-
axis: IAxis;
|
|
45
|
-
}>;
|
|
46
|
-
yAxisMap: Map<number, {
|
|
47
|
-
x1: number;
|
|
48
|
-
y1: number;
|
|
49
|
-
x2: number;
|
|
50
|
-
y2: number;
|
|
51
|
-
} & {
|
|
52
|
-
axis: IAxis;
|
|
53
|
-
}>;
|
|
54
|
-
};
|
|
55
|
-
private getValueAt;
|
|
28
|
+
protected _showDefaultCrosshairBySpec(): void;
|
|
29
|
+
private _defaultCrosshair;
|
|
30
|
+
private _findAllAxisContains;
|
|
31
|
+
private _getValueAt;
|
|
56
32
|
clearAxisValue(): void;
|
|
57
33
|
setAxisValue(v: StringOrNumber, axis: IAxis): void;
|
|
58
|
-
private
|
|
34
|
+
private _getAllAxisValues;
|
|
59
35
|
protected _layoutCrosshair(relativeX: number, relativeY: number): void;
|
|
60
36
|
hide(): void;
|
|
61
|
-
|
|
37
|
+
layoutByValue(tag?: number): void;
|
|
62
38
|
private _layoutVertical;
|
|
63
39
|
private _layoutHorizontal;
|
|
40
|
+
private _getRectSize;
|
|
64
41
|
protected _parseFieldInfo(): void;
|
|
65
42
|
private _updateCrosshair;
|
|
66
43
|
private _updateCrosshairLabel;
|
|
@@ -25,10 +25,10 @@ export interface IPolarCrosshairSpec extends ICommonCrosshairSpec {
|
|
|
25
25
|
}
|
|
26
26
|
export interface ICrosshairCategoryFieldSpec extends ICrosshairDataBindSpec {
|
|
27
27
|
visible: boolean;
|
|
28
|
-
line?: ICrosshairLineSpec | ICrosshairRectSpec
|
|
28
|
+
line?: ICrosshairLineSpec | Omit<ICrosshairRectSpec, 'width'>;
|
|
29
29
|
label?: ICrosshairLabelSpec;
|
|
30
30
|
}
|
|
31
|
-
export interface ICrosshairValueFieldSpec {
|
|
31
|
+
export interface ICrosshairValueFieldSpec extends ICrosshairDataBindSpec {
|
|
32
32
|
visible: boolean;
|
|
33
33
|
line?: ICrosshairLineSpec;
|
|
34
34
|
label?: ICrosshairLabelSpec;
|
|
@@ -42,10 +42,14 @@ export interface ICrosshairLineSpec {
|
|
|
42
42
|
smooth?: boolean;
|
|
43
43
|
style?: ICrosshairLineStyle;
|
|
44
44
|
}
|
|
45
|
+
export type ICrosshairRectWidthCallback = (axisSize: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
}, axis: IAxis) => number;
|
|
45
49
|
export interface ICrosshairRectSpec {
|
|
46
50
|
visible?: boolean;
|
|
47
51
|
type?: 'rect';
|
|
48
|
-
width?: number | string;
|
|
52
|
+
width?: number | string | ICrosshairRectWidthCallback;
|
|
49
53
|
style?: ICrosshairRectStyle;
|
|
50
54
|
}
|
|
51
55
|
export interface ICrosshairLabelSpec {
|
|
@@ -1,75 +1,34 @@
|
|
|
1
1
|
import type { IComponentOption } from '../interface';
|
|
2
2
|
import { ComponentTypeEnum } from '../interface/type';
|
|
3
3
|
import type { IPolarCrosshairSpec } from './interface';
|
|
4
|
-
import type { IPolarAxis } from '../axis/polar/interface';
|
|
5
|
-
import type { IPoint, StringOrNumber } from '../../typings';
|
|
6
|
-
import type { IHair } from './base';
|
|
7
4
|
import { BaseCrossHair } from './base';
|
|
8
5
|
import type { IGraphic } from '@visactor/vrender-core';
|
|
9
|
-
type IBound = {
|
|
10
|
-
x1: number;
|
|
11
|
-
y1: number;
|
|
12
|
-
x2: number;
|
|
13
|
-
y2: number;
|
|
14
|
-
};
|
|
15
|
-
type IAxisInfo = Map<number, IBound & {
|
|
16
|
-
axis: IPolarAxis;
|
|
17
|
-
}>;
|
|
18
6
|
export declare class PolarCrossHair<T extends IPolarCrosshairSpec = IPolarCrosshairSpec> extends BaseCrossHair<T> {
|
|
19
7
|
static specKey: string;
|
|
20
8
|
specKey: string;
|
|
21
9
|
static type: ComponentTypeEnum;
|
|
22
10
|
type: ComponentTypeEnum;
|
|
23
11
|
name: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
v: StringOrNumber;
|
|
31
|
-
axis: IPolarAxis;
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
}>;
|
|
34
|
-
xHair: IHair | undefined;
|
|
35
|
-
yHair: (IHair & {
|
|
36
|
-
smooth: boolean;
|
|
37
|
-
}) | undefined;
|
|
38
|
-
private _cacheXCrossHairInfo;
|
|
39
|
-
private _cacheYCrossHairInfo;
|
|
12
|
+
private _currValueAngle;
|
|
13
|
+
private _currValueRadius;
|
|
14
|
+
private _angleHair;
|
|
15
|
+
private _radiusHair;
|
|
16
|
+
private _cacheAngleCrossHairInfo;
|
|
17
|
+
private _cacheRadiusCrossHairInfo;
|
|
40
18
|
private _radiusCrosshair;
|
|
41
19
|
private _radiusLabelCrosshair;
|
|
42
20
|
private _angleCrosshair;
|
|
43
21
|
private _angleLabelCrosshair;
|
|
44
22
|
static createComponent(spec: any, options: IComponentOption): PolarCrossHair<any> | PolarCrossHair<IPolarCrosshairSpec>[];
|
|
45
23
|
constructor(spec: T, options: IComponentOption);
|
|
46
|
-
protected
|
|
24
|
+
protected _showDefaultCrosshairBySpec(): void;
|
|
25
|
+
private _defaultCrosshair;
|
|
47
26
|
hide(): void;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
y1: number;
|
|
52
|
-
x2: number;
|
|
53
|
-
y2: number;
|
|
54
|
-
} & {
|
|
55
|
-
axis: IPolarAxis;
|
|
56
|
-
}>;
|
|
57
|
-
yAxisMap: Map<number, {
|
|
58
|
-
x1: number;
|
|
59
|
-
y1: number;
|
|
60
|
-
x2: number;
|
|
61
|
-
y2: number;
|
|
62
|
-
} & {
|
|
63
|
-
axis: IPolarAxis;
|
|
64
|
-
}>;
|
|
65
|
-
};
|
|
66
|
-
getAllAxisValues(axisMap: IAxisInfo, point: IPoint, currValue: Map<number, {
|
|
67
|
-
v: StringOrNumber;
|
|
68
|
-
axis: IPolarAxis;
|
|
69
|
-
[key: string]: any;
|
|
70
|
-
}>): boolean;
|
|
27
|
+
private _findAllAxisContains;
|
|
28
|
+
private _getAllAxisValues;
|
|
29
|
+
private _getValueByAxis;
|
|
71
30
|
protected _layoutCrosshair(relativeX: number, relativeY: number): void;
|
|
72
|
-
|
|
31
|
+
layoutByValue(tag?: number): void;
|
|
73
32
|
private _layoutVertical;
|
|
74
33
|
private _layoutHorizontal;
|
|
75
34
|
protected _parseFieldInfo(): void;
|
|
@@ -77,4 +36,3 @@ export declare class PolarCrossHair<T extends IPolarCrosshairSpec = IPolarCrossh
|
|
|
77
36
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
78
37
|
}
|
|
79
38
|
export declare const registerPolarCrossHair: () => void;
|
|
80
|
-
export {};
|
|
@@ -41,6 +41,7 @@ export type IColorLegendSpec = IContinuousLegendSpec & {
|
|
|
41
41
|
export type ISizeLegendSpec = IContinuousLegendSpec & {
|
|
42
42
|
type: 'size';
|
|
43
43
|
sizeBackground?: Omit<NoVisibleMarkStyle<IRectMarkSpec>, 'visible' | 'width' | 'height'>;
|
|
44
|
+
align?: 'top' | 'bottom' | 'left' | 'right';
|
|
44
45
|
};
|
|
45
46
|
export type IContinuousLegendTheme = Omit<IContinuousLegendSpec, 'type' | 'field' | 'scale' | 'regionIndex' | 'regionId' | 'seriesIndex' | 'seriesId' | 'id' | 'defaultSelected'>;
|
|
46
47
|
export interface IColorLegendTheme {
|
|
@@ -2,11 +2,11 @@ import type { DataView } from '@visactor/vdataset';
|
|
|
2
2
|
import type { IModelRenderOption } from '../../model/interface';
|
|
3
3
|
import type { IRegion } from '../../region/interface';
|
|
4
4
|
import type { ICartesianSeries } from '../../series/interface';
|
|
5
|
-
import type { ILayoutRect, ILayoutType, IRect
|
|
5
|
+
import type { ILayoutRect, ILayoutType, IRect } from '../../typings';
|
|
6
6
|
import { BaseComponent } from '../base/base-component';
|
|
7
|
-
import type { IAggrType, IDataPos, IDataPosCallback,
|
|
8
|
-
import type { IGraphic } from '@visactor/vrender-core';
|
|
9
|
-
export declare abstract class BaseMarker<T extends IMarkerSpec
|
|
7
|
+
import type { IAggrType, IDataPos, IDataPosCallback, IMarkerSpec } from './interface';
|
|
8
|
+
import type { IGraphic, IGroup } from '@visactor/vrender-core';
|
|
9
|
+
export declare abstract class BaseMarker<T extends IMarkerSpec> extends BaseComponent<T> {
|
|
10
10
|
layoutType: ILayoutType | 'none';
|
|
11
11
|
protected _startRelativeSeries: ICartesianSeries;
|
|
12
12
|
protected _endRelativeSeries: ICartesianSeries;
|
|
@@ -16,55 +16,53 @@ export declare abstract class BaseMarker<T extends IMarkerSpec & IMarkerAxisSpec
|
|
|
16
16
|
protected _markerComponent: any;
|
|
17
17
|
protected _layoutOffsetX: number;
|
|
18
18
|
protected _layoutOffsetY: number;
|
|
19
|
+
private _firstSeries;
|
|
19
20
|
created(): void;
|
|
20
|
-
private _isSpecAggr;
|
|
21
21
|
private _getAllRelativeSeries;
|
|
22
|
+
private _getFieldInfoFromSpec;
|
|
22
23
|
protected _processSpecX(specX: IDataPos | IDataPosCallback): {
|
|
23
24
|
getRelativeSeries: () => ICartesianSeries;
|
|
24
25
|
getStartRelativeSeries: () => ICartesianSeries;
|
|
25
26
|
getEndRelativeSeries: () => ICartesianSeries;
|
|
26
|
-
x: {
|
|
27
|
+
x: string | number | IDataPosCallback | {
|
|
27
28
|
field: any;
|
|
28
29
|
aggrType: IAggrType;
|
|
29
30
|
};
|
|
30
|
-
} | {
|
|
31
|
-
getRelativeSeries: () => ICartesianSeries;
|
|
32
|
-
getStartRelativeSeries: () => ICartesianSeries;
|
|
33
|
-
getEndRelativeSeries: () => ICartesianSeries;
|
|
34
|
-
x: IDataPos | IDataPosCallback;
|
|
35
31
|
};
|
|
36
32
|
protected _processSpecY(specY: IDataPos | IDataPosCallback): {
|
|
37
33
|
getRelativeSeries: () => ICartesianSeries;
|
|
38
34
|
getStartRelativeSeries: () => ICartesianSeries;
|
|
39
35
|
getEndRelativeSeries: () => ICartesianSeries;
|
|
40
|
-
y: {
|
|
36
|
+
y: string | number | IDataPosCallback | {
|
|
41
37
|
field: any;
|
|
42
38
|
aggrType: IAggrType;
|
|
43
39
|
};
|
|
44
|
-
}
|
|
40
|
+
};
|
|
41
|
+
protected _processSpecXY(specX: IDataPos | IDataPosCallback, specY: IDataPos | IDataPosCallback): {
|
|
45
42
|
getRelativeSeries: () => ICartesianSeries;
|
|
46
43
|
getStartRelativeSeries: () => ICartesianSeries;
|
|
47
44
|
getEndRelativeSeries: () => ICartesianSeries;
|
|
48
|
-
|
|
45
|
+
x: string | number | IDataPosCallback | {
|
|
46
|
+
field: any;
|
|
47
|
+
aggrType: IAggrType;
|
|
48
|
+
};
|
|
49
|
+
y: string | number | IDataPosCallback | {
|
|
50
|
+
field: any;
|
|
51
|
+
aggrType: IAggrType;
|
|
52
|
+
};
|
|
49
53
|
};
|
|
50
|
-
protected _processSpecXY(specX: IDataPos | IDataPosCallback, specY: IDataPos | IDataPosCallback): any;
|
|
51
54
|
protected _processSpecCoo(spec: any): any;
|
|
52
55
|
updateLayoutAttribute(): void;
|
|
53
|
-
|
|
56
|
+
private _getSeriesByIdOrIndex;
|
|
54
57
|
protected _bindSeries(): void;
|
|
55
|
-
protected _computeClipRange(regions: IRegion[]): {
|
|
56
|
-
minX: number;
|
|
57
|
-
maxX: number;
|
|
58
|
-
minY: number;
|
|
59
|
-
maxY: number;
|
|
60
|
-
};
|
|
61
58
|
protected abstract _initDataView(): void;
|
|
62
|
-
protected abstract _createMarkerComponent():
|
|
59
|
+
protected abstract _createMarkerComponent(): IGroup;
|
|
63
60
|
protected abstract _markerLayout(): void;
|
|
64
61
|
protected initEvent(): void;
|
|
65
62
|
onRender(ctx: IModelRenderOption): void;
|
|
66
63
|
changeRegions(regions: IRegion[]): void;
|
|
67
|
-
|
|
64
|
+
clear(): void;
|
|
65
|
+
private _getFirstSeries;
|
|
68
66
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
69
67
|
onLayoutStart(layoutRect: IRect, chartViewRect: ILayoutRect, ctx: any): void;
|
|
70
68
|
}
|
|
@@ -3,11 +3,18 @@ import type { SymbolType, IRichTextCharacter } from '@visactor/vrender-core';
|
|
|
3
3
|
import type { IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec, StringOrNumber } from '../../typings';
|
|
4
4
|
import type { IComponentSpec } from '../base/interface';
|
|
5
5
|
import type { Datum } from '@visactor/vrender-components';
|
|
6
|
+
import type { ICartesianSeries } from '../../series/interface';
|
|
7
|
+
import type { IOptionAggrField, IOptionSeries } from '../../data/transforms/aggregation';
|
|
8
|
+
export type OffsetPoint = {
|
|
9
|
+
x?: number | string;
|
|
10
|
+
y?: number | string;
|
|
11
|
+
};
|
|
6
12
|
export type IAggrType = 'sum' | 'average' | 'min' | 'max' | 'variance' | 'standardDeviation' | 'median';
|
|
7
13
|
export type IDataPos = StringOrNumber | IAggrType;
|
|
8
|
-
export type IDataPosCallback = (relativeSeriesData:
|
|
14
|
+
export type IDataPosCallback = (relativeSeriesData: Datum[], startRelativeSeriesData: Datum[], endRelativeSeriesData: Datum[], relativeSeries: ICartesianSeries, startRelativeSeries: ICartesianSeries, endRelativeSeries: ICartesianSeries) => StringOrNumber;
|
|
15
|
+
export type IDataPointCallback = (relativeSeriesData: Datum[], relativeSeries: ICartesianSeries) => StringOrNumber;
|
|
9
16
|
export type IDataPointSpec = {
|
|
10
|
-
[key: string]: IDataPos;
|
|
17
|
+
[key: string]: IDataPos | IDataPointCallback;
|
|
11
18
|
refRelativeSeriesIndex?: number;
|
|
12
19
|
refRelativeSeriesId?: StringOrNumber;
|
|
13
20
|
xFieldIndex?: number;
|
|
@@ -15,12 +22,17 @@ export type IDataPointSpec = {
|
|
|
15
22
|
yFieldIndex?: number;
|
|
16
23
|
yFieldDim?: string;
|
|
17
24
|
};
|
|
18
|
-
type
|
|
19
|
-
x:
|
|
20
|
-
y:
|
|
25
|
+
export type MarkerPositionPoint = {
|
|
26
|
+
x: StringOrNumber;
|
|
27
|
+
y: StringOrNumber;
|
|
21
28
|
};
|
|
29
|
+
export type ICoordinateOption = {
|
|
30
|
+
x?: IOptionAggrField | (IDataPointCallback | StringOrNumber)[];
|
|
31
|
+
y?: IOptionAggrField | (IDataPointCallback | StringOrNumber)[];
|
|
32
|
+
getRefRelativeSeries?: () => ICartesianSeries;
|
|
33
|
+
} & IOptionSeries;
|
|
22
34
|
export type IMarkerPositionsSpec = {
|
|
23
|
-
positions:
|
|
35
|
+
positions: MarkerPositionPoint[];
|
|
24
36
|
regionRelative?: boolean;
|
|
25
37
|
};
|
|
26
38
|
export type IMarkerLabelWithoutRefSpec = {
|
|
@@ -52,12 +64,11 @@ export interface IMarkerRef {
|
|
|
52
64
|
refY?: number;
|
|
53
65
|
refAngle?: number;
|
|
54
66
|
}
|
|
55
|
-
export interface
|
|
67
|
+
export interface IMarkerCrossSeriesSpec {
|
|
56
68
|
startRelativeSeriesIndex?: number;
|
|
57
69
|
endRelativeSeriesIndex?: number;
|
|
58
70
|
startRelativeSeriesId?: string;
|
|
59
71
|
endRelativeSeriesId?: string;
|
|
60
|
-
relativeRelativeSeriesIndex?: number;
|
|
61
72
|
}
|
|
62
73
|
export interface IMarkerSpec extends IComponentSpec {
|
|
63
74
|
relativeSeriesIndex?: number;
|
|
@@ -74,4 +85,3 @@ export interface IMarkerSymbol extends IMarkerRef {
|
|
|
74
85
|
size?: number;
|
|
75
86
|
style?: Omit<ISymbolMarkSpec, 'visible'>;
|
|
76
87
|
}
|
|
77
|
-
export {};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import type { IComponent } from '../../../interface';
|
|
2
|
-
import type { IMarkerPositionsSpec, IDataPointSpec, IDataPos, IMarkerSpec,
|
|
2
|
+
import type { IMarkerPositionsSpec, IDataPointSpec, IDataPos, IMarkerSpec, IDataPosCallback, IMarkerCrossSeriesSpec, OffsetPoint } from '../../interface';
|
|
3
3
|
import type { IMarkAreaTheme } from './theme';
|
|
4
4
|
export type IMarkArea = IComponent;
|
|
5
5
|
export type IRegressType = 'regression';
|
|
6
|
-
export type IMarkAreaSpec = IMarkerSpec & (IMarkAreaXSpec | IMarkAreaYSpec |
|
|
7
|
-
export interface IMarkAreaXSpec extends
|
|
6
|
+
export type IMarkAreaSpec = IMarkerSpec & (IMarkAreaXSpec | IMarkAreaYSpec | IMarkAreaXYSpec | IMarkAreaCoordinateSpec | IMarkerPositionsSpec) & IMarkAreaTheme;
|
|
7
|
+
export interface IMarkAreaXSpec extends IMarkerCrossSeriesSpec {
|
|
8
8
|
x: IDataPos | IDataPosCallback;
|
|
9
9
|
x1: IDataPos | IDataPosCallback;
|
|
10
10
|
}
|
|
11
|
-
export interface IMarkAreaYSpec extends
|
|
11
|
+
export interface IMarkAreaYSpec extends IMarkerCrossSeriesSpec {
|
|
12
12
|
y: IDataPos | IDataPosCallback;
|
|
13
13
|
y1: IDataPos | IDataPosCallback;
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
startRadius: IDataPos | IDataPosCallback;
|
|
21
|
-
endRadius: IDataPos | IDataPosCallback;
|
|
15
|
+
export interface IMarkAreaXYSpec extends IMarkerCrossSeriesSpec {
|
|
16
|
+
x: IDataPos | IDataPosCallback;
|
|
17
|
+
x1: IDataPos | IDataPosCallback;
|
|
18
|
+
y: IDataPos | IDataPosCallback;
|
|
19
|
+
y1: IDataPos | IDataPosCallback;
|
|
22
20
|
}
|
|
23
21
|
export type IMarkAreaCoordinateSpec = {
|
|
24
22
|
coordinates: IDataPointSpec[];
|
|
23
|
+
coordinatesOffset?: OffsetPoint[];
|
|
25
24
|
};
|
|
26
|
-
export type IMarkAreaPositionsSpec = IMarkerPositionsSpec;
|
|
@@ -3,7 +3,8 @@ import type { IComponentOption } from '../../interface';
|
|
|
3
3
|
import { ComponentTypeEnum } from '../../interface/type';
|
|
4
4
|
import { MarkArea as MarkAreaComponent } from '@visactor/vrender-components';
|
|
5
5
|
import { BaseMarker } from '../base-marker';
|
|
6
|
-
|
|
6
|
+
import type { IGroup } from '@visactor/vrender-core';
|
|
7
|
+
export declare class MarkArea extends BaseMarker<IMarkAreaSpec> implements IMarkArea {
|
|
7
8
|
static type: ComponentTypeEnum;
|
|
8
9
|
type: ComponentTypeEnum;
|
|
9
10
|
name: string;
|
|
@@ -11,7 +12,7 @@ export declare class MarkArea extends BaseMarker<IMarkAreaSpec & IMarkAreaTheme>
|
|
|
11
12
|
protected _theme: IMarkAreaTheme;
|
|
12
13
|
protected _markerComponent: MarkAreaComponent;
|
|
13
14
|
static createComponent(spec: any, options: IComponentOption): MarkArea | MarkArea[];
|
|
14
|
-
protected _createMarkerComponent():
|
|
15
|
+
protected _createMarkerComponent(): IGroup;
|
|
15
16
|
protected _markerLayout(): void;
|
|
16
17
|
protected _initDataView(): void;
|
|
17
18
|
}
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import type { IComponent } from '../../../interface';
|
|
2
|
-
import type { IAggrType, IMarkerPositionsSpec, IDataPointSpec, IMarkerSpec,
|
|
2
|
+
import type { IAggrType, IMarkerPositionsSpec, IDataPointSpec, IMarkerSpec, IDataPos, IDataPosCallback, IMarkerLabelSpec, IMarkerCrossSeriesSpec, OffsetPoint } from '../../interface';
|
|
3
3
|
import type { IRegressType } from '../../mark-area/interface';
|
|
4
4
|
import type { IMarkLineTheme } from './theme';
|
|
5
5
|
import type { ILineMarkSpec, IPoint } from '../../../../typings';
|
|
6
6
|
export type IMarkLine = IComponent;
|
|
7
|
-
export type IMarkLineSpec = (IMarkerSpec & (IMarkLineXSpec | IMarkLineYSpec | IMarkLineCoordinateSpec |
|
|
8
|
-
export interface IMarkLineXSpec extends
|
|
7
|
+
export type IMarkLineSpec = (IMarkerSpec & (IMarkLineXSpec | IMarkLineYSpec | IMarkLineXYSpec | IMarkLineXYY1Spec | IMarkLineYXX1Spec | IMarkLineCoordinateSpec | IMarkerPositionsSpec) & IMarkLineTheme) | IStepMarkLineSpec;
|
|
8
|
+
export interface IMarkLineXSpec extends IMarkerCrossSeriesSpec {
|
|
9
9
|
x: IDataPos | IDataPosCallback;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface IMarkLineXYY1Spec extends IMarkerCrossSeriesSpec {
|
|
12
|
+
x: IDataPos | IDataPosCallback;
|
|
12
13
|
y: IDataPos | IDataPosCallback;
|
|
14
|
+
y1: IDataPos | IDataPosCallback;
|
|
13
15
|
}
|
|
14
|
-
export interface
|
|
15
|
-
|
|
16
|
+
export interface IMarkLineYSpec extends IMarkerCrossSeriesSpec {
|
|
17
|
+
y: IDataPos | IDataPosCallback;
|
|
16
18
|
}
|
|
17
|
-
export interface
|
|
18
|
-
|
|
19
|
+
export interface IMarkLineYXX1Spec extends IMarkerCrossSeriesSpec {
|
|
20
|
+
y: IDataPos | IDataPosCallback;
|
|
21
|
+
x: IDataPos | IDataPosCallback;
|
|
22
|
+
x1: IDataPos | IDataPosCallback;
|
|
23
|
+
}
|
|
24
|
+
export interface IMarkLineXYSpec extends IMarkerCrossSeriesSpec {
|
|
25
|
+
x: IDataPos | IDataPosCallback;
|
|
26
|
+
y: IDataPos | IDataPosCallback;
|
|
27
|
+
x1: IDataPos | IDataPosCallback;
|
|
28
|
+
y1: IDataPos | IDataPosCallback;
|
|
19
29
|
}
|
|
20
30
|
export type IMarkLineCoordinateSpec = {
|
|
21
31
|
coordinates: IDataPointSpec[];
|
|
32
|
+
coordinatesOffset?: OffsetPoint[];
|
|
22
33
|
process?: {
|
|
23
34
|
x: IAggrType;
|
|
24
35
|
} | {
|
|
@@ -27,7 +38,6 @@ export type IMarkLineCoordinateSpec = {
|
|
|
27
38
|
xy: IRegressType;
|
|
28
39
|
};
|
|
29
40
|
};
|
|
30
|
-
export type IMarkLinePositionsSpec = IMarkerPositionsSpec;
|
|
31
41
|
export type IStepMarkLineSpec = IMarkerSpec & {
|
|
32
42
|
type: 'type-step';
|
|
33
43
|
connectDirection: 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -49,4 +59,5 @@ export type IStepMarkLineSpec = IMarkerSpec & {
|
|
|
49
59
|
};
|
|
50
60
|
} | {
|
|
51
61
|
positions: [IPoint, IPoint];
|
|
62
|
+
regionRelative?: boolean;
|
|
52
63
|
});
|
|
@@ -3,15 +3,17 @@ import type { IComponentOption } from '../../interface';
|
|
|
3
3
|
import { ComponentTypeEnum } from '../../interface/type';
|
|
4
4
|
import { MarkLine as MarkLineComponent } from '@visactor/vrender-components';
|
|
5
5
|
import { BaseMarker } from '../base-marker';
|
|
6
|
-
|
|
6
|
+
import type { IGroup } from '@visactor/vrender-core';
|
|
7
|
+
export declare class MarkLine extends BaseMarker<IMarkLineSpec> implements IMarkLine {
|
|
7
8
|
static type: ComponentTypeEnum;
|
|
8
9
|
type: ComponentTypeEnum;
|
|
9
10
|
name: string;
|
|
10
11
|
layoutZIndex: number;
|
|
11
12
|
protected _theme: IMarkLineTheme;
|
|
12
13
|
protected _markerComponent: MarkLineComponent;
|
|
14
|
+
private _isXYLayout;
|
|
13
15
|
static createComponent(spec: any, options: IComponentOption): MarkLine | MarkLine[];
|
|
14
|
-
protected _createMarkerComponent():
|
|
16
|
+
protected _createMarkerComponent(): IGroup;
|
|
15
17
|
protected _markerLayout(): void;
|
|
16
18
|
protected _initDataView(): void;
|
|
17
19
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type { IPoint } from '../../../../typings';
|
|
2
1
|
import type { IComponent } from '../../../interface';
|
|
3
|
-
import type { IDataPointSpec, IMarkerSpec, IMarkerSymbol } from '../../interface';
|
|
2
|
+
import type { IDataPointSpec, IDataPos, IDataPosCallback, IMarkerSpec, IMarkerSymbol, MarkerPositionPoint, OffsetPoint } from '../../interface';
|
|
4
3
|
import type { IMarkPointTheme } from './theme';
|
|
5
4
|
export type IMarkPoint = IComponent;
|
|
6
|
-
export type IMarkPointSpec = IMarkerSpec & (IMarkPointCoordinateSpec | IMarkPointPositionsSpec) & IMarkPointTheme<IMarkerSymbol>;
|
|
5
|
+
export type IMarkPointSpec = IMarkerSpec & (IMarkPointXYSpec | IMarkPointCoordinateSpec | IMarkPointPositionsSpec) & IMarkPointTheme<IMarkerSymbol>;
|
|
6
|
+
export type IMarkPointXYSpec = {
|
|
7
|
+
y: IDataPos | IDataPosCallback;
|
|
8
|
+
x: IDataPos | IDataPosCallback;
|
|
9
|
+
};
|
|
7
10
|
export type IMarkPointCoordinateSpec = {
|
|
8
11
|
coordinates: IDataPointSpec;
|
|
9
|
-
|
|
10
|
-
relativeRelativeSeriesId?: string;
|
|
12
|
+
coordinatesOffset?: OffsetPoint;
|
|
11
13
|
};
|
|
12
14
|
export type IMarkPointPositionsSpec = {
|
|
13
|
-
position:
|
|
15
|
+
position: MarkerPositionPoint;
|
|
14
16
|
regionRelative?: boolean;
|
|
15
17
|
};
|
|
@@ -3,7 +3,8 @@ import type { IComponentOption } from '../../interface';
|
|
|
3
3
|
import { ComponentTypeEnum } from '../../interface/type';
|
|
4
4
|
import { MarkPoint as MarkPointComponent } from '@visactor/vrender-components';
|
|
5
5
|
import { BaseMarker } from '../base-marker';
|
|
6
|
-
|
|
6
|
+
import type { IGroup } from '@visactor/vrender-core';
|
|
7
|
+
export declare class MarkPoint extends BaseMarker<IMarkPointSpec> implements IMarkPoint {
|
|
7
8
|
static type: ComponentTypeEnum;
|
|
8
9
|
type: ComponentTypeEnum;
|
|
9
10
|
name: string;
|
|
@@ -11,7 +12,7 @@ export declare class MarkPoint extends BaseMarker<IMarkPointSpec & IMarkPointThe
|
|
|
11
12
|
protected _theme: IMarkPointTheme;
|
|
12
13
|
protected _markerComponent: MarkPointComponent;
|
|
13
14
|
static createComponent(spec: any, options: IComponentOption): MarkPoint | MarkPoint[];
|
|
14
|
-
protected _createMarkerComponent():
|
|
15
|
+
protected _createMarkerComponent(): IGroup;
|
|
15
16
|
protected _markerLayout(): void;
|
|
16
17
|
protected _initDataView(): void;
|
|
17
18
|
}
|