@visactor/vchart-types 1.12.3 → 1.12.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 +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/types/chart/base/base-chart.d.ts +1 -0
- package/types/chart/interface/chart.d.ts +1 -0
- package/types/component/axis/base-axis.d.ts +1 -1
- package/types/component/axis/cartesian/axis.d.ts +3 -2
- package/types/component/axis/cartesian/linear-axis.d.ts +5 -1
- package/types/component/axis/interface/spec.d.ts +5 -1
- package/types/component/axis/mixin/linear-axis-mixin.d.ts +7 -1
- package/types/component/axis/mixin/util/break-data.d.ts +4 -0
- package/types/component/axis/util.d.ts +3 -0
- package/types/component/crosshair/cartesian.d.ts +1 -0
- package/types/component/tooltip/processor/base.d.ts +1 -1
- package/types/constant/layout.d.ts +1 -0
- package/types/core/vchart.d.ts +1 -0
- package/types/interaction/interaction.d.ts +2 -0
- package/types/interaction/interface.d.ts +2 -0
- package/types/model/tooltip-helper.d.ts +8 -6
- package/types/series/bar/interface.d.ts +5 -1
- package/types/series/gauge/pointer-tooltip-helper.d.ts +5 -0
- package/types/series/sankey/interface.d.ts +1 -0
- package/types/series/sankey/sankey.d.ts +0 -1
- package/types/util/array.d.ts +1 -0
|
@@ -140,6 +140,7 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
140
140
|
setSelected(datum: MaybeArray<any> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
141
141
|
setHovered(datum: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
142
142
|
clearState(state: string): void;
|
|
143
|
+
clearAllStates(): void;
|
|
143
144
|
clearSelected(): void;
|
|
144
145
|
clearHovered(): void;
|
|
145
146
|
private _initEvent;
|
|
@@ -84,6 +84,7 @@ export interface IChart extends ICompilable {
|
|
|
84
84
|
setSelected: (datum: MaybeArray<any> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier) => void;
|
|
85
85
|
setHovered: (datum: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier) => void;
|
|
86
86
|
clearState: (state: string) => void;
|
|
87
|
+
clearAllStates: () => void;
|
|
87
88
|
clearSelected: () => void;
|
|
88
89
|
clearHovered: () => void;
|
|
89
90
|
updateViewBox: (viewBox: IBoundsLike, reLayout: boolean) => void;
|
|
@@ -5,7 +5,7 @@ import type { IOrientType, IPolarOrientType, StringOrNumber, CoordinateType } fr
|
|
|
5
5
|
import { BaseComponent } from '../base/base-component';
|
|
6
6
|
import { CompilableData } from '../../compile/data';
|
|
7
7
|
import type { IAxis, ICommonAxisSpec, ITick } from './interface';
|
|
8
|
-
import type
|
|
8
|
+
import { type IComponentOption } from '../interface';
|
|
9
9
|
import type { ISeries } from '../../series/interface';
|
|
10
10
|
import type { ITransformOptions } from '@visactor/vdataset';
|
|
11
11
|
import { DataView } from '@visactor/vdataset';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IBoundsLike, type Maybe } from '@visactor/vutils';
|
|
2
2
|
import type { IEffect, IModelInitOption, IModelSpecInfo } from '../../../model/interface';
|
|
3
3
|
import type { ICartesianSeries } from '../../../series/interface';
|
|
4
4
|
import type { IRegion } from '../../../region/interface';
|
|
@@ -72,6 +72,7 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
|
|
|
72
72
|
values: any[];
|
|
73
73
|
}[]): StringOrNumber[];
|
|
74
74
|
abstract valueToPosition(value: any): number;
|
|
75
|
+
protected getNewScaleRange(): number[];
|
|
75
76
|
protected updateScaleRange(): boolean;
|
|
76
77
|
init(option: IModelInitOption): void;
|
|
77
78
|
setAttrFromSpec(): void;
|
|
@@ -95,7 +96,7 @@ export declare abstract class CartesianAxis<T extends ICartesianAxisCommonSpec =
|
|
|
95
96
|
getBoundsInRect(rect: ILayoutRect): IBoundsLike;
|
|
96
97
|
positionToData(pos: number, isViewPos?: boolean): any;
|
|
97
98
|
private _getTitleLimit;
|
|
98
|
-
|
|
99
|
+
protected _getUpdateAttribute(ignoreGrid: boolean): any;
|
|
99
100
|
protected getLabelItems(length: number): any[];
|
|
100
101
|
protected initEvent(): void;
|
|
101
102
|
protected _updateAxisLayout: () => void;
|
|
@@ -4,7 +4,8 @@ import { CartesianAxis } from './axis';
|
|
|
4
4
|
import type { IAxisHelper, ICartesianLinearAxisSpec } from './interface';
|
|
5
5
|
import { ComponentTypeEnum } from '../../interface/type';
|
|
6
6
|
import { LinearAxisMixin } from '../mixin/linear-axis-mixin';
|
|
7
|
-
|
|
7
|
+
import { ICartesianTickDataOpt } from '@visactor/vrender-components';
|
|
8
|
+
export interface CartesianLinearAxis<T extends ICartesianLinearAxisSpec = ICartesianLinearAxisSpec> extends Pick<LinearAxisMixin, 'setExtraAttrFromSpec' | 'computeLinearDomain' | 'valueToPosition' | 'setScaleNice' | '_domain' | 'transformScaleDomain' | 'setExtendDomain' | '_break'>, CartesianAxis<T> {
|
|
8
9
|
}
|
|
9
10
|
export declare class CartesianLinearAxis<T extends ICartesianLinearAxisSpec = ICartesianLinearAxisSpec> extends CartesianAxis<T> {
|
|
10
11
|
static type: ComponentTypeEnum;
|
|
@@ -19,6 +20,9 @@ export declare class CartesianLinearAxis<T extends ICartesianLinearAxisSpec = IC
|
|
|
19
20
|
protected _scales: LinearScale[] | LogScale[];
|
|
20
21
|
setAttrFromSpec(): void;
|
|
21
22
|
protected initScales(): void;
|
|
23
|
+
protected _tickTransformOption(): ICartesianTickDataOpt;
|
|
24
|
+
protected _getUpdateAttribute(ignoreGrid: boolean): any;
|
|
25
|
+
protected getNewScaleRange(): number[];
|
|
22
26
|
protected computeDomain(data: {
|
|
23
27
|
min: number;
|
|
24
28
|
max: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AxisItem, AxisItemStateStyle } from '@visactor/vrender-components';
|
|
1
|
+
import type { AxisBreakProps, AxisItem, AxisItemStateStyle } from '@visactor/vrender-components';
|
|
2
2
|
import type { IAnimationSpec } from '../../../animation/spec';
|
|
3
3
|
import type { Datum, IFormatMethod, IPadding, IRectMarkSpec, IRichTextFormatMethod, IRuleMarkSpec, ISymbolMarkSpec, ITextMarkSpec, StringOrNumber } from '../../../typings';
|
|
4
4
|
import type { IComponentSpec } from '../../base/interface';
|
|
@@ -15,6 +15,9 @@ export interface ICommonAxisSpec extends Omit<IComponentSpec, 'orient' | 'center
|
|
|
15
15
|
sampling?: boolean;
|
|
16
16
|
forceInitTick?: boolean;
|
|
17
17
|
}
|
|
18
|
+
export type ILinearAxisBreakSpec = Omit<AxisBreakProps, 'rawRange'> & {
|
|
19
|
+
gap?: number | string;
|
|
20
|
+
};
|
|
18
21
|
export interface ILinearAxisSpec {
|
|
19
22
|
min?: number;
|
|
20
23
|
max?: number;
|
|
@@ -32,6 +35,7 @@ export interface ILinearAxisSpec {
|
|
|
32
35
|
max?: number;
|
|
33
36
|
};
|
|
34
37
|
tooltipFilterRange?: number | [number, number];
|
|
38
|
+
breaks?: ILinearAxisBreakSpec[];
|
|
35
39
|
}
|
|
36
40
|
export interface IBandAxisSpec {
|
|
37
41
|
trimPadding?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LinearScale } from '@visactor/vscale';
|
|
2
|
-
import type { IAxisLocationCfg, ITick } from '../interface';
|
|
2
|
+
import type { IAxisLocationCfg, ILinearAxisBreakSpec, 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';
|
|
@@ -32,6 +32,12 @@ export interface LinearAxisMixin {
|
|
|
32
32
|
max: number;
|
|
33
33
|
values: any[];
|
|
34
34
|
}[];
|
|
35
|
+
_break: {
|
|
36
|
+
domain: [number, number][];
|
|
37
|
+
scope: [number, number][];
|
|
38
|
+
breakDomains: [number, number][];
|
|
39
|
+
breaks: ILinearAxisBreakSpec[];
|
|
40
|
+
};
|
|
35
41
|
event: IEvent;
|
|
36
42
|
_orient: IOrientType;
|
|
37
43
|
_option: IComponentOption;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IOrientType, IPolarOrientType } from '../../typings';
|
|
2
2
|
import type { AxisType, ICommonAxisSpec, ILinearAxisSpec } from './interface';
|
|
3
3
|
import type { ITheme } from '../../theme';
|
|
4
|
+
import type { IAxisHelper } from './cartesian';
|
|
5
|
+
import type { IPolarAxisHelper } from './polar';
|
|
4
6
|
export declare const DEFAULT_TITLE_STYLE: {
|
|
5
7
|
left: {
|
|
6
8
|
textAlign: string;
|
|
@@ -33,3 +35,4 @@ export declare function getAxisItem(value: any, normalizedValue: number): {
|
|
|
33
35
|
value: number;
|
|
34
36
|
rawValue: any;
|
|
35
37
|
};
|
|
38
|
+
export declare function shouldUpdateAxis(preHelper: IAxisHelper | IPolarAxisHelper, curHelper: IAxisHelper | IPolarAxisHelper, forceUpdate: boolean): boolean;
|
|
@@ -39,6 +39,7 @@ export declare class CartesianCrossHair<T extends ICartesianCrosshairSpec = ICar
|
|
|
39
39
|
private _layoutVertical;
|
|
40
40
|
private _layoutHorizontal;
|
|
41
41
|
protected _parseFieldInfo(): void;
|
|
42
|
+
private _parseAndSetCrosshair;
|
|
42
43
|
private _updateCrosshair;
|
|
43
44
|
private _updateCrosshairLabel;
|
|
44
45
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
@@ -17,6 +17,6 @@ export declare abstract class BaseTooltipProcessor {
|
|
|
17
17
|
protected _preprocessDimensionInfo(dimensionInfo?: IDimensionInfo[]): IDimensionInfo[] | undefined;
|
|
18
18
|
protected _updateViewSpec(params: TooltipHandlerParams): void;
|
|
19
19
|
protected _updateActualTooltip(data: TooltipData, params: TooltipHandlerParams): void;
|
|
20
|
-
shouldHandleTooltip(params: BaseEventParams,
|
|
20
|
+
shouldHandleTooltip(params: BaseEventParams, info: TooltipInfo): boolean;
|
|
21
21
|
clearCache(): void;
|
|
22
22
|
}
|
|
@@ -2,6 +2,7 @@ export declare const USER_LAYOUT_RECT_LEVEL = 9;
|
|
|
2
2
|
export declare const DEFAULT_LAYOUT_RECT_LEVEL = 0;
|
|
3
3
|
export declare const DEFAULT_LAYOUT_RECT_LEVEL_MIN = -1;
|
|
4
4
|
export declare enum LayoutZIndex {
|
|
5
|
+
SeriesGroup = 0,
|
|
5
6
|
Axis_Grid = 50,
|
|
6
7
|
CrossHair_Grid = 100,
|
|
7
8
|
Region = 450,
|
package/types/core/vchart.d.ts
CHANGED
|
@@ -137,6 +137,7 @@ export declare class VChart implements IVChart {
|
|
|
137
137
|
setSelected(datum: MaybeArray<any> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
138
138
|
setHovered(datum: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
139
139
|
clearState(state: string): void;
|
|
140
|
+
clearAllStates(): void;
|
|
140
141
|
clearSelected(): void;
|
|
141
142
|
clearHovered(): void;
|
|
142
143
|
private _updateCurrentTheme;
|
|
@@ -21,7 +21,9 @@ export declare class Interaction implements IInteraction {
|
|
|
21
21
|
removeEventElement(stateValue: StateValue, element: IElement): void;
|
|
22
22
|
addEventElement(stateValue: StateValue, element: IElement): void;
|
|
23
23
|
clearEventElement(stateValue: StateValue, clearReverse: boolean): void;
|
|
24
|
+
clearAllEventElement(): void;
|
|
24
25
|
reverseEventElement(stateValue: StateValue): void;
|
|
25
26
|
startInteraction(stateValue: StateValue, element: IElement): void;
|
|
26
27
|
resetInteraction(stateValue: StateValue, element: IElement): void;
|
|
28
|
+
resetAllInteraction(): void;
|
|
27
29
|
}
|
|
@@ -16,10 +16,12 @@ export interface IInteraction {
|
|
|
16
16
|
exchangeEventElement: (stateValue: StateValue, elements: IElement) => void;
|
|
17
17
|
clearEventElement: (stateValue: StateValue, clearReverse: boolean) => void;
|
|
18
18
|
reverseEventElement: (stateValue: StateValue) => void;
|
|
19
|
+
clearAllEventElement: () => void;
|
|
19
20
|
setDisableActiveEffect: (disable: boolean) => void;
|
|
20
21
|
addVgrammarInteraction: (state: StateValue, i: IVGrammarInteraction) => void;
|
|
21
22
|
startInteraction: (state: StateValue, element: IElement) => void;
|
|
22
23
|
resetInteraction: (state: StateValue, element: IElement) => void;
|
|
24
|
+
resetAllInteraction: () => void;
|
|
23
25
|
}
|
|
24
26
|
export interface ITrigger {
|
|
25
27
|
init: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ITooltipSpec } from '../component/tooltip/interface';
|
|
2
2
|
import type { TooltipActiveType } from '../typings';
|
|
3
3
|
import type { IModel } from './interface';
|
|
4
4
|
import type { IMark } from '../mark/interface';
|
|
@@ -6,8 +6,13 @@ export type TooltipTrigger = IModel | IMark;
|
|
|
6
6
|
export interface ITooltipHelper {
|
|
7
7
|
spec: ITooltipSpec | undefined;
|
|
8
8
|
activeType: TooltipActiveType[];
|
|
9
|
-
activeTriggerSet:
|
|
10
|
-
|
|
9
|
+
activeTriggerSet: {
|
|
10
|
+
mark?: Set<TooltipTrigger>;
|
|
11
|
+
group?: Set<TooltipTrigger>;
|
|
12
|
+
};
|
|
13
|
+
ignoreTriggerSet: {
|
|
14
|
+
mark?: Set<TooltipTrigger>;
|
|
15
|
+
};
|
|
11
16
|
updateTooltipSpec: () => void;
|
|
12
17
|
}
|
|
13
18
|
export declare abstract class BaseTooltipHelper implements ITooltipHelper {
|
|
@@ -15,13 +20,10 @@ export declare abstract class BaseTooltipHelper implements ITooltipHelper {
|
|
|
15
20
|
activeType: TooltipActiveType[];
|
|
16
21
|
activeTriggerSet: {
|
|
17
22
|
mark: Set<TooltipTrigger>;
|
|
18
|
-
dimension: Set<TooltipTrigger>;
|
|
19
23
|
group: Set<TooltipTrigger>;
|
|
20
24
|
};
|
|
21
25
|
ignoreTriggerSet: {
|
|
22
26
|
mark: Set<TooltipTrigger>;
|
|
23
|
-
dimension: Set<TooltipTrigger>;
|
|
24
|
-
group: Set<TooltipTrigger>;
|
|
25
27
|
};
|
|
26
28
|
abstract updateTooltipSpec(): void;
|
|
27
29
|
}
|
|
@@ -7,7 +7,11 @@ import type { ILabelSpec, IMultiLabelSpec } from '../../component/label';
|
|
|
7
7
|
import type { IDataSamping, IMarkProgressiveConfig } from '../../mark/interface';
|
|
8
8
|
import type { SeriesMarkNameEnum } from '../interface/type';
|
|
9
9
|
import type { Functional } from '@visactor/vrender-components';
|
|
10
|
+
import type { IRectGraphicAttribute } from '@visactor/vrender-core';
|
|
11
|
+
import type { Datum } from '../../typings';
|
|
12
|
+
import type { ISeriesMarkAttributeContext } from '../../compile/mark';
|
|
10
13
|
type BarMarks = 'bar';
|
|
14
|
+
export type IStackCornerRadiusCallback = (attr: IRectGraphicAttribute, datum: Datum, ctx: ISeriesMarkAttributeContext) => number | number[];
|
|
11
15
|
export interface IBarSeriesSpec extends ICartesianSeriesSpec, IAnimationSpec<BarMarks, BarAppearPreset>, IMarkProgressiveConfig, IDataSamping {
|
|
12
16
|
type: 'bar';
|
|
13
17
|
xField?: string | string[];
|
|
@@ -22,7 +26,7 @@ export interface IBarSeriesSpec extends ICartesianSeriesSpec, IAnimationSpec<Bar
|
|
|
22
26
|
barMaxWidth?: number | string;
|
|
23
27
|
barGapInGroup?: number | string | (number | string)[];
|
|
24
28
|
barMinHeight?: number;
|
|
25
|
-
stackCornerRadius?: number | number[];
|
|
29
|
+
stackCornerRadius?: number | number[] | IStackCornerRadiusCallback;
|
|
26
30
|
}
|
|
27
31
|
export interface IBarBackgroundSpec {
|
|
28
32
|
fieldLevel?: number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
|
+
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
+
export declare class GaugePointerTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
4
|
+
updateTooltipSpec(): void;
|
|
5
|
+
}
|
|
@@ -18,6 +18,7 @@ export interface ISankeySeriesSpec extends Omit<ISeriesSpec, 'data'>, IAnimation
|
|
|
18
18
|
targetField?: string;
|
|
19
19
|
direction?: DirectionType;
|
|
20
20
|
nodeAlign?: 'left' | 'right' | 'center' | 'justify' | 'start' | 'end';
|
|
21
|
+
crossNodeAlign?: 'start' | 'end' | 'middle';
|
|
21
22
|
inverse?: boolean;
|
|
22
23
|
nodeGap?: number;
|
|
23
24
|
nodeWidth?: string | number | ((node: SankeyNodeElement) => number);
|
|
@@ -20,7 +20,6 @@ export declare class SankeySeries<T extends ISankeySeriesSpec = ISankeySeriesSpe
|
|
|
20
20
|
private _linkMark;
|
|
21
21
|
private _nodeLayoutZIndex;
|
|
22
22
|
private _labelLayoutZIndex;
|
|
23
|
-
private _labelLimit;
|
|
24
23
|
protected _nodesSeriesData?: SeriesData;
|
|
25
24
|
protected _linksSeriesData?: SeriesData;
|
|
26
25
|
private _viewBox;
|
package/types/util/array.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { array, last as peek, maxInArray as maxInArr, minInArray as minInArr } from '@visactor/vutils';
|
|
2
2
|
export declare function shallowCompare<T, U>(arrA: T | T[], arrB: U | U[]): boolean;
|
|
3
|
+
export declare function combineDomains(domains: number[][]): number[];
|
|
3
4
|
export { array, peek, maxInArr, minInArr };
|