@visactor/vchart-types 2.0.8-alpha.5 → 2.0.9
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/animation/config.d.ts +1 -0
- package/types/chart/base/base-chart.d.ts +0 -2
- package/types/chart/interface/chart.d.ts +0 -2
- package/types/compile/compiler.d.ts +5 -0
- package/types/compile/interface/compilable-item.d.ts +2 -0
- package/types/component/axis/base-axis.d.ts +1 -1
- package/types/component/axis/cartesian/axis.d.ts +1 -1
- package/types/component/axis/cartesian/band-axis.d.ts +1 -1
- package/types/component/axis/interface/common.d.ts +1 -0
- package/types/component/axis/mixin/band-axis-mixin.d.ts +2 -0
- package/types/component/axis/mixin/linear-axis-mixin.d.ts +5 -1
- package/types/component/axis/polar/axis.d.ts +1 -1
- package/types/component/axis/polar/band-axis.d.ts +1 -1
- package/types/component/data-zoom/data-filter-base-component.d.ts +31 -52
- package/types/component/data-zoom/data-filter-event.d.ts +53 -0
- package/types/component/data-zoom/data-zoom/data-zoom.d.ts +23 -12
- package/types/component/data-zoom/scroll-bar/scroll-bar.d.ts +4 -3
- package/types/component/data-zoom/util.d.ts +14 -0
- package/types/constant/event.d.ts +1 -0
- package/types/core/vchart.d.ts +0 -2
- package/types/mark/base/base-mark.d.ts +2 -1
- package/types/mark/interface/common.d.ts +1 -0
- package/types/series/base/base-series.d.ts +1 -0
|
@@ -63,3 +63,4 @@ export declare const registerRectAnimation: () => void;
|
|
|
63
63
|
export declare const registerArcAnimation: () => void;
|
|
64
64
|
export declare const registerLineOrAreaAnimation: () => void;
|
|
65
65
|
export declare const registerPolygonAnimation: () => void;
|
|
66
|
+
export declare const registerStageAnimation: () => void;
|
|
@@ -15,7 +15,6 @@ import type { IParserOptions } from '@visactor/vdataset';
|
|
|
15
15
|
import type { IBoundsLike, Maybe } from '@visactor/vutils';
|
|
16
16
|
import { CompilableBase } from '../../compile/compilable-base';
|
|
17
17
|
import type { IGlobalScale } from '../../scale/interface';
|
|
18
|
-
import type { IAxis } from '../../component/axis/interface/common';
|
|
19
18
|
import type { IMorphConfig } from '../../animation/spec';
|
|
20
19
|
import type { IInteraction } from '../../interaction/interface/common';
|
|
21
20
|
export declare class BaseChart<T extends IChartSpec> extends CompilableBase implements IChart {
|
|
@@ -162,6 +161,5 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
162
161
|
}): IMarkGraphic[];
|
|
163
162
|
protected _setStateInDatum(stateKey: string, d: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
164
163
|
setDimensionIndex(value: StringOrNumber, opt: DimensionIndexOption): void;
|
|
165
|
-
showCrosshair(cb: (axis: IAxis) => false | string | number): void;
|
|
166
164
|
getColorScheme(): any;
|
|
167
165
|
}
|
|
@@ -14,7 +14,6 @@ import type { DataView } from '@visactor/vdataset';
|
|
|
14
14
|
import type { IGlobalScale } from '../../scale/interface';
|
|
15
15
|
import type { IMorphConfig } from '../../animation/spec';
|
|
16
16
|
import type { IMarkGraphic } from '../../mark/interface/common';
|
|
17
|
-
import type { IAxis } from '../../component/axis/interface';
|
|
18
17
|
export type DimensionIndexOption = {
|
|
19
18
|
filter?: (cmp: IComponent) => boolean;
|
|
20
19
|
tooltip?: boolean;
|
|
@@ -96,7 +95,6 @@ export interface IChart extends ICompilable {
|
|
|
96
95
|
setCurrentTheme: () => void;
|
|
97
96
|
getSeriesData: (id: StringOrNumber | undefined, index: number | undefined) => DataView | undefined;
|
|
98
97
|
setDimensionIndex: (value: StringOrNumber, opt: DimensionIndexOption) => void;
|
|
99
|
-
showCrosshair: (cb: (axis: IAxis) => false | string | number) => void;
|
|
100
98
|
filterGraphicsByDatum: (datum: MaybeArray<Datum> | null, opt?: {
|
|
101
99
|
filter?: (series: ISeries, mark: IMark) => boolean;
|
|
102
100
|
region?: IRegionQuerier;
|
|
@@ -8,6 +8,7 @@ import type { IMorphConfig } from '../animation/spec';
|
|
|
8
8
|
import type { IVChart, IVChartRenderOption } from '../core/interface';
|
|
9
9
|
import { type IMark } from '../mark/interface';
|
|
10
10
|
import type { Gesture } from '@visactor/vrender-kits';
|
|
11
|
+
import type { MarkAnimationSpec } from '../animation/interface';
|
|
11
12
|
type EventListener = {
|
|
12
13
|
type: string;
|
|
13
14
|
callback: (...args: any[]) => void;
|
|
@@ -19,6 +20,7 @@ export declare class Compiler implements ICompiler {
|
|
|
19
20
|
private _progressiveRafId?;
|
|
20
21
|
protected _rootMarks: IMark[];
|
|
21
22
|
protected _stage: IStage;
|
|
23
|
+
protected _stateAnimationConfig: Partial<MarkAnimationSpec>;
|
|
22
24
|
protected _rootGroup: IGroup;
|
|
23
25
|
getRootGroup(): IGroup;
|
|
24
26
|
protected _viewListeners: Map<(...args: any[]) => any, EventListener>;
|
|
@@ -61,6 +63,9 @@ export declare class Compiler implements ICompiler {
|
|
|
61
63
|
renderMarks(): void;
|
|
62
64
|
reuseOrMorphing(morphConfig?: IMorphConfig): void;
|
|
63
65
|
render(morphConfig?: IMorphConfig): void;
|
|
66
|
+
setStageAnimationConfig(config: Partial<MarkAnimationSpec>): void;
|
|
67
|
+
updateStateAnimation(): void;
|
|
68
|
+
runStageAnimation(): void;
|
|
64
69
|
updateViewBox(viewBox: IBoundsLike, reRender?: boolean): void;
|
|
65
70
|
resize(width: number, height: number, reRender?: boolean): void;
|
|
66
71
|
setBackground(color: IColor): void;
|
|
@@ -7,6 +7,7 @@ import type { IBoundsLike } from '@visactor/vutils';
|
|
|
7
7
|
import type { EventSourceType, EventType } from '../../event/interface';
|
|
8
8
|
import type { IMark, IMarkGraphic } from '../../mark/interface';
|
|
9
9
|
import type { LayoutState } from '../interface/compiler';
|
|
10
|
+
import type { MarkAnimationSpec } from '../../animation/interface';
|
|
10
11
|
export type CompilerListenerParameters = {
|
|
11
12
|
type: EventType;
|
|
12
13
|
event: Event;
|
|
@@ -39,6 +40,7 @@ export interface ICompiler {
|
|
|
39
40
|
}, removeGraphicItems?: boolean) => void;
|
|
40
41
|
renderNextTick: (morphConfig?: IMorphConfig) => void;
|
|
41
42
|
render: (morphConfig?: IMorphConfig) => void;
|
|
43
|
+
setStageAnimationConfig: (config: Partial<MarkAnimationSpec>) => void;
|
|
42
44
|
updateViewBox: (viewBox: IBoundsLike, reRender?: boolean) => void;
|
|
43
45
|
resize: (width: number, height: number, reRender?: boolean) => void;
|
|
44
46
|
setBackground: (color: IColor) => void;
|
|
@@ -43,7 +43,7 @@ export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<s
|
|
|
43
43
|
protected abstract updateSeriesScale(): void;
|
|
44
44
|
protected abstract collectSeriesField(depth: number, series: ISeries): string | string[];
|
|
45
45
|
abstract transformScaleDomain(): void;
|
|
46
|
-
|
|
46
|
+
abstract updateScaleRange(): boolean;
|
|
47
47
|
protected abstract getDefaultInteractive(): boolean;
|
|
48
48
|
protected _dataFieldText: string;
|
|
49
49
|
protected _axisMark: IComponentMark;
|
|
@@ -64,7 +64,7 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
|
|
|
64
64
|
}[]): StringOrNumber[];
|
|
65
65
|
abstract valueToPosition(value: any): number;
|
|
66
66
|
protected getNewScaleRange(): number[];
|
|
67
|
-
|
|
67
|
+
updateScaleRange(): boolean;
|
|
68
68
|
init(option: IModelInitOption): void;
|
|
69
69
|
setAttrFromSpec(): void;
|
|
70
70
|
onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect): void;
|
|
@@ -23,7 +23,7 @@ export declare class CartesianBandAxis<T extends ICartesianBandAxisSpec = ICarte
|
|
|
23
23
|
max: number;
|
|
24
24
|
values: any[];
|
|
25
25
|
}[]): StringOrNumber[];
|
|
26
|
-
|
|
26
|
+
updateScaleRange(): boolean;
|
|
27
27
|
protected initScales(): void;
|
|
28
28
|
protected axisHelper(): {
|
|
29
29
|
isContinuous: boolean;
|
|
@@ -42,6 +42,8 @@ export declare class BandAxisMixin {
|
|
|
42
42
|
protected _rawDomainIndex: {
|
|
43
43
|
[key: string | number | symbol]: number;
|
|
44
44
|
}[];
|
|
45
|
+
protected _rawDomain: StringOrNumber[][];
|
|
46
|
+
getRawDomain(): StringOrNumber[][];
|
|
45
47
|
dataToPosition(values: any[], cfg?: IAxisLocationCfg): number;
|
|
46
48
|
valueToPosition(value: any): number;
|
|
47
49
|
updateGroupScaleRange(): void;
|
|
@@ -27,7 +27,7 @@ export interface LinearAxisMixin {
|
|
|
27
27
|
_tick: ITick | undefined;
|
|
28
28
|
isSeriesDataEnable: any;
|
|
29
29
|
computeDomain: any;
|
|
30
|
-
collectData: (depth?: number) => {
|
|
30
|
+
collectData: (depth?: number, rawData?: boolean) => {
|
|
31
31
|
min: number;
|
|
32
32
|
max: number;
|
|
33
33
|
values: any[];
|
|
@@ -47,6 +47,8 @@ export declare class LinearAxisMixin {
|
|
|
47
47
|
protected _extend: {
|
|
48
48
|
[key: string]: number;
|
|
49
49
|
};
|
|
50
|
+
protected _rawDomain: StringOrNumber[];
|
|
51
|
+
getRawDomain(): StringOrNumber[];
|
|
50
52
|
niceLabelFormatter: (value: StringOrNumber) => StringOrNumber;
|
|
51
53
|
setExtraAttrFromSpec(): void;
|
|
52
54
|
transformScaleDomain(): void;
|
|
@@ -76,4 +78,6 @@ export declare class LinearAxisMixin {
|
|
|
76
78
|
protected updateScaleDomainByModel(domain?: number[]): void;
|
|
77
79
|
getDomainAfterSpec(): number[];
|
|
78
80
|
protected _updateNiceLabelFormatter(domain: number[]): void;
|
|
81
|
+
protected _updateRawDomain(): void;
|
|
82
|
+
protected _clearRawDomain(): void;
|
|
79
83
|
}
|
|
@@ -46,7 +46,7 @@ export declare abstract class PolarAxis<T extends IPolarAxisCommonSpec = IPolarA
|
|
|
46
46
|
setAttrFromSpec(): void;
|
|
47
47
|
_transformLayoutPosition: (pos: Partial<IPoint>) => Partial<IPoint>;
|
|
48
48
|
protected _tickTransformOption(): IPolarTickDataOpt;
|
|
49
|
-
|
|
49
|
+
updateScaleRange(): boolean;
|
|
50
50
|
protected collectSeriesField(depth: number, series: IPolarSeries): string | string[];
|
|
51
51
|
protected abstract computeDomain(data: {
|
|
52
52
|
min: number;
|
|
@@ -23,7 +23,7 @@ export declare class PolarBandAxis<T extends IPolarBandAxisSpec = IPolarBandAxis
|
|
|
23
23
|
max: number;
|
|
24
24
|
values: any[];
|
|
25
25
|
}[]): StringOrNumber[];
|
|
26
|
-
|
|
26
|
+
updateScaleRange(): boolean;
|
|
27
27
|
protected axisHelper(): {
|
|
28
28
|
getBandwidth: (depth: number) => number;
|
|
29
29
|
isContinuous: boolean;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
import { BaseComponent } from '../base/base-component';
|
|
2
2
|
import type { IEffect, IModelInitOption } from '../../model/interface';
|
|
3
3
|
import { type IComponent, type IComponentOption } from '../interface';
|
|
4
|
-
import type { AdaptiveSpec, ILayoutRect, ILayoutType, IOrientType, IRect, StringOrNumber } from '../../typings';
|
|
5
|
-
import type
|
|
6
|
-
import type
|
|
7
|
-
import type {
|
|
8
|
-
import type { IFilterMode } from './interface';
|
|
9
|
-
import type { IDataFilterComponent, IDataFilterComponentSpec, IRoamDragSpec, IRoamScrollSpec, IRoamZoomSpec } from './interface';
|
|
10
|
-
import type { BaseEventParams } from '../../event/interface';
|
|
4
|
+
import type { AdaptiveSpec, ILayoutPoint, ILayoutRect, ILayoutType, IOrientType, IRect, StringOrNumber } from '../../typings';
|
|
5
|
+
import { type IBaseScale } from '@visactor/vscale';
|
|
6
|
+
import { type IBoundsLike } from '@visactor/vutils';
|
|
7
|
+
import type { IDataFilterComponent, IDataFilterComponentSpec, IFilterMode } from './interface';
|
|
11
8
|
import type { AbstractComponent } from '@visactor/vrender-components';
|
|
12
9
|
import type { IGraphic } from '@visactor/vrender-core';
|
|
10
|
+
import { DataFilterEvent } from './data-filter-event';
|
|
13
11
|
export declare abstract class DataFilterBaseComponent<T extends IDataFilterComponentSpec = IDataFilterComponentSpec> extends BaseComponent<AdaptiveSpec<T, 'width' | 'height'>> implements IDataFilterComponent {
|
|
12
|
+
protected _dataFilterEvent: DataFilterEvent;
|
|
14
13
|
layoutType: ILayoutType | 'none';
|
|
15
14
|
protected _component: AbstractComponent;
|
|
16
15
|
protected _orient: IOrientType;
|
|
17
16
|
protected _isHorizontal: boolean;
|
|
18
|
-
|
|
17
|
+
get isHorizontal(): boolean;
|
|
19
18
|
protected _auto?: boolean;
|
|
20
19
|
protected _fixedBandSize?: number;
|
|
21
20
|
protected _cacheRect?: ILayoutRect;
|
|
21
|
+
protected _cacheLayoutStartPoint?: ILayoutPoint;
|
|
22
22
|
protected _cacheVisibility?: boolean;
|
|
23
23
|
protected _dataUpdating: boolean;
|
|
24
24
|
protected _stateScale: IBaseScale;
|
|
25
|
-
|
|
26
|
-
protected
|
|
25
|
+
get stateScale(): IBaseScale;
|
|
26
|
+
protected _hasInitStateScale: boolean;
|
|
27
27
|
protected _seriesUserId?: StringOrNumber[];
|
|
28
28
|
protected _seriesIndex?: number[];
|
|
29
29
|
protected _regionUserId: string[];
|
|
30
30
|
protected _regionIndex: number[];
|
|
31
31
|
protected _newDomain: any[];
|
|
32
|
+
protected _relatedAxisComponent: IComponent;
|
|
33
|
+
get relatedAxisComponent(): IComponent;
|
|
34
|
+
protected _originalStateFields: Record<number, string | number>;
|
|
32
35
|
protected _startValue: number | string;
|
|
33
36
|
protected _endValue: number | string;
|
|
34
37
|
protected _start: number;
|
|
@@ -44,11 +47,6 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
|
|
|
44
47
|
protected _width: number;
|
|
45
48
|
protected _height: number;
|
|
46
49
|
protected _filterMode: IFilterMode;
|
|
47
|
-
protected _activeRoam: boolean;
|
|
48
|
-
protected _zoomAttr: IRoamZoomSpec;
|
|
49
|
-
protected _dragAttr: IRoamDragSpec;
|
|
50
|
-
protected _scrollAttr: IRoamScrollSpec;
|
|
51
|
-
get relatedAxisComponent(): IComponent;
|
|
52
50
|
setStartAndEnd(start: number | string, end: number | string, rangeMode?: ['percent' | 'value', 'percent' | 'value']): void;
|
|
53
51
|
enableInteraction(): void;
|
|
54
52
|
disableInteraction(): void;
|
|
@@ -64,30 +62,18 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
|
|
|
64
62
|
protected abstract _computeWidth(): number;
|
|
65
63
|
protected abstract _computeHeight(): number;
|
|
66
64
|
protected abstract _handleDataCollectionChange(): void;
|
|
65
|
+
protected abstract _updateScaleRange(): void;
|
|
66
|
+
protected _initEvent(): void;
|
|
67
67
|
protected _handleChange(start: number, end: number, updateComponent?: boolean): void;
|
|
68
|
-
protected _isReverse(): boolean;
|
|
69
68
|
protected _updateRangeFactor(tag?: 'startHandler' | 'endHandler'): void;
|
|
69
|
+
protected _handleStateChange: (startValue: number, endValue: number, tag?: string) => boolean;
|
|
70
70
|
effect: IEffect;
|
|
71
71
|
protected _visible: boolean;
|
|
72
72
|
get visible(): boolean;
|
|
73
73
|
constructor(spec: T, options: IComponentOption);
|
|
74
74
|
created(): void;
|
|
75
75
|
initLayout(): void;
|
|
76
|
-
protected _setAxisFromSpec(): void;
|
|
77
|
-
protected _setRegionsFromSpec(): void;
|
|
78
|
-
onDataUpdate(): void;
|
|
79
|
-
protected _computeDomainOfStateScale(isContinuous?: boolean): any;
|
|
80
|
-
protected _initEvent(): void;
|
|
81
|
-
protected _initData(): void;
|
|
82
|
-
setAttrFromSpec(): void;
|
|
83
|
-
statePointToData(state: number): any;
|
|
84
|
-
dataToStatePoint(data: number | string): number;
|
|
85
|
-
protected _modeCheck(statePoint: 'start' | 'end', mode: string): any;
|
|
86
|
-
protected _setStateFromSpec(): void;
|
|
87
|
-
private _parseFieldOfSeries;
|
|
88
|
-
protected _initStateScale(): void;
|
|
89
76
|
init(option: IModelInitOption): void;
|
|
90
|
-
protected _addTransformToSeries(): void;
|
|
91
77
|
_compareSpec(spec: AdaptiveSpec<T, 'width' | 'height'>, prevSpec: AdaptiveSpec<T, 'width' | 'height'>): {
|
|
92
78
|
change: boolean;
|
|
93
79
|
reMake: boolean;
|
|
@@ -96,33 +82,26 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
|
|
|
96
82
|
reCompile: boolean;
|
|
97
83
|
};
|
|
98
84
|
reInit(spec?: AdaptiveSpec<T, 'width' | 'height'>): void;
|
|
99
|
-
protected _parseDomainFromState(startValue: number | string, endValue: number | string): any;
|
|
100
|
-
protected _handleStateChange: (startValue: number, endValue: number, tag?: string) => boolean;
|
|
101
|
-
protected _handleChartZoom: (params: {
|
|
102
|
-
zoomDelta: number;
|
|
103
|
-
zoomX?: number;
|
|
104
|
-
zoomY?: number;
|
|
105
|
-
}, e?: BaseEventParams['event']) => void;
|
|
106
|
-
protected _handleChartScroll: (params: {
|
|
107
|
-
scrollX: number;
|
|
108
|
-
scrollY: number;
|
|
109
|
-
}, e: BaseEventParams['event']) => boolean;
|
|
110
|
-
protected _handleChartDrag: (delta: [number, number], e: BaseEventParams['event']) => void;
|
|
111
|
-
protected _handleChartMove: (value: number, rate: number) => boolean;
|
|
112
|
-
protected _initCommonEvent(): void;
|
|
113
|
-
updateLayoutAttribute(): void;
|
|
114
|
-
protected _autoVisible(isShown: boolean): void;
|
|
115
85
|
onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect): void;
|
|
86
|
+
updateLayoutAttribute(): void;
|
|
87
|
+
protected _initAfterLayout(): void;
|
|
88
|
+
protected _beforeLayoutEnd(): void;
|
|
116
89
|
onLayoutEnd(): void;
|
|
117
90
|
getBoundsInRect(rect: ILayoutRect): IBoundsLike;
|
|
91
|
+
setAttrFromSpec(): void;
|
|
92
|
+
protected _setAxisFromSpec(): void;
|
|
93
|
+
protected _setRegionsFromSpec(): void;
|
|
94
|
+
protected _initData(): void;
|
|
95
|
+
protected _addTransformToSeries(): void;
|
|
96
|
+
onDataUpdate(): void;
|
|
97
|
+
private _parseFieldOfSeries;
|
|
98
|
+
protected _setStateFromSpec(): void;
|
|
99
|
+
protected _setStateFromAxis(): void;
|
|
100
|
+
protected _initStateScale(): void;
|
|
101
|
+
protected _computeDomainOfStateScale(isContinuous?: boolean): any;
|
|
102
|
+
protected _autoVisible(isShown: boolean): void;
|
|
118
103
|
hide(): void;
|
|
119
104
|
show(): void;
|
|
120
|
-
protected _getAxisBandSize(axisSpec?: ICartesianBandAxisSpec): {
|
|
121
|
-
bandSize: number;
|
|
122
|
-
maxBandSize: number;
|
|
123
|
-
minBandSize: number;
|
|
124
|
-
};
|
|
125
105
|
protected _autoUpdate(rect?: ILayoutRect): boolean;
|
|
126
106
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
127
|
-
clear(): void;
|
|
128
107
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { IRoamDragSpec, IRoamScrollSpec, IRoamZoomSpec } from './interface';
|
|
2
|
+
import type { BaseEventParams, IEvent } from '../../event/interface';
|
|
3
|
+
import type { IDataZoomSpec } from './data-zoom/interface';
|
|
4
|
+
import type { IRegion } from '../../region';
|
|
5
|
+
import { type ILayoutRect } from '../../typings';
|
|
6
|
+
import type { IComponentOption } from '../interface';
|
|
7
|
+
export declare class DataFilterEvent {
|
|
8
|
+
protected _type: 'dataZoom' | 'scrollBar';
|
|
9
|
+
protected _spec: IDataZoomSpec;
|
|
10
|
+
protected _option: IComponentOption;
|
|
11
|
+
protected _handleChange: (start: number, end: number, updateComponent?: boolean) => void;
|
|
12
|
+
protected getLayoutRect: () => ILayoutRect;
|
|
13
|
+
protected getState: () => {
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
};
|
|
17
|
+
protected getRegions: () => IRegion[];
|
|
18
|
+
protected getOption: () => IComponentOption;
|
|
19
|
+
protected getEvent: () => IEvent;
|
|
20
|
+
protected _isHorizontal: boolean;
|
|
21
|
+
protected _regions: IRegion[];
|
|
22
|
+
protected _activeRoam: boolean;
|
|
23
|
+
protected _zoomAttr: IRoamZoomSpec;
|
|
24
|
+
protected _dragAttr: IRoamDragSpec;
|
|
25
|
+
protected _scrollAttr: IRoamScrollSpec;
|
|
26
|
+
enableInteraction(): void;
|
|
27
|
+
disableInteraction(): void;
|
|
28
|
+
zoomIn(location?: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
}): void;
|
|
32
|
+
zoomOut(location?: {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
}): void;
|
|
36
|
+
constructor(type: 'dataZoom' | 'scrollBar', spec: IDataZoomSpec, handleChange: (start: number, end: number, updateComponent?: boolean) => void, getLayoutRect: () => ILayoutRect, getState: () => {
|
|
37
|
+
start: number;
|
|
38
|
+
end: number;
|
|
39
|
+
}, getRegions: () => IRegion[], getOption: () => IComponentOption, getEvent: () => IEvent);
|
|
40
|
+
setEventAttrFromSpec(): void;
|
|
41
|
+
initZoomEvent: () => void;
|
|
42
|
+
handleChartZoom: (params: {
|
|
43
|
+
zoomDelta: number;
|
|
44
|
+
zoomX?: number;
|
|
45
|
+
zoomY?: number;
|
|
46
|
+
}, e?: BaseEventParams['event']) => void;
|
|
47
|
+
handleChartScroll: (params: {
|
|
48
|
+
scrollX: number;
|
|
49
|
+
scrollY: number;
|
|
50
|
+
}, e: BaseEventParams['event']) => boolean;
|
|
51
|
+
handleChartDrag: (delta: [number, number], e: BaseEventParams['event']) => void;
|
|
52
|
+
handleChartMove: (value: number, rate: number) => boolean;
|
|
53
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { ComponentTypeEnum } from '../../interface
|
|
1
|
+
import { type IBoundsLike } from '@visactor/vutils';
|
|
2
|
+
import { ComponentTypeEnum, type IComponentOption } from '../../interface';
|
|
3
3
|
import { DataFilterBaseComponent } from '../data-filter-base-component';
|
|
4
4
|
import { DataZoom as DataZoomComponent } from '@visactor/vrender-components';
|
|
5
5
|
import type { IRectGraphicAttribute, ISymbolGraphicAttribute, IGraphic } from '@visactor/vrender-core';
|
|
6
|
-
import type { Datum, ILayoutType } from '../../../typings';
|
|
7
|
-
import type
|
|
6
|
+
import type { Datum, ILayoutRect, ILayoutType } from '../../../typings';
|
|
7
|
+
import { type ILinearScale, type IBaseScale } from '@visactor/vscale';
|
|
8
8
|
import type { IDataZoomSpec } from './interface';
|
|
9
9
|
import { DataZoomSpecTransformer } from './data-zoom-transformer';
|
|
10
10
|
export declare class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends DataFilterBaseComponent<T> {
|
|
@@ -28,25 +28,35 @@ export declare class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends D
|
|
|
28
28
|
protected _startHandlerSize: number;
|
|
29
29
|
protected _endHandlerSize: number;
|
|
30
30
|
protected _isReverseCache: boolean;
|
|
31
|
+
protected _cacheRect?: ILayoutRect;
|
|
32
|
+
protected _previewStateScale: IBaseScale;
|
|
31
33
|
constructor(spec: T, options: IComponentOption);
|
|
34
|
+
protected _handleChange(start: number, end: number, updateComponent?: boolean, tag?: string): void;
|
|
35
|
+
protected _handleDataCollectionChange(): void;
|
|
32
36
|
created(): void;
|
|
37
|
+
updateLayoutAttribute(): void;
|
|
38
|
+
protected _beforeLayoutEnd(): void;
|
|
39
|
+
clear(): void;
|
|
40
|
+
getBoundsInRect(rect: ILayoutRect): IBoundsLike;
|
|
33
41
|
setAttrFromSpec(): void;
|
|
34
|
-
onLayoutEnd(): void;
|
|
35
42
|
protected _initValueScale(): void;
|
|
36
43
|
protected _updateScaleRange(): void;
|
|
44
|
+
protected _updateStateScaleRange(): void;
|
|
45
|
+
protected _updateValueScaleRange(): void;
|
|
37
46
|
protected _computeDomainOfValueScale(): unknown[];
|
|
38
|
-
protected _computeMiddleHandlerSize(): number;
|
|
39
|
-
protected _computeWidth(): number;
|
|
40
|
-
protected _computeHeight(): number;
|
|
41
47
|
protected _isScaleValid(scale: IBaseScale | ILinearScale): boolean;
|
|
48
|
+
protected _getXScale(): IBaseScale | ILinearScale;
|
|
49
|
+
protected _getYScale(): IBaseScale | ILinearScale;
|
|
42
50
|
protected _dataToPositionX: (datum: Datum) => number;
|
|
43
51
|
protected _dataToPositionX2: (datum: Datum) => number;
|
|
44
52
|
protected _dataToPositionY: (datum: Datum) => number;
|
|
45
53
|
protected _dataToPositionY2: (datum: Datum) => number;
|
|
54
|
+
protected _computeMiddleHandlerSize(): number;
|
|
55
|
+
protected _computeWidth(): number;
|
|
56
|
+
protected _computeHeight(): number;
|
|
46
57
|
private _getAttrs;
|
|
47
|
-
|
|
48
|
-
protected
|
|
49
|
-
protected _handleDataCollectionChange(): void;
|
|
58
|
+
private _getLayoutAttrs;
|
|
59
|
+
protected _createOrUpdateComponent(changeData?: boolean): void;
|
|
50
60
|
protected _getComponentAttrs(isNeedPreview: boolean): {
|
|
51
61
|
backgroundStyle: IRectGraphicAttribute;
|
|
52
62
|
startHandlerStyle: ISymbolGraphicAttribute;
|
|
@@ -76,6 +86,7 @@ export declare class DataZoom<T extends IDataZoomSpec = IDataZoomSpec> extends D
|
|
|
76
86
|
};
|
|
77
87
|
protected _getHandlerTextFormatMethod(spec: IDataZoomSpec['startText']): (text: any) => any;
|
|
78
88
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
79
|
-
|
|
89
|
+
onDataUpdate(): void;
|
|
90
|
+
protected _getPreviewStateScale(): IBaseScale;
|
|
80
91
|
}
|
|
81
92
|
export declare const registerDataZoom: () => void;
|
|
@@ -20,15 +20,16 @@ export declare class ScrollBar<T extends IScrollBarSpec = IScrollBarSpec> extend
|
|
|
20
20
|
layoutType: ILayoutType;
|
|
21
21
|
protected _component: ScrollBarComponent;
|
|
22
22
|
constructor(spec: T, options: IComponentOption);
|
|
23
|
-
|
|
23
|
+
protected _handleChange(start: number, end: number, updateComponent?: boolean): void;
|
|
24
|
+
protected _handleDataCollectionChange(): void;
|
|
25
|
+
protected _beforeLayoutEnd(): void;
|
|
24
26
|
onLayoutEnd(): void;
|
|
25
27
|
protected _updateScaleRange(): void;
|
|
28
|
+
protected _updateComponentBounds(): void;
|
|
26
29
|
protected _computeWidth(): number;
|
|
27
30
|
protected _computeHeight(): number;
|
|
28
31
|
private _getAttrs;
|
|
29
32
|
protected _createOrUpdateComponent(): void;
|
|
30
|
-
protected _handleChange(start: number, end: number, updateComponent?: boolean): void;
|
|
31
|
-
protected _handleDataCollectionChange(): void;
|
|
32
33
|
protected _getComponentAttrs(): Partial<ScrollBarAttributes>;
|
|
33
34
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
34
35
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IBaseScale } from '@visactor/vscale';
|
|
2
|
+
import type { CartesianAxis, ICartesianBandAxisSpec } from '../axis/cartesian';
|
|
1
3
|
export interface IDataFilterWithNewDomainOption {
|
|
2
4
|
getNewDomain: () => any[];
|
|
3
5
|
isContinuous: () => boolean;
|
|
@@ -13,6 +15,7 @@ export interface IDataFilterComputeDomainOption {
|
|
|
13
15
|
stateFields: string[];
|
|
14
16
|
valueFields: string[];
|
|
15
17
|
isCategoryState?: boolean;
|
|
18
|
+
seriesCollection: any[];
|
|
16
19
|
method: 'sum';
|
|
17
20
|
};
|
|
18
21
|
output: {
|
|
@@ -21,3 +24,14 @@ export interface IDataFilterComputeDomainOption {
|
|
|
21
24
|
};
|
|
22
25
|
}
|
|
23
26
|
export declare const dataFilterComputeDomain: (data: Array<any>, op: IDataFilterComputeDomainOption) => any[];
|
|
27
|
+
export declare const statePointToData: (state: number, scale: IBaseScale, reverse: boolean) => any;
|
|
28
|
+
export declare const dataToStatePoint: (data: number | string, scale: IBaseScale, isHorizontal: boolean) => number;
|
|
29
|
+
export declare const isReverse: (axisComponent: CartesianAxis<any>, isHorizontal: boolean) => boolean;
|
|
30
|
+
export declare const getAxisBandSize: (axisSpec?: ICartesianBandAxisSpec) => {
|
|
31
|
+
bandSize: number;
|
|
32
|
+
maxBandSize: number;
|
|
33
|
+
minBandSize: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const modeCheck: (statePoint: 'start' | 'end', mode: string, spec: any) => any;
|
|
36
|
+
export declare const parseDomainFromState: (startValue: number | string, endValue: number | string, scale: IBaseScale) => any;
|
|
37
|
+
export declare const parseDomainFromStateAndValue: (start: number, startValue: number | string, end: number, endValue: number | string, scale: IBaseScale) => any;
|
|
@@ -66,6 +66,7 @@ export declare enum ChartEvent {
|
|
|
66
66
|
markDeltaYUpdate = "markDeltaYUpdate",
|
|
67
67
|
viewDataLabelUpdate = "viewDataLabelUpdate",
|
|
68
68
|
scaleDomainUpdate = "scaleDomainUpdate",
|
|
69
|
+
scaleRawDomainUpdate = "scaleRawDomainUpdate",
|
|
69
70
|
scaleUpdate = "scaleUpdate",
|
|
70
71
|
dataZoomChange = "dataZoomChange",
|
|
71
72
|
drill = "drill",
|
package/types/core/vchart.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ import { Compiler } from '../compile/compiler';
|
|
|
22
22
|
import type { IMorphConfig } from '../animation/spec';
|
|
23
23
|
import type { DataLinkAxis, DataLinkSeries, IGlobalConfig, IVChart, IVChartRenderOption } from './interface';
|
|
24
24
|
import { InstanceManager } from './instance-manager';
|
|
25
|
-
import type { IAxis } from '../component/axis';
|
|
26
25
|
export declare class VChart implements IVChart {
|
|
27
26
|
readonly id: number;
|
|
28
27
|
static useRegisters(comps: (() => void)[]): void;
|
|
@@ -181,7 +180,6 @@ export declare class VChart implements IVChart {
|
|
|
181
180
|
getComponents(): import("../component/interface").IComponent[];
|
|
182
181
|
getScale(scaleId: string): import("@visactor/vscale").IBaseScale;
|
|
183
182
|
setDimensionIndex(value: StringOrNumber, opt?: DimensionIndexOption): void;
|
|
184
|
-
showCrosshair(cb: (axis: IAxis) => false | string | number): void;
|
|
185
183
|
stopAnimation(): void;
|
|
186
184
|
reRunNormalAnimation(): void;
|
|
187
185
|
pauseAnimation(): void;
|
|
@@ -9,7 +9,7 @@ import type { IGroupGraphicAttribute, IGroup, IGraphic } from '@visactor/vrender
|
|
|
9
9
|
import { GrammarItem } from '../../compile/grammar-item';
|
|
10
10
|
import type { IModel } from '../../model/interface';
|
|
11
11
|
import type { ICompilableData } from '../../compile/data/interface';
|
|
12
|
-
import { type MarkAnimationSpec } from '../../animation/interface';
|
|
12
|
+
import { AnimationStateEnum, type MarkAnimationSpec } from '../../animation/interface';
|
|
13
13
|
export type ExChannelCall = (key: string | number | symbol, datum: Datum, states: StateValueType, baseValue: unknown) => unknown;
|
|
14
14
|
export declare class BaseMark<T extends ICommonSpec> extends GrammarItem implements IMarkRaw<T> {
|
|
15
15
|
readonly type: MarkType;
|
|
@@ -139,6 +139,7 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
139
139
|
getGraphics(): IMarkGraphic[];
|
|
140
140
|
protected _createGraphic(attrs?: any): IGraphic;
|
|
141
141
|
protected _runGroupData(data: Datum[]): void;
|
|
142
|
+
getAnimationState(): AnimationStateEnum.appear | AnimationStateEnum.disappear | AnimationStateEnum.none | AnimationStateValues;
|
|
142
143
|
protected createAnimationStateList(type: string, animationConfig: Partial<MarkAnimationSpec>): any;
|
|
143
144
|
protected tryRunMorphing(graphics: IMarkGraphic[]): boolean;
|
|
144
145
|
protected _runStateAnimation(graphics: IMarkGraphic[]): void;
|
|
@@ -95,6 +95,7 @@ export interface IMarkRaw<T extends ICommonSpec> extends ICompilableMark {
|
|
|
95
95
|
renderProgressive: () => void;
|
|
96
96
|
canAnimateAfterProgressive: () => boolean;
|
|
97
97
|
runAnimation: () => void;
|
|
98
|
+
getAnimationState: () => AnimationStateValues;
|
|
98
99
|
needClear?: boolean;
|
|
99
100
|
disableAnimationByState: (state: string | string[]) => void;
|
|
100
101
|
enableAnimationByState: (state: string | string[]) => void;
|
|
@@ -158,6 +158,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
158
158
|
marks: IMark[];
|
|
159
159
|
}[];
|
|
160
160
|
initAnimation(): void;
|
|
161
|
+
initStageAnimation(): void;
|
|
161
162
|
initMarkState(): void;
|
|
162
163
|
initSeriesStyleState(): void;
|
|
163
164
|
afterInitMark(): void;
|