@visactor/vchart-types 1.10.0-alpha.4 → 1.10.0-alpha.6
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 +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/types/chart/base/base-chart.d.ts +1 -1
- package/types/chart/interface/chart.d.ts +1 -1
- package/types/compile/compiler.d.ts +1 -1
- package/types/component/axis/base-axis.d.ts +9 -6
- package/types/component/axis/cartesian/axis.d.ts +1 -5
- package/types/component/axis/cartesian/time-axis.d.ts +1 -1
- package/types/component/axis/cartesian/util/index.d.ts +0 -1
- package/types/component/axis/interface/common.d.ts +2 -1
- package/types/component/axis/interface/spec.d.ts +2 -0
- package/types/component/axis/polar/axis.d.ts +1 -5
- package/types/component/base/util.d.ts +5 -0
- package/types/component/crosshair/base.d.ts +4 -1
- package/types/component/crosshair/cartesian.d.ts +1 -7
- package/types/component/crosshair/interface/cartesian.d.ts +46 -0
- package/types/component/crosshair/interface/common.d.ts +7 -0
- package/types/component/crosshair/interface/index.d.ts +3 -0
- package/types/component/crosshair/interface/polar.d.ts +23 -0
- package/types/component/crosshair/interface/spec.d.ts +1 -0
- package/types/component/crosshair/polar.d.ts +2 -2
- package/types/component/crosshair/utils/cartesian.d.ts +32 -0
- package/types/component/crosshair/utils/common.d.ts +9 -0
- package/types/component/crosshair/utils/index.d.ts +1 -0
- package/types/component/crosshair/utils/polar.d.ts +37 -0
- package/types/component/data-zoom/data-zoom/data-zoom.d.ts +1 -0
- package/types/component/data-zoom/data-zoom/interface.d.ts +4 -5
- package/types/component/data-zoom/scroll-bar/interface.d.ts +2 -4
- package/types/component/data-zoom/util.d.ts +0 -4
- package/types/component/index.d.ts +1 -0
- package/types/component/interface/theme.d.ts +8 -0
- package/types/component/label/interface.d.ts +1 -1
- package/types/component/legend/continuous/interface.d.ts +6 -12
- package/types/component/legend/discrete/interface.d.ts +17 -4
- package/types/component/legend/discrete/legend.d.ts +1 -0
- package/types/component/legend/util.d.ts +1 -2
- package/types/component/player/interface/theme.d.ts +1 -1
- package/types/component/tooltip/interface/common.d.ts +2 -2
- package/types/component/tooltip/interface/event.d.ts +0 -2
- package/types/component/tooltip/interface/index.d.ts +1 -0
- package/types/component/tooltip/interface/spec.d.ts +2 -2
- package/types/component/tooltip/interface/theme.d.ts +3 -3
- package/types/component/tooltip/tooltip.d.ts +3 -3
- package/types/component/util.d.ts +8 -0
- package/types/core/factory.d.ts +3 -0
- package/types/core/index.d.ts +1 -0
- package/types/core/interface.d.ts +1 -1
- package/types/core/vchart.d.ts +2 -1
- package/types/event/events/dimension/interface.d.ts +3 -2
- package/types/index.d.ts +1 -0
- package/types/interaction/dimension-trigger.d.ts +1 -6
- package/types/mark/base/base-mark.d.ts +3 -3
- package/types/mark/index.d.ts +2 -3
- package/types/mark/interface/type.d.ts +0 -1
- package/types/plugin/chart/formatter/formatter.d.ts +28 -0
- package/types/plugin/chart/formatter/index.d.ts +1 -0
- package/types/plugin/components/index.d.ts +2 -5
- package/types/plugin/components/tooltip-handler/base.d.ts +6 -6
- package/types/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/constants.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +8 -4
- package/types/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/dom/model/interface.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/utils/attribute.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/utils/common.d.ts +3 -3
- package/types/plugin/components/tooltip-handler/utils/compose.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/utils/position.d.ts +18 -3
- package/types/plugin/index.d.ts +1 -0
- package/types/series/base/tooltip-helper.d.ts +3 -3
- package/types/series/gauge/interface.d.ts +3 -3
- package/types/series/interface/common.d.ts +1 -1
- package/types/series/interface/theme.d.ts +17 -1
- package/types/series/progress/circular/interface.d.ts +5 -5
- package/types/series/sunburst/sunburst.d.ts +1 -1
- package/types/typings/spec/common.d.ts +4 -3
- package/types/typings/tooltip/line.d.ts +5 -2
- package/types/typings/tooltip/position.d.ts +21 -10
- package/types/typings/tooltip/shape.d.ts +2 -2
- package/types/typings/tooltip/tooltip.d.ts +8 -8
- package/types/typings/visual.d.ts +2 -4
- package/types/util/index.d.ts +1 -2
|
@@ -12,7 +12,7 @@ import type { IEvent } from '../../event/interface';
|
|
|
12
12
|
import type { DataView } from '@visactor/vdataset';
|
|
13
13
|
import type { DataSet } from '@visactor/vdataset';
|
|
14
14
|
import { Stack } from '../stack';
|
|
15
|
-
import type { IParserOptions } from '@visactor/vdataset
|
|
15
|
+
import type { IParserOptions } from '@visactor/vdataset';
|
|
16
16
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
17
17
|
import type { IRunningConfig as IMorphConfig, IView } from '@visactor/vgrammar-core';
|
|
18
18
|
import { CompilableBase } from '../../compile/compilable-base';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IEvent } from '../../event/interface';
|
|
2
2
|
import type { LayoutCallBack } from '../../layout/interface';
|
|
3
3
|
import type { IView } from '@visactor/vgrammar-core';
|
|
4
|
-
import type { IParserOptions } from '@visactor/vdataset
|
|
4
|
+
import type { IParserOptions } from '@visactor/vdataset';
|
|
5
5
|
import type { IComponent, IComponentConstructor } from '../../component/interface';
|
|
6
6
|
import type { IMark } from '../../mark/interface';
|
|
7
7
|
import type { IModel, IModelConstructor, IModelSpecInfo, IUpdateSpecResult } from '../../model/interface';
|
|
@@ -3,7 +3,7 @@ import type { CompilerListenerParameters, CompilerModel, IGrammarItem, IRenderCo
|
|
|
3
3
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
4
4
|
import type { EventSourceType } from '../event/interface';
|
|
5
5
|
import type { IChart } from '../chart/interface';
|
|
6
|
-
import
|
|
6
|
+
import { VChart } from '../core/vchart';
|
|
7
7
|
import type { IColor, Stage } from '@visactor/vrender-core';
|
|
8
8
|
import type { IMorphConfig } from '../animation/spec';
|
|
9
9
|
type EventListener = {
|
|
@@ -39,21 +39,24 @@ export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<s
|
|
|
39
39
|
protected abstract axisHelper(): any;
|
|
40
40
|
protected abstract getSeriesStatisticsField(s: ISeries): string[];
|
|
41
41
|
protected abstract updateSeriesScale(): void;
|
|
42
|
-
protected abstract
|
|
43
|
-
min: number;
|
|
44
|
-
max: number;
|
|
45
|
-
values: any[];
|
|
46
|
-
}[];
|
|
42
|
+
protected abstract collectSeriesField(depth: number, series: ISeries): string | string[];
|
|
47
43
|
abstract transformScaleDomain(): void;
|
|
48
44
|
protected _dataFieldText: string;
|
|
49
45
|
protected _axisMark: IComponentMark;
|
|
50
46
|
protected _gridMark: IComponentMark;
|
|
51
47
|
protected _coordinateType: CoordinateType;
|
|
48
|
+
getCoordinateType(): CoordinateType;
|
|
52
49
|
constructor(spec: T, options: IComponentOption);
|
|
53
50
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
54
51
|
getVRenderComponents(): any[];
|
|
55
52
|
created(): void;
|
|
53
|
+
protected _shouldComputeTickData(): boolean;
|
|
56
54
|
protected _initData(): void;
|
|
55
|
+
protected collectData(depth: number, rawData?: boolean): {
|
|
56
|
+
min: number;
|
|
57
|
+
max: number;
|
|
58
|
+
values: any[];
|
|
59
|
+
}[];
|
|
57
60
|
protected isSeriesDataEnable(): boolean;
|
|
58
61
|
protected setSeriesAndRegionsFromSpec(): void;
|
|
59
62
|
getBindSeriesFilter(): {
|
|
@@ -72,7 +75,6 @@ export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<s
|
|
|
72
75
|
reSize: boolean;
|
|
73
76
|
reCompile: boolean;
|
|
74
77
|
};
|
|
75
|
-
protected getLabelFormatMethod(): (value: any, datum: any, index: number) => any;
|
|
76
78
|
protected _delegateAxisContainerEvent(component: IGroup): void;
|
|
77
79
|
protected _getAxisAttributes(): any;
|
|
78
80
|
protected _getGridAttributes(): {
|
|
@@ -91,6 +93,7 @@ export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<s
|
|
|
91
93
|
style: any;
|
|
92
94
|
};
|
|
93
95
|
};
|
|
96
|
+
protected _getLabelFormatMethod(): (value: any, datum: any, index: number) => any;
|
|
94
97
|
protected _initTickDataSet<T extends ITickDataOpt>(options: T, index?: number): DataView;
|
|
95
98
|
protected _tickTransformOption(): ITickDataOpt;
|
|
96
99
|
addTransformToTickData(options: ITransformOptions, execute?: boolean): void;
|
|
@@ -86,11 +86,7 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
|
|
|
86
86
|
update(ctx: IComponentOption): void;
|
|
87
87
|
resize(ctx: IComponentOption): void;
|
|
88
88
|
protected collectScale(): IBaseScale[];
|
|
89
|
-
protected
|
|
90
|
-
min: number;
|
|
91
|
-
max: number;
|
|
92
|
-
values: any[];
|
|
93
|
-
}[];
|
|
89
|
+
protected collectSeriesField(depth: number, series: ICartesianSeries): string | string[];
|
|
94
90
|
protected updateSeriesScale(): void;
|
|
95
91
|
_transformLayoutPosition: (pos: Partial<IPoint>) => {
|
|
96
92
|
x: number;
|
|
@@ -16,7 +16,7 @@ export declare class CartesianTimeAxis<T extends ICartesianTimeAxisSpec = ICarte
|
|
|
16
16
|
setAttrFromSpec(): void;
|
|
17
17
|
protected _initData(): void;
|
|
18
18
|
protected computeData(updateType?: 'range' | 'domain' | 'force'): void;
|
|
19
|
-
protected
|
|
19
|
+
protected _getLabelFormatMethod(): any;
|
|
20
20
|
protected getLabelItems(length: number): any[];
|
|
21
21
|
transformScaleDomain(): void;
|
|
22
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IBaseScale } from '@visactor/vscale';
|
|
2
|
-
import type { Datum, IPolarOrientType, StringOrNumber } from '../../../typings';
|
|
2
|
+
import type { CoordinateType, Datum, IPolarOrientType, StringOrNumber } from '../../../typings';
|
|
3
3
|
import type { IComponent } from '../../interface/common';
|
|
4
4
|
import type { ICartesianAxisSpec } from '../cartesian/interface';
|
|
5
5
|
import type { ITextGraphicAttribute } from '@visactor/vrender-core';
|
|
@@ -15,6 +15,7 @@ export interface IAxis extends IComponent {
|
|
|
15
15
|
getScales: () => IBaseScale[];
|
|
16
16
|
getOrient: () => ICartesianAxisSpec['orient'] | IPolarOrientType;
|
|
17
17
|
getInverse: () => boolean;
|
|
18
|
+
getCoordinateType: () => CoordinateType;
|
|
18
19
|
visible: boolean;
|
|
19
20
|
directionStr?: 'l2r' | 'r2l' | 't2b' | 'b2t';
|
|
20
21
|
}
|
|
@@ -13,6 +13,7 @@ export interface ICommonAxisSpec extends Omit<IComponentSpec, 'orient' | 'center
|
|
|
13
13
|
select?: boolean;
|
|
14
14
|
hover?: boolean;
|
|
15
15
|
sampling?: boolean;
|
|
16
|
+
forceInitTick?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export interface ILinearAxisSpec {
|
|
18
19
|
min?: number;
|
|
@@ -63,6 +64,7 @@ export interface ISubTick extends IAxisItem<IRuleMarkSpec> {
|
|
|
63
64
|
export interface ILabel extends IAxisItem<ITextMarkSpec> {
|
|
64
65
|
type?: 'text' | 'rich';
|
|
65
66
|
formatMethod?: IFormatMethod<[text: string | string[], datum?: Datum]>;
|
|
67
|
+
formatter?: string | string[];
|
|
66
68
|
space?: number;
|
|
67
69
|
inside?: boolean;
|
|
68
70
|
minGap?: number;
|
|
@@ -44,11 +44,7 @@ export declare abstract class PolarAxis<T extends IPolarAxisCommonSpec = IPolarA
|
|
|
44
44
|
protected _tickTransformOption(): IPolarTickDataOpt;
|
|
45
45
|
afterCompile(): void;
|
|
46
46
|
protected updateScaleRange(): boolean;
|
|
47
|
-
protected
|
|
48
|
-
min: number;
|
|
49
|
-
max: number;
|
|
50
|
-
values: any[];
|
|
51
|
-
}[];
|
|
47
|
+
protected collectSeriesField(depth: number, series: IPolarSeries): string | string[];
|
|
52
48
|
protected abstract computeDomain(data: {
|
|
53
49
|
min: number;
|
|
54
50
|
max: number;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { ITheme } from '../../theme';
|
|
2
|
+
import { type IOrientType } from '../../typings';
|
|
3
|
+
import type { ComponentThemeWithDirection } from '../interface';
|
|
2
4
|
import { ComponentTypeEnum } from '../interface/type';
|
|
3
5
|
export declare function getComponentThemeFromGlobalTheme(type: ComponentTypeEnum, chartTheme: ITheme, componentSpec: any, chartSpec: any): any;
|
|
6
|
+
export declare const getComponentThemeWithDirection: <T>(componentSpec: {
|
|
7
|
+
orient?: IOrientType;
|
|
8
|
+
}, originalTheme: ComponentThemeWithDirection<T>) => T;
|
|
@@ -22,6 +22,7 @@ export interface IHair {
|
|
|
22
22
|
label?: {
|
|
23
23
|
visible: boolean;
|
|
24
24
|
formatMethod?: (text: StringOrNumber | string[], position: string) => string | string[];
|
|
25
|
+
formatter?: string | string[];
|
|
25
26
|
textStyle?: Dict<any>;
|
|
26
27
|
minWidth?: number;
|
|
27
28
|
maxWidth?: number;
|
|
@@ -30,6 +31,9 @@ export interface IHair {
|
|
|
30
31
|
zIndex?: number;
|
|
31
32
|
};
|
|
32
33
|
}
|
|
34
|
+
export interface IHairRadius extends IHair {
|
|
35
|
+
smooth?: boolean;
|
|
36
|
+
}
|
|
33
37
|
export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec | IPolarCrosshairSpec> extends BaseComponent<T> implements ICrossHair {
|
|
34
38
|
static specKey: string;
|
|
35
39
|
specKey: string;
|
|
@@ -75,7 +79,6 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
|
|
|
75
79
|
onLayoutEnd(ctx: IModelLayoutOption): void;
|
|
76
80
|
onRender(ctx: IModelRenderOption): void;
|
|
77
81
|
protected _releaseEvent(): void;
|
|
78
|
-
protected _firstSeries<T>(): T | null;
|
|
79
82
|
protected _parseCrosshairSpec(): void;
|
|
80
83
|
protected _parseField(field: ICrosshairCategoryFieldSpec, fieldName: string): any;
|
|
81
84
|
protected _filterAxisByPoint<T>(axisMap: IAxisInfo<T>, relativeX: number, relativeY: number): IAxisInfo<T>;
|
|
@@ -2,7 +2,6 @@ import type { Maybe } from '@visactor/vutils';
|
|
|
2
2
|
import type { IComponentOption } from '../interface';
|
|
3
3
|
import { ComponentTypeEnum } from '../interface/type';
|
|
4
4
|
import type { ICartesianCrosshairSpec } from './interface';
|
|
5
|
-
import type { IBound } from './base';
|
|
6
5
|
import { BaseCrossHair } from './base';
|
|
7
6
|
import type { IGraphic } from '@visactor/vrender-core';
|
|
8
7
|
import type { IAxis } from '../axis/interface';
|
|
@@ -32,18 +31,13 @@ export declare class CartesianCrossHair<T extends ICartesianCrosshairSpec = ICar
|
|
|
32
31
|
private _findAllAxisContains;
|
|
33
32
|
private _getValueAt;
|
|
34
33
|
clearAxisValue(): void;
|
|
35
|
-
setAxisValue(
|
|
34
|
+
setAxisValue(value: StringOrNumber, axis: IAxis): void;
|
|
36
35
|
private _getAllAxisValues;
|
|
37
36
|
protected _layoutCrosshair(relativeX: number, relativeY: number): void;
|
|
38
37
|
hide(): void;
|
|
39
|
-
_setRegionArea(outRegion: IBound, currentValue: Map<number, {
|
|
40
|
-
v: StringOrNumber;
|
|
41
|
-
axis: IAxis;
|
|
42
|
-
}>): void;
|
|
43
38
|
layoutByValue(tag?: number): void;
|
|
44
39
|
private _layoutVertical;
|
|
45
40
|
private _layoutHorizontal;
|
|
46
|
-
private _getRectSize;
|
|
47
41
|
protected _parseFieldInfo(): void;
|
|
48
42
|
private _updateCrosshair;
|
|
49
43
|
private _updateCrosshairLabel;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { StringOrNumber } from '../../../typings';
|
|
2
|
+
import type { IAxis } from '../../axis';
|
|
3
|
+
export interface ICrosshairInfoX {
|
|
4
|
+
height: number;
|
|
5
|
+
leftPos: number;
|
|
6
|
+
rightPos: number;
|
|
7
|
+
topPos: number;
|
|
8
|
+
x: number;
|
|
9
|
+
bottom: {
|
|
10
|
+
visible: boolean;
|
|
11
|
+
text: StringOrNumber;
|
|
12
|
+
dx: number;
|
|
13
|
+
dy: number;
|
|
14
|
+
};
|
|
15
|
+
top: {
|
|
16
|
+
visible: boolean;
|
|
17
|
+
text: StringOrNumber;
|
|
18
|
+
dx: number;
|
|
19
|
+
dy: number;
|
|
20
|
+
};
|
|
21
|
+
visible: boolean;
|
|
22
|
+
_isCache?: boolean;
|
|
23
|
+
axis: IAxis;
|
|
24
|
+
}
|
|
25
|
+
export interface ICrosshairInfoY {
|
|
26
|
+
width: number;
|
|
27
|
+
leftPos: number;
|
|
28
|
+
topPos: number;
|
|
29
|
+
bottomPos: number;
|
|
30
|
+
y: number;
|
|
31
|
+
left: {
|
|
32
|
+
visible: boolean;
|
|
33
|
+
text: StringOrNumber;
|
|
34
|
+
dx: number;
|
|
35
|
+
dy: number;
|
|
36
|
+
};
|
|
37
|
+
right: {
|
|
38
|
+
visible: boolean;
|
|
39
|
+
text: StringOrNumber;
|
|
40
|
+
dx: number;
|
|
41
|
+
dy: number;
|
|
42
|
+
};
|
|
43
|
+
visible: boolean;
|
|
44
|
+
_isCache?: boolean;
|
|
45
|
+
axis: IAxis;
|
|
46
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IPoint, StringOrNumber } from '../../../typings';
|
|
2
|
+
import type { IPolarAxis } from '../../axis';
|
|
3
|
+
export interface IPolarCrosshairInfo {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
center: IPoint;
|
|
7
|
+
radius: number;
|
|
8
|
+
distance: number;
|
|
9
|
+
startAngle: number;
|
|
10
|
+
endAngle: number;
|
|
11
|
+
innerRadius: number;
|
|
12
|
+
visible: boolean;
|
|
13
|
+
sides: number;
|
|
14
|
+
angle: number;
|
|
15
|
+
point: IPoint;
|
|
16
|
+
_isCache?: boolean;
|
|
17
|
+
label?: {
|
|
18
|
+
visible: boolean;
|
|
19
|
+
text: StringOrNumber;
|
|
20
|
+
offset: number;
|
|
21
|
+
};
|
|
22
|
+
axis?: IPolarAxis;
|
|
23
|
+
}
|
|
@@ -56,6 +56,7 @@ export interface ICrosshairRectSpec {
|
|
|
56
56
|
export interface ICrosshairLabelSpec {
|
|
57
57
|
visible?: boolean;
|
|
58
58
|
formatMethod?: (text: StringOrNumber | string[]) => string | string[];
|
|
59
|
+
formatter?: string | string[];
|
|
59
60
|
style?: Partial<ITextMarkSpec>;
|
|
60
61
|
labelBackground?: ICrosshairLabelBackgroundSpec;
|
|
61
62
|
}
|
|
@@ -30,8 +30,8 @@ export declare class PolarCrossHair<T extends IPolarCrosshairSpec = IPolarCrossh
|
|
|
30
30
|
private _getValueByAxis;
|
|
31
31
|
protected _layoutCrosshair(relativeX: number, relativeY: number): void;
|
|
32
32
|
layoutByValue(tag?: number): void;
|
|
33
|
-
private
|
|
34
|
-
private
|
|
33
|
+
private _layoutAngle;
|
|
34
|
+
private _layoutRadius;
|
|
35
35
|
protected _parseFieldInfo(): void;
|
|
36
36
|
private _updateCrosshairLabel;
|
|
37
37
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ICartesianSeries } from '../../../series';
|
|
2
|
+
import type { ILayoutPoint } from '../../../typings';
|
|
3
|
+
import type { IHair } from '../base';
|
|
4
|
+
import type { AxisCurrentValueMap, ICrosshairInfoX, ICrosshairInfoY } from '../interface';
|
|
5
|
+
export declare const layoutByValue: (tag: number, series: ICartesianSeries, layoutStartPoint: ILayoutPoint, currValueX: AxisCurrentValueMap, currValueY: AxisCurrentValueMap, xHair: IHair, yHair: IHair, enableRemain?: boolean, cacheXCrossHairInfo?: ICrosshairInfoX, cacheYCrossHairInfo?: ICrosshairInfoY) => {
|
|
6
|
+
x: ICrosshairInfoX;
|
|
7
|
+
y: ICrosshairInfoY;
|
|
8
|
+
offsetWidth: number;
|
|
9
|
+
offsetHeight: number;
|
|
10
|
+
bandWidth: number;
|
|
11
|
+
bandHeight: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const layoutVerticalCrosshair: (xHair: IHair, crosshairInfo: ICrosshairInfoX, bandWidth: number, offsetWidth: number) => {
|
|
14
|
+
start: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
end: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const layoutHorizontalCrosshair: (yHair: IHair, crosshairInfo: ICrosshairInfoY, bandHeight: number, offsetHeight: number) => {
|
|
24
|
+
start: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
end: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Tag } from '@visactor/vrender-components';
|
|
2
|
+
import type { IBoundsLike } from '@visactor/vutils';
|
|
3
|
+
import type { Datum } from '../../../typings';
|
|
4
|
+
import type { ICrosshairTheme } from '../interface';
|
|
5
|
+
import type { ITheme } from '../../../theme';
|
|
6
|
+
export declare function limitTagInBounds(shape: Tag, bounds: IBoundsLike): void;
|
|
7
|
+
export declare function getDatumByValue(data: Datum[], value: number, startField: string, endField?: string): Datum | null;
|
|
8
|
+
export declare const getCartesianCrosshairTheme: (chartTheme: ITheme, chartSpec: any) => ICrosshairTheme;
|
|
9
|
+
export declare const getPolarCrosshairTheme: (chartTheme: ITheme, chartSpec: any) => ICrosshairTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './common';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IPolarSeries } from '../../../series';
|
|
2
|
+
import type { IHair, IHairRadius } from '../base';
|
|
3
|
+
import type { AxisCurrentValueMap, IPolarCrosshairInfo } from '../interface';
|
|
4
|
+
export declare const layoutByValue: (series: IPolarSeries, currValueAngle: AxisCurrentValueMap, currValueRadius: AxisCurrentValueMap, angleHair: IHair, radiusHair: IHair, enableRemain?: boolean, cacheAngleCrossHairInfo?: IPolarCrosshairInfo, cacheRadiusCrossHairInfo?: IPolarCrosshairInfo) => {
|
|
5
|
+
angle: IPolarCrosshairInfo;
|
|
6
|
+
radius: IPolarCrosshairInfo;
|
|
7
|
+
};
|
|
8
|
+
export declare const layoutAngleCrosshair: (angleHair: IHair, crosshairInfo: IPolarCrosshairInfo) => {
|
|
9
|
+
center: import("../../../typings").IPoint;
|
|
10
|
+
innerRadius: number;
|
|
11
|
+
radius: number;
|
|
12
|
+
startAngle: number;
|
|
13
|
+
endAngle: number;
|
|
14
|
+
start?: undefined;
|
|
15
|
+
end?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
start: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
end: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
center?: undefined;
|
|
26
|
+
innerRadius?: undefined;
|
|
27
|
+
radius?: undefined;
|
|
28
|
+
startAngle?: undefined;
|
|
29
|
+
endAngle?: undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare const layoutRadiusCrosshair: (radiusHair: IHairRadius, crosshairInfo: IPolarCrosshairInfo) => {
|
|
32
|
+
center: import("../../../typings").IPoint;
|
|
33
|
+
startAngle: number;
|
|
34
|
+
endAngle: number;
|
|
35
|
+
radius: number;
|
|
36
|
+
sides: number;
|
|
37
|
+
};
|
|
@@ -73,6 +73,7 @@ export declare class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends D
|
|
|
73
73
|
};
|
|
74
74
|
disableTriggerEvent: boolean;
|
|
75
75
|
};
|
|
76
|
+
protected _getHandlerTextFormatMethod(spec: IDataZoomSpec['startText']): (text: any) => any;
|
|
76
77
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
77
78
|
}
|
|
78
79
|
export declare const registerDataZoom: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IMarkSpec } from '../../../typings/spec';
|
|
2
2
|
import type { IAreaMarkSpec, ILineMarkSpec, IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec } from '../../../typings/visual';
|
|
3
3
|
import type { IComponentSpec } from '../../base/interface';
|
|
4
|
-
import type { IComponent } from '../../interface';
|
|
4
|
+
import type { ComponentThemeWithDirection, IComponent } from '../../interface';
|
|
5
5
|
import type { IFilterMode } from '../constant';
|
|
6
6
|
import type { IDataFilterComponent, IDataFilterComponentSpec } from '../interface';
|
|
7
7
|
export type IDataZoom = IComponent & IDataFilterComponent;
|
|
@@ -43,11 +43,13 @@ export interface IDataZoomSpec extends IDataZoomStyle, IDataFilterComponentSpec
|
|
|
43
43
|
padding?: number;
|
|
44
44
|
style?: IMarkSpec<ITextMarkSpec>;
|
|
45
45
|
formatMethod?: (text: string | number) => string | string[];
|
|
46
|
+
formatter?: string | string[];
|
|
46
47
|
};
|
|
47
48
|
endText?: {
|
|
48
49
|
padding?: number;
|
|
49
50
|
style?: IMarkSpec<ITextMarkSpec>;
|
|
50
51
|
formatMethod?: (text: string | number) => string | string[];
|
|
52
|
+
formatter?: string | string[];
|
|
51
53
|
};
|
|
52
54
|
brushSelect?: boolean;
|
|
53
55
|
ignoreBandSize?: boolean;
|
|
@@ -58,7 +60,4 @@ export type IDataZoomCommonTheme = IComponentSpec & IDataZoomStyle & {
|
|
|
58
60
|
height?: IDataZoomSpec['height'];
|
|
59
61
|
brushSelect?: boolean;
|
|
60
62
|
};
|
|
61
|
-
export type IDataZoomTheme = IDataZoomCommonTheme
|
|
62
|
-
horizontal?: Omit<IDataZoomCommonTheme, 'orient'>;
|
|
63
|
-
vertical?: Omit<IDataZoomCommonTheme, 'orient'>;
|
|
64
|
-
};
|
|
63
|
+
export type IDataZoomTheme = ComponentThemeWithDirection<IDataZoomCommonTheme>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ILayoutItemSpec } from '../../../layout/interface';
|
|
2
2
|
import type { IPadding } from '../../../typings';
|
|
3
3
|
import type { IRectMarkSpec } from '../../../typings/visual';
|
|
4
|
+
import type { ComponentThemeWithDirection } from '../../interface';
|
|
4
5
|
import type { IFilterMode } from '../constant';
|
|
5
6
|
import type { IDataFilterComponentSpec } from '../interface';
|
|
6
7
|
export interface IScrollBarStyle {
|
|
@@ -21,7 +22,4 @@ export type IScrollBarCommonTheme = ILayoutItemSpec & IScrollBarStyle & {
|
|
|
21
22
|
round?: IScrollBarSpec['round'];
|
|
22
23
|
innerPadding?: IScrollBarSpec['innerPadding'];
|
|
23
24
|
};
|
|
24
|
-
export type IScrollBarTheme = IScrollBarCommonTheme
|
|
25
|
-
horizontal?: Omit<IScrollBarCommonTheme, 'orient'>;
|
|
26
|
-
vertical?: Omit<IScrollBarCommonTheme, 'orient'>;
|
|
27
|
-
};
|
|
25
|
+
export type IScrollBarTheme = ComponentThemeWithDirection<IScrollBarCommonTheme>;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import type { IOrientType } from '../../typings';
|
|
2
|
-
import type { ComponentTypeEnum } from '../interface';
|
|
3
|
-
import type { ITheme } from '../../theme';
|
|
4
1
|
export interface IDataFilterWithNewDomainOption {
|
|
5
2
|
getNewDomain: () => any[];
|
|
6
3
|
isContinuous: () => boolean;
|
|
@@ -20,4 +17,3 @@ export interface IDataFilterComputeDomainOption {
|
|
|
20
17
|
};
|
|
21
18
|
}
|
|
22
19
|
export declare const dataFilterComputeDomain: (data: Array<any>, op: IDataFilterComputeDomainOption) => any[];
|
|
23
|
-
export declare const getDataFilterTheme: (orient: IOrientType, type: ComponentTypeEnum, chartTheme: ITheme) => any;
|
|
@@ -45,3 +45,4 @@ export { ScrollBar, DataZoom, CustomMark, Brush, MapLabelComponent, CartesianAxi
|
|
|
45
45
|
export { registerBrush, registerScrollBar, registerTitle, registerTooltip, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerContinuousLegend, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerGeoCoordinate, registerIndicator, registerLabel, registerTotalLabel, registerMapLabel, registerMarkArea, registerMarkLine, registerMarkPoint, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPoptip };
|
|
46
46
|
export type { IComponent, IScrollBarSpec, IBrushSpec, ICartesianAxisSpec, ICartesianBandAxisSpec, ICartesianCrosshairSpec, ICartesianLinearAxisSpec, ICartesianTimeAxisSpec, ICartesianLogAxisSpec, IContinuousLegendSpec, IDataZoomSpec, IDiscreteLegendSpec, IGeoCoordinateSpec, IIndicatorSpec, ILabelSpec, IMapLabelSpec, IMarkAreaSpec, IMarkLineSpec, IStepMarkLineSpec, IMarkPointSpec, IPlayerSpec, IPolarAxisSpec, IPolarBandAxisSpec, IPolarCrosshairSpec, IPolarLinearAxisSpec, ITitleSpec, ITooltipSpec };
|
|
47
47
|
export type { IComponentTheme, ICrosshairTheme, IAxisItemTheme, IAxisCommonTheme, IBandAxisTheme, IPolarAxisCommonTheme, ICartesianAxisCommonTheme, IBrushTheme, IDataZoomTheme, IScrollBarTheme, IIndicatorTheme, IMapLabelTheme, ITotalLabelTheme, ISizeLegendTheme, IColorLegendTheme, IDiscreteLegendTheme, IContinuousLegendTheme, IMarkAreaTheme, IMarkLineTheme, IMarkPointTheme, IPlayerTheme, IPoptipTheme, ITitleTheme, ITooltipTheme };
|
|
48
|
+
export * from './tooltip/interface';
|
|
@@ -15,6 +15,7 @@ import type { ComponentTypeEnum } from './type';
|
|
|
15
15
|
import type { ITotalLabelTheme } from '../label';
|
|
16
16
|
import type { IPoptipTheme } from '../poptip/interface';
|
|
17
17
|
import type { IColorKey } from '../../theme';
|
|
18
|
+
import type { Direction, IOrientType } from '../../typings';
|
|
18
19
|
export interface IComponentTheme {
|
|
19
20
|
axis?: IAxisCommonTheme;
|
|
20
21
|
axisBand?: IAxisCommonTheme;
|
|
@@ -42,3 +43,10 @@ export interface IComponentTheme {
|
|
|
42
43
|
[ComponentTypeEnum.poptip]?: IPoptipTheme;
|
|
43
44
|
[ComponentTypeEnum.totalLabel]?: ITotalLabelTheme;
|
|
44
45
|
}
|
|
46
|
+
export type ComponentThemeWithDirection<T extends {
|
|
47
|
+
orient?: IOrientType;
|
|
48
|
+
}> = T & {
|
|
49
|
+
orient?: IOrientType;
|
|
50
|
+
[Direction.horizontal]?: Omit<T, 'orient'>;
|
|
51
|
+
[Direction.vertical]?: Omit<T, 'orient'>;
|
|
52
|
+
};
|
|
@@ -11,7 +11,7 @@ export interface ILabelSpec extends IComponentSpec {
|
|
|
11
11
|
interactive?: boolean;
|
|
12
12
|
textType?: 'text' | 'rich';
|
|
13
13
|
formatMethod?: IFormatMethod<[text: string | string[], datum?: Datum, ctx?: ILabelFormatMethodContext]>;
|
|
14
|
-
formatter?: string;
|
|
14
|
+
formatter?: string | string[];
|
|
15
15
|
offset?: number;
|
|
16
16
|
position?: string;
|
|
17
17
|
style?: ConvertToMarkStyleSpec<IComposedTextMarkSpec>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec, StringOrNumber } from '../../../typings';
|
|
2
|
+
import type { ComponentThemeWithDirection } from '../../interface';
|
|
2
3
|
import type { ILegendCommonSpec, NoVisibleMarkStyle } from '../interface';
|
|
3
4
|
type Text = StringOrNumber;
|
|
4
5
|
export type TextAttribute = {
|
|
@@ -44,16 +45,9 @@ export type ISizeLegendSpec = IContinuousLegendSpec & {
|
|
|
44
45
|
align?: 'top' | 'bottom' | 'left' | 'right';
|
|
45
46
|
};
|
|
46
47
|
export type IContinuousLegendTheme = Omit<IContinuousLegendSpec, 'type' | 'field' | 'scale' | 'regionIndex' | 'regionId' | 'seriesIndex' | 'seriesId' | 'id' | 'defaultSelected'>;
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export
|
|
52
|
-
horizontal?: IContinuousLegendTheme & {
|
|
53
|
-
sizeBackground?: ISizeLegendSpec['sizeBackground'];
|
|
54
|
-
};
|
|
55
|
-
vertical?: IContinuousLegendTheme & {
|
|
56
|
-
sizeBackground?: ISizeLegendSpec['sizeBackground'];
|
|
57
|
-
};
|
|
58
|
-
}
|
|
48
|
+
export type ISizeLegendCommonTheme = IContinuousLegendTheme & {
|
|
49
|
+
sizeBackground?: ISizeLegendSpec['sizeBackground'];
|
|
50
|
+
};
|
|
51
|
+
export type IColorLegendTheme = ComponentThemeWithDirection<IContinuousLegendTheme>;
|
|
52
|
+
export type ISizeLegendTheme = ComponentThemeWithDirection<ISizeLegendCommonTheme>;
|
|
59
53
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec } from '../../../typings/visual';
|
|
2
|
-
import type { DiscreteLegendAttrs, LegendItemDatum, LegendItem } from '@visactor/vrender-components';
|
|
2
|
+
import type { DiscreteLegendAttrs, LegendItemDatum, LegendItem, LegendPagerAttributes, LegendScrollbarAttributes } from '@visactor/vrender-components';
|
|
3
3
|
import type { ILegendCommonSpec, NoVisibleMarkStyle } from '../interface';
|
|
4
4
|
import type { IFormatMethod, StringOrNumber } from '../../../typings';
|
|
5
5
|
import type { IBaseScale } from '@visactor/vscale';
|
|
6
6
|
import type { IGlobalScale } from '../../../scale/interface';
|
|
7
|
+
import type { ComponentThemeWithDirection } from '../../interface';
|
|
7
8
|
export type formatterCallback = IFormatMethod<[text: StringOrNumber, item: LegendItemDatum, index: number]>;
|
|
8
9
|
export type LegendItemStyleValue<T> = T | ((item: LegendItemDatum, isSelected: boolean, index: number, allItems: LegendItemDatum[]) => T);
|
|
9
10
|
export type LegendItemStyle<T> = {
|
|
@@ -16,6 +17,7 @@ export type LegendItemStyle<T> = {
|
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
export type IItem = {
|
|
20
|
+
align?: 'left' | 'right';
|
|
19
21
|
background?: {
|
|
20
22
|
visible?: boolean;
|
|
21
23
|
} & LegendItemStyle<LegendItemStyleValue<NoVisibleMarkStyle<IRectMarkSpec>>>;
|
|
@@ -24,18 +26,23 @@ export type IItem = {
|
|
|
24
26
|
space?: number;
|
|
25
27
|
} & LegendItemStyle<LegendItemStyleValue<Partial<NoVisibleMarkStyle<ISymbolMarkSpec>>>>;
|
|
26
28
|
label?: {
|
|
29
|
+
widthRatio?: number;
|
|
27
30
|
space?: number;
|
|
28
31
|
formatMethod?: formatterCallback;
|
|
32
|
+
formatter?: string;
|
|
29
33
|
} & LegendItemStyle<LegendItemStyleValue<NoVisibleMarkStyle<ITextMarkSpec>>>;
|
|
30
34
|
value?: {
|
|
35
|
+
widthRatio?: number;
|
|
31
36
|
space?: number;
|
|
32
37
|
alignRight?: boolean;
|
|
33
38
|
formatMethod?: formatterCallback;
|
|
39
|
+
formatter?: string | string[];
|
|
34
40
|
} & LegendItemStyle<LegendItemStyleValue<NoVisibleMarkStyle<ITextMarkSpec>>>;
|
|
35
41
|
focusIconStyle?: NoVisibleMarkStyle<ISymbolMarkSpec>;
|
|
36
42
|
maxWidth?: number | string;
|
|
37
43
|
width?: number | string;
|
|
38
44
|
height?: number | string;
|
|
45
|
+
autoEllipsisStrategy?: 'labelFirst' | 'valueFirst' | 'none';
|
|
39
46
|
} & Omit<LegendItem, 'background' | 'shape' | 'label' | 'value' | 'focusIconStyle' | 'width' | 'height' | 'maxWidth'>;
|
|
40
47
|
export type IPager = {
|
|
41
48
|
textStyle?: Partial<NoVisibleMarkStyle<ITextMarkSpec>>;
|
|
@@ -49,14 +56,20 @@ export type IPager = {
|
|
|
49
56
|
disable?: Omit<NoVisibleMarkStyle<ISymbolMarkSpec>, 'symbolType'>;
|
|
50
57
|
};
|
|
51
58
|
};
|
|
52
|
-
} & Omit<
|
|
59
|
+
} & Omit<LegendPagerAttributes, 'textStyle' | 'handler'>;
|
|
60
|
+
export type ILegendScrollbar = {
|
|
61
|
+
type: 'scrollbar';
|
|
62
|
+
railStyle?: Omit<Partial<NoVisibleMarkStyle<IRectMarkSpec>>, 'width' | 'height'>;
|
|
63
|
+
sliderStyle?: Omit<Partial<NoVisibleMarkStyle<IRectMarkSpec>>, 'width' | 'height'>;
|
|
64
|
+
} & Omit<LegendScrollbarAttributes, 'railStyle' | 'sliderStyle'>;
|
|
53
65
|
export type IDiscreteLegendSpec = ILegendCommonSpec & {
|
|
54
66
|
type?: 'discrete';
|
|
55
67
|
data?: (data: LegendItemDatum[], colorScale: IBaseScale, globalScale: IGlobalScale) => LegendItemDatum[];
|
|
56
68
|
item?: IItem;
|
|
57
|
-
pager?: IPager;
|
|
69
|
+
pager?: IPager | ILegendScrollbar;
|
|
58
70
|
scaleName?: string;
|
|
59
71
|
field?: string;
|
|
60
72
|
defaultSelected?: string[];
|
|
61
73
|
} & Omit<DiscreteLegendAttrs, 'layout' | 'title' | 'items' | 'item' | 'pager'>;
|
|
62
|
-
export type
|
|
74
|
+
export type IDiscreteLegendCommonTheme = Omit<IDiscreteLegendSpec, 'type' | 'data' | 'regionIndex' | 'regionId' | 'seriesIndex' | 'seriesId' | 'id' | 'defaultSelected'>;
|
|
75
|
+
export type IDiscreteLegendTheme = ComponentThemeWithDirection<IDiscreteLegendCommonTheme>;
|
|
@@ -23,5 +23,6 @@ export declare class DiscreteLegend extends BaseLegend<IDiscreteLegendSpec> {
|
|
|
23
23
|
protected _getLegendConstructor(): typeof LegendComponent;
|
|
24
24
|
protected _initEvent(): void;
|
|
25
25
|
private _getLegendItems;
|
|
26
|
+
private _addLegendItemFormatMethods;
|
|
26
27
|
}
|
|
27
28
|
export declare const registerDiscreteLegend: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ITitle } from './interface';
|
|
2
2
|
export declare function transformLegendTitleAttributes(title: ITitle): {
|
|
3
3
|
textStyle?: import("./interface").NoVisibleMarkStyle<import("../..").ITextMarkSpec>;
|
|
4
4
|
style?: import("./interface").NoVisibleMarkStyle<import("../..").ITextMarkSpec>;
|
|
@@ -29,4 +29,3 @@ export declare function transformLegendTitleAttributes(title: ITitle): {
|
|
|
29
29
|
space?: number;
|
|
30
30
|
align?: "start" | "end" | "center";
|
|
31
31
|
};
|
|
32
|
-
export declare function getLayout(spec: ILegendCommonSpec): "vertical" | "horizontal";
|