@visactor/vchart-types 1.10.3 → 1.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/chart/base/base-chart.d.ts +2 -1
- package/types/chart/common/interface.d.ts +2 -2
- package/types/chart/interface/chart.d.ts +4 -1
- package/types/component/axis/cartesian/interface/common.d.ts +1 -0
- package/types/component/axis/mixin/linear-axis-mixin.d.ts +4 -0
- package/types/component/crosshair/interface/cartesian.d.ts +11 -24
- package/types/component/crosshair/interface/polar.d.ts +7 -5
- package/types/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/types/core/interface.d.ts +2 -0
- package/types/core/vchart.d.ts +2 -2
- package/types/event/interface.d.ts +2 -0
- package/types/layout/grid-layout/grid-layout.d.ts +1 -1
- package/types/region/interface.d.ts +2 -0
- package/types/region/region.d.ts +1 -0
- package/types/typings/spec/common.d.ts +1 -0
- package/types/util/data.d.ts +21 -4
- package/types/util/index.d.ts +1 -0
- package/types/util/spec/index.d.ts +0 -5
|
@@ -39,9 +39,10 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
39
39
|
protected _viewBox: IBoundsLike;
|
|
40
40
|
protected _layoutTag: boolean;
|
|
41
41
|
getLayoutTag(): boolean;
|
|
42
|
-
setLayoutTag(tag: boolean, morphConfig?: IMorphConfig,
|
|
42
|
+
setLayoutTag(tag: boolean, morphConfig?: IMorphConfig, renderNextTick?: boolean): boolean;
|
|
43
43
|
protected _modelOption: IModelOption;
|
|
44
44
|
protected _globalScale: IGlobalScale;
|
|
45
|
+
getGlobalScale(): IGlobalScale;
|
|
45
46
|
protected _idMap: Map<number, IModel | IMark>;
|
|
46
47
|
protected _event: IEvent;
|
|
47
48
|
getEvent(): IEvent;
|
|
@@ -36,6 +36,6 @@ export interface ICommonChartSpec extends Omit<IChartSpec, 'series'> {
|
|
|
36
36
|
axes?: ICartesianAxisSpec[] | IPolarAxisSpec[];
|
|
37
37
|
crosshair?: ICartesianCrosshairSpec | ICartesianCrosshairSpec[] | IPolarCrosshairSpec | IPolarCrosshairSpec[];
|
|
38
38
|
markLine?: IMarkLineSpec | IMarkLineSpec[];
|
|
39
|
-
markArea?: IMarkAreaSpec;
|
|
40
|
-
markPoint?: IMarkPointSpec;
|
|
39
|
+
markArea?: IMarkAreaSpec | IMarkAreaSpec[];
|
|
40
|
+
markPoint?: IMarkPointSpec | IMarkPointSpec[];
|
|
41
41
|
}
|
|
@@ -12,6 +12,8 @@ import type { IBoundsLike, IPadding } from '@visactor/vutils';
|
|
|
12
12
|
import type { ICompilable } from '../../compile/interface';
|
|
13
13
|
import type { IRegionQuerier, MaybeArray, Datum, IMarkStateSpec, StringOrNumber, IShowTooltipOption, IDataValues, ILayoutRect, IData } from '../../typings';
|
|
14
14
|
import type { DataView } from '@visactor/vdataset';
|
|
15
|
+
import type { IGlobalScale } from '../../scale/interface';
|
|
16
|
+
import type { IMorphConfig } from '../../animation/spec';
|
|
15
17
|
export type DimensionIndexOption = {
|
|
16
18
|
filter?: (cmp: IComponent) => boolean;
|
|
17
19
|
tooltip?: boolean;
|
|
@@ -35,10 +37,11 @@ export interface IChart extends ICompilable {
|
|
|
35
37
|
getCanvasRect: () => ILayoutRect;
|
|
36
38
|
getOption: () => IChartOption;
|
|
37
39
|
getEvent: () => IEvent;
|
|
40
|
+
getGlobalScale: () => IGlobalScale;
|
|
38
41
|
setLayout: (layout: LayoutCallBack) => void;
|
|
39
42
|
layout: (context: ILayoutParams) => void;
|
|
40
43
|
getLayoutTag: () => boolean;
|
|
41
|
-
setLayoutTag: (tag: boolean) => boolean;
|
|
44
|
+
setLayoutTag: (tag: boolean, morphConfig?: IMorphConfig, renderNextTick?: boolean) => boolean;
|
|
42
45
|
updateData: (id: StringOrNumber, data: unknown, updateGlobalScale?: boolean, options?: IParserOptions) => void;
|
|
43
46
|
updateFullData: (data: IDataValues | IDataValues[]) => void;
|
|
44
47
|
updateGlobalScaleDomain: () => void;
|
|
@@ -23,6 +23,7 @@ export interface ILinearAxis extends IAxis {
|
|
|
23
23
|
readonly zero: boolean;
|
|
24
24
|
readonly nice: boolean;
|
|
25
25
|
setExtendDomain: (key: string, value: number | undefined) => void;
|
|
26
|
+
niceLabelFormatter?: (value: StringOrNumber) => StringOrNumber;
|
|
26
27
|
}
|
|
27
28
|
export interface IAxisHelper {
|
|
28
29
|
isContinuous: boolean;
|
|
@@ -3,6 +3,7 @@ import type { IAxisLocationCfg, ITick } from '../interface';
|
|
|
3
3
|
import type { IEvent } from '../../../event/interface';
|
|
4
4
|
import type { IOrientType } from '../../../typings/space';
|
|
5
5
|
import type { IComponentOption } from '../../interface/common';
|
|
6
|
+
import type { StringOrNumber } from '../../../typings';
|
|
6
7
|
export declare const e10: number;
|
|
7
8
|
export declare const e5: number;
|
|
8
9
|
export declare const e2: number;
|
|
@@ -31,11 +32,13 @@ export interface LinearAxisMixin {
|
|
|
31
32
|
event: IEvent;
|
|
32
33
|
_orient: IOrientType;
|
|
33
34
|
_option: IComponentOption;
|
|
35
|
+
niceLabelFormatter: (value: StringOrNumber) => StringOrNumber;
|
|
34
36
|
}
|
|
35
37
|
export declare class LinearAxisMixin {
|
|
36
38
|
protected _extend: {
|
|
37
39
|
[key: string]: number;
|
|
38
40
|
};
|
|
41
|
+
niceLabelFormatter: (value: StringOrNumber) => StringOrNumber;
|
|
39
42
|
setExtraAttrFromSpec(): void;
|
|
40
43
|
transformScaleDomain(): void;
|
|
41
44
|
setLinearScaleNice(): void;
|
|
@@ -61,4 +64,5 @@ export declare class LinearAxisMixin {
|
|
|
61
64
|
setZero(zero: boolean): void;
|
|
62
65
|
protected updateScaleDomain(): void;
|
|
63
66
|
protected updateScaleDomainByModel(domain?: number[]): void;
|
|
67
|
+
protected _updateNiceLabelFormatter(domain: number[]): void;
|
|
64
68
|
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import type { StringOrNumber } from '../../../typings';
|
|
2
2
|
import type { IAxis } from '../../axis';
|
|
3
|
+
export interface ICrosshairLabelInfo {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
text: StringOrNumber;
|
|
6
|
+
dx: number;
|
|
7
|
+
dy: number;
|
|
8
|
+
defaultFormatter?: (value: StringOrNumber) => StringOrNumber;
|
|
9
|
+
}
|
|
3
10
|
export interface ICrosshairInfoX {
|
|
4
11
|
height: number;
|
|
5
12
|
leftPos: number;
|
|
6
13
|
rightPos: number;
|
|
7
14
|
topPos: number;
|
|
8
15
|
x: number;
|
|
9
|
-
bottom:
|
|
10
|
-
|
|
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
|
-
};
|
|
16
|
+
bottom: ICrosshairLabelInfo;
|
|
17
|
+
top: ICrosshairLabelInfo;
|
|
21
18
|
visible: boolean;
|
|
22
19
|
_isCache?: boolean;
|
|
23
20
|
axis: IAxis;
|
|
@@ -28,18 +25,8 @@ export interface ICrosshairInfoY {
|
|
|
28
25
|
topPos: number;
|
|
29
26
|
bottomPos: number;
|
|
30
27
|
y: number;
|
|
31
|
-
left:
|
|
32
|
-
|
|
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
|
-
};
|
|
28
|
+
left: ICrosshairLabelInfo;
|
|
29
|
+
right: ICrosshairLabelInfo;
|
|
43
30
|
visible: boolean;
|
|
44
31
|
_isCache?: boolean;
|
|
45
32
|
axis: IAxis;
|
|
@@ -14,10 +14,12 @@ export interface IPolarCrosshairInfo {
|
|
|
14
14
|
angle: number;
|
|
15
15
|
point: IPoint;
|
|
16
16
|
_isCache?: boolean;
|
|
17
|
-
label?:
|
|
18
|
-
visible: boolean;
|
|
19
|
-
text: StringOrNumber;
|
|
20
|
-
offset: number;
|
|
21
|
-
};
|
|
17
|
+
label?: IPolarCrosshairLabelInfo;
|
|
22
18
|
axis?: IPolarAxis;
|
|
23
19
|
}
|
|
20
|
+
export interface IPolarCrosshairLabelInfo {
|
|
21
|
+
visible: boolean;
|
|
22
|
+
text: StringOrNumber;
|
|
23
|
+
offset: number;
|
|
24
|
+
defaultFormatter?: (value: StringOrNumber) => StringOrNumber;
|
|
25
|
+
}
|
|
@@ -19,6 +19,7 @@ export declare abstract class DataFilterBaseComponent<T extends IDataFilterCompo
|
|
|
19
19
|
protected _fixedBandSize?: number;
|
|
20
20
|
protected _cacheRect?: ILayoutRect;
|
|
21
21
|
protected _cacheVisibility?: boolean;
|
|
22
|
+
protected _dataUpdating: boolean;
|
|
22
23
|
protected _stateScale: IBaseScale;
|
|
23
24
|
protected _relatedAxisComponent: IComponent;
|
|
24
25
|
protected _originalStateFields: Record<number, string | number>;
|
|
@@ -13,6 +13,7 @@ import type { Compiler } from '../compile/compiler';
|
|
|
13
13
|
import type { IChart, IChartSpecInfo } from '../chart/interface';
|
|
14
14
|
import type { Stage } from '@visactor/vrender-core';
|
|
15
15
|
import type { IContainerSize } from '@visactor/vrender-components';
|
|
16
|
+
import type { IBaseScale } from '@visactor/vscale';
|
|
16
17
|
export type DataLinkSeries = {
|
|
17
18
|
seriesId?: StringOrNumber;
|
|
18
19
|
seriesIndex?: number;
|
|
@@ -81,6 +82,7 @@ export interface IVChart {
|
|
|
81
82
|
getContainer: () => Maybe<HTMLElement>;
|
|
82
83
|
getComponents: () => IComponent[];
|
|
83
84
|
getDataSet: () => Maybe<DataSet>;
|
|
85
|
+
getScale: (scaleId: string) => IBaseScale | null;
|
|
84
86
|
convertDatumToPosition: (datum: Datum, dataLinkInfo?: DataLinkSeries, isRelativeToCanvas?: boolean, checkInViewData?: boolean) => IPoint | null;
|
|
85
87
|
convertValueToPosition: ((value: StringOrNumber, dataLinkInfo: DataLinkAxis, isRelativeToCanvas?: boolean) => number | null) & ((value: [StringOrNumber, StringOrNumber], dataLinkInfo: DataLinkSeries, isRelativeToCanvas?: boolean) => IPoint | null);
|
|
86
88
|
stopAnimation: () => void;
|
package/types/core/vchart.d.ts
CHANGED
|
@@ -6,8 +6,7 @@ import type { ISeriesConstructor } from '../series/interface';
|
|
|
6
6
|
import type { DimensionIndexOption, IChart, IChartConstructor, IChartOption, IChartSpecInfo } from '../chart/interface';
|
|
7
7
|
import type { IComponentConstructor } from '../component/interface';
|
|
8
8
|
import type { EventCallback, EventParams, EventQuery, EventType } from '../event/interface';
|
|
9
|
-
import type { IParserOptions } from '@visactor/vdataset';
|
|
10
|
-
import type { Transform, DataView } from '@visactor/vdataset';
|
|
9
|
+
import type { IParserOptions, Transform, DataView } from '@visactor/vdataset';
|
|
11
10
|
import { DataSet } from '@visactor/vdataset';
|
|
12
11
|
import type { Stage } from '@visactor/vrender-core';
|
|
13
12
|
import type { GeoSourceType } from '../typings/geo';
|
|
@@ -169,6 +168,7 @@ export declare class VChart implements IVChart {
|
|
|
169
168
|
getCanvas(): HTMLCanvasElement | undefined;
|
|
170
169
|
getContainer(): Maybe<HTMLElement>;
|
|
171
170
|
getComponents(): import("../component/interface").IComponent[];
|
|
171
|
+
getScale(scaleId: string): import("@visactor/vscale").IBaseScale;
|
|
172
172
|
setDimensionIndex(value: StringOrNumber, opt?: DimensionIndexOption): void;
|
|
173
173
|
stopAnimation(): void;
|
|
174
174
|
pauseAnimation(): void;
|
|
@@ -10,6 +10,7 @@ import type { ChartEvent, Event_Bubble_Level, Event_Source_Type, VGRAMMAR_HOOK_E
|
|
|
10
10
|
import type { SeriesType } from '../series/interface';
|
|
11
11
|
import type { TooltipEventParams } from '../component/tooltip/interface/event';
|
|
12
12
|
import type { ILayoutItem } from '../layout/interface';
|
|
13
|
+
import type { IVChart } from '../core/interface';
|
|
13
14
|
export type EventType = 'pointerdown' | 'pointerup' | 'pointerupoutside' | 'pointertap' | 'pointerover' | 'pointermove' | 'pointerenter' | 'pointerleave' | 'pointerout' | 'mousedown' | 'mouseup' | 'mouseupoutside' | 'rightdown' | 'rightup' | 'rightupoutside' | 'click' | 'dblclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mouseenter' | 'mouseleave' | 'wheel' | 'touchstart' | 'touchend' | 'touchendoutside' | 'touchmove' | 'touchcancel' | 'tap' | 'dragstart' | 'drag' | 'dragenter' | 'dragleave' | 'dragover' | 'dragend' | 'drop' | 'pan' | 'panstart' | 'panend' | 'press' | 'pressup' | 'pressend' | 'pinch' | 'pinchstart' | 'pinchend' | 'swipe' | keyof typeof ChartEvent | keyof typeof VGRAMMAR_HOOK_EVENT | string;
|
|
14
15
|
export type EventBubbleLevel = keyof typeof Event_Bubble_Level;
|
|
15
16
|
export type ComponentType = 'axis' | 'dataZoom' | 'indicator' | 'legend' | 'mapLabel' | 'markLine' | 'markArea' | 'markPoint' | 'tooltip' | 'title' | 'label' | 'totalLabel' | 'customMark';
|
|
@@ -35,6 +36,7 @@ export type EventParams = {
|
|
|
35
36
|
chart?: IChart;
|
|
36
37
|
datum?: Datum;
|
|
37
38
|
node?: IGraphic;
|
|
39
|
+
vchart?: IVChart;
|
|
38
40
|
};
|
|
39
41
|
type SuperEvent = Event & {
|
|
40
42
|
[key: string]: any;
|
|
@@ -30,7 +30,7 @@ export declare class GridLayout implements IBaseLayout {
|
|
|
30
30
|
}[], gridSize: GridSize[], gridMax: number, maxSize: number): void;
|
|
31
31
|
protected clearLayoutSize(): void;
|
|
32
32
|
protected getItemGridInfo(item: ILayoutItem): ElementSpec;
|
|
33
|
-
protected
|
|
33
|
+
protected getSizeFromGrid(spec: ElementSpec, type: 'col' | 'row'): number | undefined;
|
|
34
34
|
protected getSizeFromUser(spec: ElementSpec, type: 'col' | 'row'): number | undefined;
|
|
35
35
|
protected setItemLayoutSizeToGrid(item: ILayoutItem, gridSpec: ElementSpec): void;
|
|
36
36
|
protected layoutGrid(type: 'col' | 'row'): void;
|
|
@@ -13,6 +13,7 @@ export interface IRegion extends ILayoutModel {
|
|
|
13
13
|
animate?: IAnimate;
|
|
14
14
|
interaction: IInteraction;
|
|
15
15
|
getStackInverse: () => boolean;
|
|
16
|
+
getStackSort: () => boolean;
|
|
16
17
|
getMaxWidth: () => number | undefined;
|
|
17
18
|
setMaxWidth: (value: number) => void;
|
|
18
19
|
getMaxHeight: () => number | undefined;
|
|
@@ -48,6 +49,7 @@ export interface IRegionSpec extends ILayoutItemSpec {
|
|
|
48
49
|
coordinate?: CoordinateType;
|
|
49
50
|
style?: ConvertToMarkStyleSpec<IRectMarkSpec>;
|
|
50
51
|
stackInverse?: boolean;
|
|
52
|
+
stackSort?: boolean;
|
|
51
53
|
}
|
|
52
54
|
export interface IGeoRegionSpec extends IRegionSpec {
|
|
53
55
|
coordinate?: 'geo';
|
package/types/region/region.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare class Region<T extends IRegionSpec = IRegionSpec> extends LayoutM
|
|
|
33
33
|
protected _interactionMark: IGroupMark;
|
|
34
34
|
getInteractionMark(): IGroupMark;
|
|
35
35
|
getStackInverse(): boolean;
|
|
36
|
+
getStackSort(): boolean;
|
|
36
37
|
protected _backgroundMark?: IRectMark;
|
|
37
38
|
protected _foregroundMark?: IRectMark;
|
|
38
39
|
protected _trigger: ITrigger;
|
|
@@ -81,6 +81,7 @@ export interface IChartSpec {
|
|
|
81
81
|
theme?: Omit<ITheme, 'name'> | string;
|
|
82
82
|
background?: IBackgroundSpec;
|
|
83
83
|
stackInverse?: boolean;
|
|
84
|
+
stackSort?: boolean;
|
|
84
85
|
media?: IMediaQuerySpec;
|
|
85
86
|
}
|
|
86
87
|
export type IBackgroundStyleSpec = ConvertToMarkStyleSpec<Omit<IFillMarkSpec, 'width' | 'height' | 'background'>> & {
|
package/types/util/data.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataView } from '@visactor/vdataset';
|
|
2
2
|
import type { StatisticOperations } from '../data/transforms/dimension-statistics';
|
|
3
3
|
import type { ISeries, ISeriesStackDataMeta } from '../series/interface';
|
|
4
|
+
import type { IRegion } from '../region/interface';
|
|
4
5
|
export declare function mergeFields(targetFields: {
|
|
5
6
|
key: string;
|
|
6
7
|
operations: StatisticOperations;
|
|
@@ -18,6 +19,11 @@ export interface IStackCacheNode {
|
|
|
18
19
|
s: ISeries;
|
|
19
20
|
values: any[];
|
|
20
21
|
}[];
|
|
22
|
+
sortDatums: {
|
|
23
|
+
datum: any;
|
|
24
|
+
index: number;
|
|
25
|
+
series: ISeries;
|
|
26
|
+
}[];
|
|
21
27
|
nodes: {
|
|
22
28
|
[key: string]: IStackCacheNode;
|
|
23
29
|
};
|
|
@@ -28,12 +34,23 @@ export interface IStackCacheRoot {
|
|
|
28
34
|
[key: string]: IStackCacheNode;
|
|
29
35
|
};
|
|
30
36
|
}
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
export interface IStackSortCache {
|
|
38
|
+
[key: string]: {
|
|
39
|
+
lastIndex: number;
|
|
40
|
+
sort: {
|
|
41
|
+
[key: string]: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare function getRegionStackGroup(region: IRegion, setInitialValue: boolean, filter?: (s: any) => boolean): {
|
|
34
46
|
[key: string]: IStackCacheRoot;
|
|
35
47
|
};
|
|
48
|
+
export declare function sortStackValueGroup(stackValueGroup: {
|
|
49
|
+
[key: string]: IStackCacheNode;
|
|
50
|
+
}, stackSortCache: IStackSortCache): {
|
|
51
|
+
[key: string]: IStackCacheNode;
|
|
52
|
+
};
|
|
36
53
|
export declare function stackTotal(stackData: IStackCacheNode, valueField: string): void;
|
|
37
54
|
export declare function stackOffsetSilhouette(stackCache: IStackCacheNode): void;
|
|
38
55
|
export declare function stack(stackCache: IStackCacheNode, stackInverse: boolean, hasPercent?: boolean): void;
|
|
39
|
-
export declare function stackGroup(s: ISeries, stackData: ISeriesStackDataMeta, stackCache: IStackCacheNode, valueField: string, setInitialValue: boolean, stackKey?: string): void;
|
|
56
|
+
export declare function stackGroup(s: ISeries, stackData: ISeriesStackDataMeta, stackCache: IStackCacheNode, valueField: string, setInitialValue: boolean, stackSortCache: IStackSortCache, stackKey?: string): void;
|
package/types/util/index.d.ts
CHANGED