@visactor/vchart-types 2.1.0-alpha.0 → 2.1.0-alpha.2
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-transformer.d.ts +3 -0
- package/types/chart/base/base-chart.d.ts +15 -9
- package/types/chart/interface/chart.d.ts +1 -0
- package/types/chart/util.d.ts +4 -1
- package/types/compile/data/compilable-data.d.ts +1 -1
- package/types/compile/grammar-item.d.ts +1 -1
- package/types/compile/interface/compilable-item.d.ts +1 -1
- package/types/component/axis/base-axis.d.ts +2 -7
- package/types/component/axis/cartesian/band-axis.d.ts +1 -7
- package/types/component/base/base-component.d.ts +7 -7
- package/types/component/base/release-vrender-component.d.ts +10 -0
- package/types/component/brush/brush.d.ts +2 -7
- package/types/component/crosshair/base.d.ts +1 -7
- package/types/component/custom-mark/custom-mark.d.ts +1 -7
- package/types/component/data-zoom/data-filter-base-component.d.ts +1 -7
- package/types/component/geo/geo-coordinate.d.ts +1 -7
- package/types/component/label/base-label.d.ts +1 -7
- package/types/component/legend/base-legend.d.ts +2 -7
- package/types/component/marker/base-marker.d.ts +7 -7
- package/types/component/title/title.d.ts +1 -7
- package/types/core/vchart.d.ts +5 -1
- package/types/data/data-view-utils.d.ts +5 -0
- package/types/mark/base/base-mark.d.ts +12 -2
- package/types/mark/component.d.ts +9 -0
- package/types/mark/interface/mark.d.ts +2 -0
- package/types/model/base-model.d.ts +3 -15
- package/types/model/interface.d.ts +13 -0
- package/types/region/region.d.ts +1 -7
- package/types/series/area/area.d.ts +2 -0
- package/types/series/bar/bar.d.ts +3 -0
- package/types/series/base/base-series.d.ts +8 -7
- package/types/series/base/constant.d.ts +3 -0
- package/types/series/box-plot/box-plot.d.ts +2 -0
- package/types/series/heatmap/heatmap.d.ts +2 -0
- package/types/series/line/line.d.ts +2 -0
- package/types/series/mixin/line-mixin.d.ts +1 -0
- package/types/series/pie/pie.d.ts +3 -7
- package/types/series/progress/circular/circular.d.ts +2 -0
- package/types/series/progress/linear/linear.d.ts +2 -0
- package/types/series/scatter/scatter.d.ts +2 -0
- package/types/series/waterfall/waterfall.d.ts +2 -0
- package/types/util/graphic-state.d.ts +1 -0
|
@@ -8,6 +8,7 @@ import type { ICartesianBandAxisSpec } from '../..//component/axis/cartesian/int
|
|
|
8
8
|
export declare class BaseChartSpecTransformer<T extends IChartSpec> implements IChartSpecTransformer {
|
|
9
9
|
readonly type: string;
|
|
10
10
|
readonly seriesType: string;
|
|
11
|
+
protected _seriesRelatedSpecKeys: Record<string, true>;
|
|
11
12
|
protected _option: IChartSpecTransformerOption;
|
|
12
13
|
constructor(option: IChartSpecTransformerOption);
|
|
13
14
|
initChartSpec(chartSpec: T): IChartSpecInfo;
|
|
@@ -16,6 +17,8 @@ export declare class BaseChartSpecTransformer<T extends IChartSpec> implements I
|
|
|
16
17
|
transformModelSpec(chartSpec: T): IChartSpecInfo;
|
|
17
18
|
createSpecInfo(chartSpec: T, transform?: (constructor: IModelConstructor, specInfo: IModelSpecInfo, chartSpecInfo?: IChartSpecInfo) => void): IChartSpecInfo;
|
|
18
19
|
protected _isValidSeries(seriesType: string): boolean;
|
|
20
|
+
getSeriesRelatedSpecKeys(): Record<string, true>;
|
|
21
|
+
protected _addSeriesRelatedSpecKeys(...keysList: Array<string[] | undefined>): void;
|
|
19
22
|
protected _getDefaultSeriesSpec(chartSpec: any, pickKeys?: string[], pickKeys2?: string[]): any;
|
|
20
23
|
forEachRegionInSpec<K>(chartSpec: T, callbackfn: (constructor: IRegionConstructor, specInfo: IModelSpecInfo, chartSpecInfo?: IChartSpecInfo) => K, chartSpecInfo?: IChartSpecInfo): K[];
|
|
21
24
|
forEachSeriesInSpec<K>(chartSpec: T, callbackfn: (constructor: ISeriesConstructor, specInfo: IModelSpecInfo, chartSpecInfo?: IChartSpecInfo) => K, chartSpecInfo?: IChartSpecInfo): K[];
|
|
@@ -30,6 +30,7 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
30
30
|
protected _regions: IRegion[];
|
|
31
31
|
protected _series: ISeries[];
|
|
32
32
|
protected _components: IComponent[];
|
|
33
|
+
protected _specTransformer: Maybe<IChartSpecTransformer>;
|
|
33
34
|
protected _layoutFunc: LayoutCallBack;
|
|
34
35
|
protected _layoutRect: IRect;
|
|
35
36
|
getLayoutRect(): IRect;
|
|
@@ -118,17 +119,22 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
118
119
|
updateGlobalScale(result: IUpdateSpecResult): void;
|
|
119
120
|
updateGlobalScaleTheme(): void;
|
|
120
121
|
private _getSpecKeys;
|
|
121
|
-
updateSpec(spec: T):
|
|
122
|
-
change: boolean;
|
|
123
|
-
reMake: boolean;
|
|
124
|
-
reRender: boolean;
|
|
125
|
-
reSize: boolean;
|
|
126
|
-
reCompile: boolean;
|
|
127
|
-
};
|
|
122
|
+
updateSpec(spec: T): IUpdateSpecResult;
|
|
128
123
|
updateChartConfig(result: IUpdateSpecResult, oldSpec: IChartSpec): void;
|
|
129
124
|
updateDataSpec(): void;
|
|
130
125
|
updateRegionSpec(result: IUpdateSpecResult): void;
|
|
131
|
-
updateComponentSpec(result: IUpdateSpecResult):
|
|
126
|
+
updateComponentSpec(result: IUpdateSpecResult): {
|
|
127
|
+
componentOnlyUpdatedComponents: IComponent[];
|
|
128
|
+
hasNonComponentOnlyUpdate: boolean;
|
|
129
|
+
};
|
|
130
|
+
private _canRemoveMarkerComponentsWithoutRemake;
|
|
131
|
+
private _isOnlyMarkerComponentsRemoved;
|
|
132
|
+
private _isComponentSpecKey;
|
|
133
|
+
private _isOnlyComponentSpecsChanged;
|
|
134
|
+
private _isOnlySeriesSpecsChanged;
|
|
135
|
+
private _canSkipChartDataStages;
|
|
136
|
+
private _removeMarkerComponentsForEmptySpecs;
|
|
137
|
+
private _removeComponent;
|
|
132
138
|
updateSeriesSpec(result: IUpdateSpecResult): void;
|
|
133
139
|
getCanvas(): HTMLCanvasElement;
|
|
134
140
|
private _updateLayoutRect;
|
|
@@ -142,7 +148,7 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
142
148
|
compileRegions(): void;
|
|
143
149
|
compileSeries(): void;
|
|
144
150
|
compileComponents(): void;
|
|
145
|
-
release(): void;
|
|
151
|
+
release(forceReleaseVRenderComponents?: boolean): void;
|
|
146
152
|
onLayout(): void;
|
|
147
153
|
updateState(state: Record<string, Omit<IMarkStateSpec<unknown>, 'style'>>, filter?: (series: ISeries, mark: IMark, stateKey: string) => boolean): void;
|
|
148
154
|
setSelected(datum: MaybeArray<any> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
@@ -112,6 +112,7 @@ export interface IChartSpecTransformer {
|
|
|
112
112
|
transformSpec: (spec: any) => void;
|
|
113
113
|
transformModelSpec: (spec: any) => IChartSpecInfo;
|
|
114
114
|
createSpecInfo: (chartSpec: any, transform?: (constructor: IModelConstructor, specInfo: IModelSpecInfo, chartSpecInfo?: IChartSpecInfo) => void) => IChartSpecInfo;
|
|
115
|
+
getSeriesRelatedSpecKeys: () => Record<string, true>;
|
|
115
116
|
forEachRegionInSpec: <K>(spec: any, callbackfn: (constructor: IRegionConstructor, specInfo: IModelSpecInfo, chartSpecInfo?: IChartSpecInfo) => K, chartSpecInfo?: IChartSpecInfo) => K[];
|
|
116
117
|
forEachSeriesInSpec: <K>(spec: any, callbackfn: (constructor: ISeriesConstructor, specInfo: IModelSpecInfo, chartSpecInfo?: IChartSpecInfo) => K, chartSpecInfo?: IChartSpecInfo) => K[];
|
|
117
118
|
forEachComponentInSpec: <K>(spec: any, callbackfn: (constructor: IComponentConstructor, specInfo: IModelSpecInfo, chartSpecInfo?: IChartSpecInfo) => K, chartSpecInfo?: IChartSpecInfo) => K[];
|
package/types/chart/util.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IChartSpec } from '../typings';
|
|
2
2
|
import type { ICartesianChartSpec } from './cartesian/interface';
|
|
3
3
|
import type { IChartOption } from './interface/common';
|
|
4
|
-
import type { IUpdateSpecResult } from '../model/interface';
|
|
4
|
+
import type { IUpdateSpecEffects, IUpdateSpecResult } from '../model/interface';
|
|
5
5
|
export declare function setDefaultCrosshairForCartesianChart(spec: ICartesianChartSpec): void;
|
|
6
6
|
export declare function calculateChartSize(spec: {
|
|
7
7
|
width?: number;
|
|
@@ -13,6 +13,9 @@ export declare function calculateChartSize(spec: {
|
|
|
13
13
|
width: number;
|
|
14
14
|
height: number;
|
|
15
15
|
};
|
|
16
|
+
export declare function normalizeUpdateSpecEffects(result: IUpdateSpecResult): IUpdateSpecEffects;
|
|
17
|
+
export declare function isUpdateSpecResultLocalOnly(result: IUpdateSpecResult): boolean;
|
|
18
|
+
export declare function isUpdateSpecResultComponentOnly(result: IUpdateSpecResult): boolean;
|
|
16
19
|
export declare function mergeUpdateResult(target: IUpdateSpecResult, ...sources: IUpdateSpecResult[]): IUpdateSpecResult;
|
|
17
20
|
export declare function getTrimPaddingConfig(chartType: string, spec: IChartSpec): {
|
|
18
21
|
paddingInner: number;
|
|
@@ -13,7 +13,7 @@ export declare class CompilableData extends GrammarItem implements ICompilableDa
|
|
|
13
13
|
setDataView(d?: DataView): void;
|
|
14
14
|
getLatestData(): any;
|
|
15
15
|
constructor(option: GrammarItemInitOption, dataView?: DataView);
|
|
16
|
-
removeProduct(): void;
|
|
16
|
+
removeProduct(_releaseDetach?: boolean): void;
|
|
17
17
|
release(): void;
|
|
18
18
|
protected _relatedMarks?: Record<string, ICompilableMark>;
|
|
19
19
|
addRelatedMark(mark: ICompilableMark): void;
|
|
@@ -11,7 +11,7 @@ export declare abstract class GrammarItem extends CompilableBase implements IGra
|
|
|
11
11
|
getProductId(): string;
|
|
12
12
|
compile(option?: GrammarItemCompileOption): void;
|
|
13
13
|
protected abstract _compileProduct(option?: GrammarItemCompileOption): void;
|
|
14
|
-
abstract removeProduct(): void;
|
|
14
|
+
abstract removeProduct(releaseDetach?: boolean): void;
|
|
15
15
|
protected _transform: ITransformSpec[];
|
|
16
16
|
setTransform(transform: ITransformSpec[]): void;
|
|
17
17
|
runTransforms<T = any>(transforms: ITransformSpec[], data: T): T;
|
|
@@ -85,7 +85,7 @@ export interface IGrammarItem extends ICompilable {
|
|
|
85
85
|
id: number;
|
|
86
86
|
generateProductId: () => string;
|
|
87
87
|
getProductId: () => string;
|
|
88
|
-
removeProduct: () => void;
|
|
88
|
+
removeProduct: (releaseDetach?: boolean) => void;
|
|
89
89
|
setTransform: (transform: ITransformSpec[]) => void;
|
|
90
90
|
}
|
|
91
91
|
export type GrammarItemInitOption = ICompilableInitOption;
|
|
@@ -82,13 +82,8 @@ export declare abstract class AxisComponent<T extends ICommonAxisSpec & Record<s
|
|
|
82
82
|
protected computeData(updateType?: 'domain' | 'range' | 'force'): void;
|
|
83
83
|
protected _updateTickDataMarks(m: ICompilableMark): void;
|
|
84
84
|
protected initScales(): void;
|
|
85
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
86
|
-
|
|
87
|
-
reMake: boolean;
|
|
88
|
-
reRender: boolean;
|
|
89
|
-
reSize: boolean;
|
|
90
|
-
reCompile: boolean;
|
|
91
|
-
};
|
|
85
|
+
_compareSpec(spec: T, prevSpec: T): import("../..").IUpdateSpecResult;
|
|
86
|
+
private _isComponentOnlySpecChange;
|
|
92
87
|
protected _getAxisAttributes(): any;
|
|
93
88
|
protected _getGridAttributes(): {
|
|
94
89
|
alternateColor: any;
|
|
@@ -43,13 +43,7 @@ export declare class CartesianBandAxis<T extends ICartesianBandAxisSpec = ICarte
|
|
|
43
43
|
maxBandSize: number;
|
|
44
44
|
minBandSize: number;
|
|
45
45
|
};
|
|
46
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
47
|
-
change: boolean;
|
|
48
|
-
reMake: boolean;
|
|
49
|
-
reRender: boolean;
|
|
50
|
-
reSize: boolean;
|
|
51
|
-
reCompile: boolean;
|
|
52
|
-
};
|
|
46
|
+
_compareSpec(spec: T, prevSpec: T): import("../../..").IUpdateSpecResult;
|
|
53
47
|
reInit(spec?: T): void;
|
|
54
48
|
}
|
|
55
49
|
export declare const registerCartesianBandAxis: () => void;
|
|
@@ -19,20 +19,20 @@ export declare class BaseComponent<T extends IComponentSpec = IComponentSpec> ex
|
|
|
19
19
|
protected _regions: IRegion[];
|
|
20
20
|
getRegions(): IRegion[];
|
|
21
21
|
protected _container: IGroup;
|
|
22
|
+
private _exitingVRenderComponents?;
|
|
23
|
+
private _forceReleaseVRenderComponents;
|
|
22
24
|
created(): void;
|
|
23
25
|
initLayout(): void;
|
|
24
26
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
25
27
|
getVRenderComponents(): IGraphic<Partial<IGraphicAttribute>>[];
|
|
26
28
|
protected callPlugin(cb: (plugin: IComponentPlugin) => void): void;
|
|
27
29
|
protected getContainer(): IGroup;
|
|
28
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
29
|
-
|
|
30
|
-
reMake: boolean;
|
|
31
|
-
reRender: boolean;
|
|
32
|
-
reSize: boolean;
|
|
33
|
-
reCompile: boolean;
|
|
34
|
-
};
|
|
30
|
+
_compareSpec(spec: T, prevSpec: T): import("../../model/interface").IUpdateSpecResult;
|
|
31
|
+
beforeRelease(): void;
|
|
35
32
|
release(): void;
|
|
33
|
+
protected _shouldReleaseVRenderComponentsImmediately(): boolean;
|
|
34
|
+
protected _forceReleaseExitingVRenderComponents(): void;
|
|
35
|
+
protected _releaseVRenderComponent(component: IGraphic): void;
|
|
36
36
|
clear(): void;
|
|
37
37
|
compile(): void;
|
|
38
38
|
compileMarks(group?: IGroup): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IGraphic } from '@visactor/vrender-core';
|
|
2
|
+
type ReleaseVRenderComponentOptions = {
|
|
3
|
+
enableExitAnimation?: boolean;
|
|
4
|
+
removeFromParent?: boolean;
|
|
5
|
+
onComplete?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const releaseVRenderComponentSync: (component: IGraphic, removeFromParent?: boolean) => void;
|
|
8
|
+
export declare const collectVRenderComponents: (component: IGraphic) => IGraphic[];
|
|
9
|
+
export declare const releaseVRenderComponent: (component: IGraphic, options?: ReleaseVRenderComponentOptions) => boolean;
|
|
10
|
+
export {};
|
|
@@ -48,6 +48,7 @@ export declare class Brush<T extends IBrushSpec = IBrushSpec> extends BaseCompon
|
|
|
48
48
|
private _zoomRecord;
|
|
49
49
|
static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
|
|
50
50
|
init(): void;
|
|
51
|
+
reInit(spec?: T): void;
|
|
51
52
|
private _initNeedOperatedItem;
|
|
52
53
|
created(): void;
|
|
53
54
|
protected _bindRegions(): void;
|
|
@@ -55,13 +56,7 @@ export declare class Brush<T extends IBrushSpec = IBrushSpec> extends BaseCompon
|
|
|
55
56
|
private _initRegionAxisMap;
|
|
56
57
|
private _initAxisDataZoomMap;
|
|
57
58
|
protected initEvent(): void;
|
|
58
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
59
|
-
change: boolean;
|
|
60
|
-
reMake: boolean;
|
|
61
|
-
reRender: boolean;
|
|
62
|
-
reSize: boolean;
|
|
63
|
-
reCompile: boolean;
|
|
64
|
-
};
|
|
59
|
+
_compareSpec(spec: T, prevSpec: T): import("../../model/interface").IUpdateSpecResult;
|
|
65
60
|
onLayoutEnd(): void;
|
|
66
61
|
protected _updateBrushComponent(region: IRegion, componentIndex: number): void;
|
|
67
62
|
protected _shouldEnableInteractive(): boolean;
|
|
@@ -41,13 +41,7 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
|
|
|
41
41
|
protected _showDefaultCrosshair(): void;
|
|
42
42
|
setAttrFromSpec(): void;
|
|
43
43
|
created(): void;
|
|
44
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
45
|
-
change: boolean;
|
|
46
|
-
reMake: boolean;
|
|
47
|
-
reRender: boolean;
|
|
48
|
-
reSize: boolean;
|
|
49
|
-
reCompile: boolean;
|
|
50
|
-
};
|
|
44
|
+
_compareSpec(spec: T, prevSpec: T): import("../../model/interface").IUpdateSpecResult;
|
|
51
45
|
protected _initEvent(): void;
|
|
52
46
|
private _registerEvent;
|
|
53
47
|
private _eventOff;
|
|
@@ -18,13 +18,7 @@ export declare class CustomMark extends BaseComponent<ICustomMarkSpec<EnableMark
|
|
|
18
18
|
protected initMarks(): void;
|
|
19
19
|
private _createExtensionMark;
|
|
20
20
|
initEvent(): void;
|
|
21
|
-
_compareSpec(spec: ICustomMarkSpec<EnableMarkType>, prevSpec: ICustomMarkSpec<EnableMarkType>):
|
|
22
|
-
change: boolean;
|
|
23
|
-
reMake: boolean;
|
|
24
|
-
reRender: boolean;
|
|
25
|
-
reSize: boolean;
|
|
26
|
-
reCompile: boolean;
|
|
27
|
-
};
|
|
21
|
+
_compareSpec(spec: ICustomMarkSpec<EnableMarkType>, prevSpec: ICustomMarkSpec<EnableMarkType>): import("../..").IUpdateSpecResult;
|
|
28
22
|
private _getMarkAttributeContext;
|
|
29
23
|
private _getLayoutRect;
|
|
30
24
|
getBoundsInRect(rect: ILayoutRect): {
|
|
@@ -76,13 +76,7 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
|
|
|
76
76
|
created(): void;
|
|
77
77
|
initLayout(): void;
|
|
78
78
|
init(option: IModelInitOption): void;
|
|
79
|
-
_compareSpec(spec: AdaptiveSpec<T, 'width' | 'height'>, prevSpec: AdaptiveSpec<T, 'width' | 'height'>):
|
|
80
|
-
change: boolean;
|
|
81
|
-
reMake: boolean;
|
|
82
|
-
reRender: boolean;
|
|
83
|
-
reSize: boolean;
|
|
84
|
-
reCompile: boolean;
|
|
85
|
-
};
|
|
79
|
+
_compareSpec(spec: AdaptiveSpec<T, 'width' | 'height'>, prevSpec: AdaptiveSpec<T, 'width' | 'height'>): import("../../model/interface").IUpdateSpecResult;
|
|
86
80
|
reInit(spec?: AdaptiveSpec<T, 'width' | 'height'>): void;
|
|
87
81
|
onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect): void;
|
|
88
82
|
updateLayoutAttribute(): void;
|
|
@@ -52,13 +52,7 @@ export declare class GeoCoordinate extends BaseComponent<IGeoRegionSpec> impleme
|
|
|
52
52
|
invert(point: [number, number]): any;
|
|
53
53
|
private evaluateProjection;
|
|
54
54
|
protected _initCenterCache(): void;
|
|
55
|
-
_compareSpec(spec: IGeoRegionSpec, prevSpec: IGeoRegionSpec):
|
|
56
|
-
change: boolean;
|
|
57
|
-
reMake: boolean;
|
|
58
|
-
reRender: boolean;
|
|
59
|
-
reSize: boolean;
|
|
60
|
-
reCompile: boolean;
|
|
61
|
-
};
|
|
55
|
+
_compareSpec(spec: IGeoRegionSpec, prevSpec: IGeoRegionSpec): import("../../model/interface").IUpdateSpecResult;
|
|
62
56
|
release(): void;
|
|
63
57
|
}
|
|
64
58
|
export declare const registerGeoCoordinate: () => void;
|
|
@@ -22,13 +22,7 @@ export declare abstract class BaseLabelComponent<T = any> extends BaseComponent<
|
|
|
22
22
|
selected_reverse?: Partial<import("../../core").IComposedTextMarkSpec>;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
26
|
-
change: boolean;
|
|
27
|
-
reMake: boolean;
|
|
28
|
-
reRender: boolean;
|
|
29
|
-
reSize: boolean;
|
|
30
|
-
reCompile: boolean;
|
|
31
|
-
};
|
|
25
|
+
_compareSpec(spec: T, prevSpec: T): import("../../core").IUpdateSpecResult;
|
|
32
26
|
_getDataLabelType(baseMark: ICompilableMark, type?: string): string;
|
|
33
27
|
_setTransformOfComponent(labelComponent: IComponentMark, baseMark: IMark | IMark[]): void;
|
|
34
28
|
getVRenderComponents(): any[];
|
|
@@ -31,13 +31,8 @@ export declare abstract class BaseLegend<T extends ILegendCommonSpec> extends Ba
|
|
|
31
31
|
protected _regionUserIndex?: number[];
|
|
32
32
|
setAttrFromSpec(): void;
|
|
33
33
|
created(): void;
|
|
34
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
35
|
-
|
|
36
|
-
reMake: boolean;
|
|
37
|
-
reRender: boolean;
|
|
38
|
-
reSize: boolean;
|
|
39
|
-
reCompile: boolean;
|
|
40
|
-
};
|
|
34
|
+
_compareSpec(spec: T, prevSpec: T): import("../../model/interface").IUpdateSpecResult;
|
|
35
|
+
private _isComponentOnlySpecChange;
|
|
41
36
|
protected abstract _initLegendData(): DataView;
|
|
42
37
|
protected abstract _initSelectedData(): void;
|
|
43
38
|
protected abstract _getLegendAttributes(rect: ILayoutRect): any;
|
|
@@ -19,6 +19,8 @@ export declare abstract class BaseMarker<T extends IMarkerSpec> extends BaseComp
|
|
|
19
19
|
getRelativeSeries(): IMarkerSupportSeries;
|
|
20
20
|
protected _markerData: DataView;
|
|
21
21
|
getMarkerData(): DataView;
|
|
22
|
+
private _markerDataChangeHandler;
|
|
23
|
+
private _markerDataOwned;
|
|
22
24
|
protected _markerComponent: any;
|
|
23
25
|
protected _layoutOffsetX: number;
|
|
24
26
|
protected _layoutOffsetY: number;
|
|
@@ -49,20 +51,18 @@ export declare abstract class BaseMarker<T extends IMarkerSpec> extends BaseComp
|
|
|
49
51
|
};
|
|
50
52
|
protected _processSpecCoo(spec: any): IOptionWithCoordinates;
|
|
51
53
|
protected _getRelativeDataView(): DataView;
|
|
54
|
+
protected _setMarkerData(data: DataView, owned?: boolean): void;
|
|
55
|
+
protected _bindMarkerDataChange(): void;
|
|
56
|
+
private _releaseMarkerData;
|
|
52
57
|
updateLayoutAttribute(): void;
|
|
53
58
|
private _getSeriesByIdOrIndex;
|
|
54
59
|
protected _bindSeries(): void;
|
|
55
60
|
protected initEvent(): void;
|
|
56
61
|
clear(): void;
|
|
62
|
+
release(): void;
|
|
57
63
|
private _getFirstSeries;
|
|
58
64
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
59
65
|
onLayoutStart(layoutRect: IRect, chartViewRect: ILayoutRect): void;
|
|
60
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
61
|
-
change: boolean;
|
|
62
|
-
reMake: boolean;
|
|
63
|
-
reRender: boolean;
|
|
64
|
-
reSize: boolean;
|
|
65
|
-
reCompile: boolean;
|
|
66
|
-
};
|
|
66
|
+
_compareSpec(spec: T, prevSpec: T): import("../../model/interface").IUpdateSpecResult;
|
|
67
67
|
_initCommonDataView(): void;
|
|
68
68
|
}
|
|
@@ -24,13 +24,7 @@ export declare class Title<T extends ITitleSpec = ITitleSpec> extends BaseCompon
|
|
|
24
24
|
constructor(spec: T, options: IComponentOption);
|
|
25
25
|
initLayout(): void;
|
|
26
26
|
static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
|
|
27
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
28
|
-
change: boolean;
|
|
29
|
-
reMake: boolean;
|
|
30
|
-
reRender: boolean;
|
|
31
|
-
reSize: boolean;
|
|
32
|
-
reCompile: boolean;
|
|
33
|
-
};
|
|
27
|
+
_compareSpec(spec: T, prevSpec: T): import("../../model/interface").IUpdateSpecResult;
|
|
34
28
|
afterSetLayoutStartPoint(pos: IPoint): void;
|
|
35
29
|
getBoundsInRect(rect: ILayoutRect): {
|
|
36
30
|
x1: number;
|
package/types/core/vchart.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { IComponentConstructor } from '../component/interface';
|
|
|
8
8
|
import type { EventCallback, EventQuery, EventType, ExtendEventParam, IEvent } from '../event/interface';
|
|
9
9
|
import type { IParserOptions, Transform } from '@visactor/vdataset';
|
|
10
10
|
import { DataSet, DataView } from '@visactor/vdataset';
|
|
11
|
-
import type { IStage } from '@visactor/vrender-core';
|
|
11
|
+
import type { IGraphic, IStage } from '@visactor/vrender-core';
|
|
12
12
|
import type { GeoSourceType } from '../typings/geo';
|
|
13
13
|
import type { GeoSourceOption } from '../series/map/geo-source';
|
|
14
14
|
import type { IMark, MarkConstructor } from '../mark/interface';
|
|
@@ -78,6 +78,7 @@ export declare class VChart implements IVChart {
|
|
|
78
78
|
private _onError?;
|
|
79
79
|
private _context;
|
|
80
80
|
private _isReleased;
|
|
81
|
+
private _exitingVRenderComponents?;
|
|
81
82
|
private _chartPlugin?;
|
|
82
83
|
private _vChartPlugin?;
|
|
83
84
|
private _onResize?;
|
|
@@ -110,6 +111,9 @@ export declare class VChart implements IVChart {
|
|
|
110
111
|
protected _renderAsync(option?: IVChartRenderOption): Promise<IVChart>;
|
|
111
112
|
private _updateAnimateState;
|
|
112
113
|
release(): void;
|
|
114
|
+
_registerExitingVRenderComponent(component: IGraphic): void;
|
|
115
|
+
_unregisterExitingVRenderComponent(component: IGraphic): void;
|
|
116
|
+
private _forceReleaseExitingVRenderComponents;
|
|
113
117
|
updateData(id: StringOrNumber, data: DataView | Datum[] | string, parserOptions?: IParserOptions, userUpdateOptions?: IUpdateDataResult): Promise<IVChart>;
|
|
114
118
|
private _updateDataById;
|
|
115
119
|
updateDataInBatches(list: {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DataView } from '@visactor/vdataset';
|
|
2
|
+
export declare const detachDataViewDependencies: (dataView?: DataView | null) => void;
|
|
3
|
+
export declare const releaseDataViews: (dataViews: Array<DataView | null | undefined>) => void;
|
|
4
|
+
export declare const releaseDataView: (dataView?: DataView | null) => void;
|
|
5
|
+
export declare const releaseDataViewWithDependencies: (dataView: DataView | null | undefined, shouldReleaseDependency: (dataView: DataView) => boolean) => void;
|
|
@@ -5,7 +5,7 @@ import { MarkTypeEnum } from '../interface';
|
|
|
5
5
|
import type { IMarkRaw, IMarkStateStyle, IMarkStyle, IMark, IMarkOption, StyleConvert, MarkInputStyle, GroupedData, IAttrs, IMarkGraphic, ProgressiveContext, IProgressiveTransformResult, MarkType, AnimationStateValues } from '../interface';
|
|
6
6
|
import type { ICompilableMark, IMarkCompileOption, IMarkConfig, IMarkStateManager, StateValueType } from '../../compile/mark/interface';
|
|
7
7
|
import type { ICompilableInitOption } from '../../compile/interface';
|
|
8
|
-
import type { IGroupGraphicAttribute, IGroup, IGraphic } from '@visactor/vrender-core';
|
|
8
|
+
import type { IGroupGraphicAttribute, IGroup, IGraphic, StateDefinitionsInput } from '@visactor/vrender-core';
|
|
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';
|
|
@@ -74,7 +74,7 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
74
74
|
stopAnimationByState(state?: string): void;
|
|
75
75
|
pauseAnimationByState(state?: string): void;
|
|
76
76
|
resumeAnimationByState(state?: string): void;
|
|
77
|
-
removeProduct(): void;
|
|
77
|
+
removeProduct(releaseDetach?: boolean): void;
|
|
78
78
|
release(): void;
|
|
79
79
|
protected _simpleStyle: T;
|
|
80
80
|
setSimpleStyle(s: T): void;
|
|
@@ -82,6 +82,11 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
82
82
|
protected _option: IMarkOption;
|
|
83
83
|
protected _attributeContext: IModelMarkAttributeContext;
|
|
84
84
|
protected _encoderOfState: Record<string, Record<string, (datum: Datum) => any>>;
|
|
85
|
+
protected _sharedStateDefinitionsCacheKey?: string;
|
|
86
|
+
protected _sharedStateDefinitionsCache?: StateDefinitionsInput<Record<string, unknown>>;
|
|
87
|
+
protected _sharedStateDefinitionRefIds: WeakMap<object, number>;
|
|
88
|
+
protected _sharedStateDefinitionRefId: number;
|
|
89
|
+
protected _dynamicSharedStateNames: Set<string>;
|
|
85
90
|
_extensionChannel: {
|
|
86
91
|
[key: string | number | symbol]: string[];
|
|
87
92
|
};
|
|
@@ -155,9 +160,14 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
155
160
|
protected _getEncoderOfStyle: (stateName: string, style: Partial<IAttrs<T>>) => Record<string, (datum: Datum) => any>;
|
|
156
161
|
protected _setGraphicFromMarkConfig: (g: IMarkGraphic) => void;
|
|
157
162
|
protected _setStateOfGraphic: (g: IMarkGraphic, hasAnimation?: boolean) => void;
|
|
163
|
+
protected _getSharedStateDefinitionRefId(value: unknown): string;
|
|
164
|
+
protected _getSharedStateDefinitionValueKey(value: unknown): string;
|
|
165
|
+
protected _isStaticSharedStateAttribute(stateName: string, key: string): boolean;
|
|
158
166
|
protected _applySharedStateDefinitions(): void;
|
|
159
167
|
protected _addProgressiveGraphic(parent: IGroup, g: IMarkGraphic): void;
|
|
160
168
|
protected _runEncoder(graphics: IMarkGraphic[], noGroupEncode?: boolean): void;
|
|
169
|
+
protected _excludeStateControlledDiffAttrs(g: IMarkGraphic, diffAttrs: Record<string, any>): Record<string, any>;
|
|
170
|
+
protected _hasDiffAttrs(g: IMarkGraphic): boolean;
|
|
161
171
|
protected _runApplyGraphic(graphics: IMarkGraphic[]): void;
|
|
162
172
|
protected _updateEncoderByState(): void;
|
|
163
173
|
protected _runState(graphics: IMarkGraphic[]): void;
|
|
@@ -8,11 +8,20 @@ export declare class ComponentMark extends BaseMark<ICommonSpec> implements ICom
|
|
|
8
8
|
type: string;
|
|
9
9
|
private _componentType;
|
|
10
10
|
private _component;
|
|
11
|
+
private _exitingComponent?;
|
|
12
|
+
private _exitingProduct?;
|
|
11
13
|
private _mode;
|
|
12
14
|
constructor(name: string, option: IMarkOption);
|
|
13
15
|
protected _getDefaultStyle(): IMarkStyle<ICommonSpec>;
|
|
14
16
|
getComponent(): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
|
|
17
|
+
private _clearExitingComponent;
|
|
18
|
+
private _removeProductAfterExit;
|
|
19
|
+
private _registerExitingComponent;
|
|
20
|
+
private _unregisterExitingComponent;
|
|
21
|
+
private _releaseComponentWithExitAnimation;
|
|
15
22
|
clearComponent(): void;
|
|
23
|
+
releaseWithExitAnimation(): boolean;
|
|
24
|
+
forceReleaseExitAnimation(): void;
|
|
16
25
|
protected _getAttrsFromConfig(attrs?: IGroupGraphicAttribute): IGroupGraphicAttribute;
|
|
17
26
|
protected _attributesTransform: (attrs: any) => any;
|
|
18
27
|
setAttributeTransform(t: (attrs: any) => any): void;
|
|
@@ -6,6 +6,8 @@ import type { MarkType } from './type';
|
|
|
6
6
|
export interface IComponentMark extends IMarkRaw<ICommonSpec> {
|
|
7
7
|
getComponent: () => IGraphic;
|
|
8
8
|
clearComponent: () => void;
|
|
9
|
+
releaseWithExitAnimation: () => boolean;
|
|
10
|
+
forceReleaseExitAnimation: () => void;
|
|
9
11
|
setAttributeTransform: (t: (attrs: any) => any) => any;
|
|
10
12
|
}
|
|
11
13
|
export interface IGlyphMark<T extends ICommonSpec = ICommonSpec, C = any> extends IMarkRaw<T> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IEvent } from '../event/interface';
|
|
2
|
-
import type { IEffect, IModel, IModelInitOption, IModelOption, IModelEvaluateOption, IModelSpec, IModelMarkInfo, IModelSpecInfo } from './interface';
|
|
2
|
+
import type { IEffect, IModel, IModelInitOption, IModelOption, IModelEvaluateOption, IModelSpec, IModelMarkInfo, IModelSpecInfo, IUpdateSpecResult } from './interface';
|
|
3
3
|
import type { CoordinateType } from '../typings/coordinate';
|
|
4
4
|
import type { AnimationStateValues, ICompileMarkConfig, IMark, IMarkGraphic, IMarkOption, IMarkRaw, IMarkStyle } from '../mark/interface';
|
|
5
5
|
import type { Datum, StateValueType, ConvertToMarkStyleSpec, ICommonSpec, StringOrNumber, IRect, ILayoutRect } from '../typings';
|
|
@@ -50,20 +50,8 @@ export declare abstract class BaseModel<T extends IModelSpec> extends Compilable
|
|
|
50
50
|
beforeRelease(): void;
|
|
51
51
|
clear(): void;
|
|
52
52
|
release(): void;
|
|
53
|
-
updateSpec(spec: T):
|
|
54
|
-
|
|
55
|
-
reMake: boolean;
|
|
56
|
-
reRender: boolean;
|
|
57
|
-
reSize: boolean;
|
|
58
|
-
reCompile: boolean;
|
|
59
|
-
};
|
|
60
|
-
protected _compareSpec(spec: T, prevSpec: T): {
|
|
61
|
-
change: boolean;
|
|
62
|
-
reMake: boolean;
|
|
63
|
-
reRender: boolean;
|
|
64
|
-
reSize: boolean;
|
|
65
|
-
reCompile: boolean;
|
|
66
|
-
};
|
|
53
|
+
updateSpec(spec: T): IUpdateSpecResult;
|
|
54
|
+
protected _compareSpec(spec: T, prevSpec: T): IUpdateSpecResult;
|
|
67
55
|
reInit(spec?: T): void;
|
|
68
56
|
updateLayoutAttribute(): void;
|
|
69
57
|
setAttrFromSpec(): void;
|
|
@@ -33,6 +33,18 @@ export interface IModelRenderOption {
|
|
|
33
33
|
export interface IEffect {
|
|
34
34
|
[key: string]: (e?: any) => any;
|
|
35
35
|
}
|
|
36
|
+
export interface IUpdateSpecEffects {
|
|
37
|
+
remake?: boolean;
|
|
38
|
+
compile?: boolean;
|
|
39
|
+
render?: boolean;
|
|
40
|
+
layout?: boolean;
|
|
41
|
+
data?: boolean;
|
|
42
|
+
scaleDomain?: boolean;
|
|
43
|
+
series?: boolean;
|
|
44
|
+
component?: boolean;
|
|
45
|
+
animation?: boolean;
|
|
46
|
+
localOnly?: boolean;
|
|
47
|
+
}
|
|
36
48
|
export interface IMarkTreeGroup extends Partial<IMarkStyle<IGroupMarkSpec>> {
|
|
37
49
|
type: 'group';
|
|
38
50
|
name: string;
|
|
@@ -46,6 +58,7 @@ export interface IUpdateSpecResult {
|
|
|
46
58
|
reSize?: boolean;
|
|
47
59
|
reCompile?: boolean;
|
|
48
60
|
reTransformSpec?: boolean;
|
|
61
|
+
effects?: IUpdateSpecEffects;
|
|
49
62
|
reAnimate?: boolean;
|
|
50
63
|
changeTheme?: boolean;
|
|
51
64
|
changeBackground?: boolean;
|
package/types/region/region.d.ts
CHANGED
|
@@ -39,13 +39,7 @@ export declare class Region<T extends IRegionSpec = IRegionSpec> extends LayoutM
|
|
|
39
39
|
initMark(): void;
|
|
40
40
|
protected _initBackgroundMarkStyle(): void;
|
|
41
41
|
protected _initForegroundMarkStyle(): void;
|
|
42
|
-
_compareSpec(spec: T, prevSpec: T):
|
|
43
|
-
change: boolean;
|
|
44
|
-
reMake: boolean;
|
|
45
|
-
reRender: boolean;
|
|
46
|
-
reSize: boolean;
|
|
47
|
-
reCompile: boolean;
|
|
48
|
-
};
|
|
42
|
+
_compareSpec(spec: T, prevSpec: T): import("../model/interface").IUpdateSpecResult;
|
|
49
43
|
reInit(spec?: T): void;
|
|
50
44
|
addSeries(s: ISeries): void;
|
|
51
45
|
removeSeries(s: ISeries): void;
|
|
@@ -7,6 +7,7 @@ import { SeriesTypeEnum } from '../interface/type';
|
|
|
7
7
|
import type { IAreaSeriesSpec, IAreaSeriesTheme } from './interface';
|
|
8
8
|
import type { IMark, IAreaMark } from '../../mark/interface';
|
|
9
9
|
import { AreaSeriesSpecTransformer } from './area-transformer';
|
|
10
|
+
import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
|
|
10
11
|
export interface AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> extends Pick<LineLikeSeriesMixin, 'initLineMark' | 'initSymbolMark' | 'initLabelMarkStyle' | 'initLineMarkStyle' | 'initSymbolMarkStyle' | 'encodeDefined' | '_lineMark' | '_symbolMark' | 'addSamplingCompile' | 'addOverlapCompile' | 'reCompileSampling' | 'initLineLabelMarkStyle'>, CartesianSeries<T> {
|
|
11
12
|
}
|
|
12
13
|
export declare class AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> extends CartesianSeries<T> {
|
|
@@ -18,6 +19,7 @@ export declare class AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> ext
|
|
|
18
19
|
readonly transformerConstructor: typeof AreaSeriesSpecTransformer;
|
|
19
20
|
protected _areaMark: IAreaMark;
|
|
20
21
|
protected _sortDataByAxis: boolean;
|
|
22
|
+
protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
|
|
21
23
|
initMark(): void;
|
|
22
24
|
initMarkStyle(): void;
|
|
23
25
|
initAreaMarkStyle(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IBaseScale } from '@visactor/vscale';
|
|
2
2
|
import { CartesianSeries } from '../cartesian/cartesian';
|
|
3
|
+
import type { ISeriesSpecUpdatePolicy } from '../base/base-series';
|
|
3
4
|
import type { IMark, IRectMark, ITextMark } from '../../mark/interface';
|
|
4
5
|
import type { Datum, DirectionType } from '../../typings';
|
|
5
6
|
import type { IBarSeriesSpec, IBarSeriesTheme } from './interface';
|
|
@@ -24,9 +25,11 @@ export declare class BarSeries<T extends IBarSeriesSpec = IBarSeriesSpec> extend
|
|
|
24
25
|
protected _barMark: IRectMark;
|
|
25
26
|
protected _barBackgroundMark: IRectMark;
|
|
26
27
|
protected _barBackgroundViewData: ICompilableData;
|
|
28
|
+
protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
|
|
27
29
|
initMark(): void;
|
|
28
30
|
protected _initBarBackgroundMark(): void;
|
|
29
31
|
initMarkStyle(): void;
|
|
32
|
+
protected initRectMarkStyle(): void;
|
|
30
33
|
initLabelMarkStyle(textMark: ITextMark): void;
|
|
31
34
|
protected initTooltip(): void;
|
|
32
35
|
protected _statisticViewData(): void;
|
|
@@ -16,6 +16,12 @@ import type { StatisticOperations } from '../../data/transforms/interface';
|
|
|
16
16
|
import type { GraphicEventType } from '@visactor/vrender-core';
|
|
17
17
|
import type { ICompilableData } from '../../compile/data';
|
|
18
18
|
import type { IBaseTriggerOptions } from '../../interaction/interface/trigger';
|
|
19
|
+
export interface ISeriesSpecUpdatePolicy {
|
|
20
|
+
compileOnlyKeys?: Record<string, true>;
|
|
21
|
+
dataRelatedKeys?: Record<string, true>;
|
|
22
|
+
compileOnlySubKeys?: Record<string, Record<string, true>>;
|
|
23
|
+
}
|
|
24
|
+
export declare function markSeriesCompileEffect(compareResult: IUpdateSpecResult, dataRelated?: boolean): void;
|
|
19
25
|
export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> implements ISeries {
|
|
20
26
|
readonly specKey: string;
|
|
21
27
|
readonly type: string;
|
|
@@ -170,13 +176,8 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
170
176
|
protected initTooltip(): void;
|
|
171
177
|
_compareExtensionMarksSpec(newMarks: (IExtensionMarkSpec<Exclude<EnableMarkType, 'group'>> | IExtensionGroupMarkSpec)[], prevMarks: (IExtensionMarkSpec<Exclude<EnableMarkType, 'group'>> | IExtensionGroupMarkSpec)[], compareResult: IUpdateSpecResult): void;
|
|
172
178
|
_compareLabelSpec(newLabels: ILabelSpec[], prevLabels: ILabelSpec[], compareResult: IUpdateSpecResult): void;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
reMake: boolean;
|
|
176
|
-
reRender: boolean;
|
|
177
|
-
reSize: boolean;
|
|
178
|
-
reCompile: boolean;
|
|
179
|
-
};
|
|
179
|
+
protected _getSpecUpdatePolicy(): ISeriesSpecUpdatePolicy;
|
|
180
|
+
_compareSpec(spec: T, prevSpec: T, ignoreCheckKeys?: Record<string, boolean>): IUpdateSpecResult;
|
|
180
181
|
_updateSpecData(): void;
|
|
181
182
|
reInit(spec?: T): void;
|
|
182
183
|
onEvaluateEnd(ctx: IModelEvaluateOption): void;
|