@visactor/vchart-types 1.12.7 → 1.12.8
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/gauge/interface.d.ts +1 -1
- package/types/chart/treemap/interface.d.ts +1 -1
- package/types/chart/venn/interface.d.ts +2 -2
- package/types/component/axis/cartesian/interface/common.d.ts +1 -0
- package/types/component/interface/index.d.ts +0 -1
- package/types/component/title/interface/spec.d.ts +3 -3
- package/types/component/tooltip/constant.d.ts +5 -4
- package/types/component/tooltip/interface/common.d.ts +1 -1
- package/types/component/tooltip/interface/spec.d.ts +8 -0
- package/types/component/tooltip/interface/theme.d.ts +2 -2
- package/types/component/tooltip/processor/base.d.ts +3 -5
- package/types/component/tooltip/tooltip.d.ts +9 -4
- package/types/component/tooltip/utils/common.d.ts +6 -4
- package/types/component/tooltip/utils/get-spec.d.ts +4 -4
- package/types/component/tooltip/utils/get-value.d.ts +1 -2
- package/types/component/tooltip/utils/index.d.ts +0 -1
- package/types/data/transforms/pie.d.ts +3 -0
- package/types/model/interface.d.ts +14 -0
- package/types/plugin/components/tooltip-handler/base.d.ts +1 -13
- package/types/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +0 -1
- package/types/plugin/components/tooltip-handler/interface/style.d.ts +1 -2
- package/types/plugin/components/tooltip-handler/utils/position.d.ts +3 -5
- package/types/region/interface.d.ts +3 -1
- package/types/series/base/tooltip-helper.d.ts +30 -6
- package/types/series/box-plot/tooltip-helper.d.ts +2 -2
- package/types/series/cartesian/cartesian.d.ts +1 -1
- package/types/series/dot/tooltip-helper.d.ts +8 -2
- package/types/series/gauge/pointer-tooltip-helper.d.ts +2 -1
- package/types/series/heatmap/tooltip-helper.d.ts +2 -3
- package/types/series/interface/tooltip-helper.d.ts +5 -4
- package/types/series/link/tooltip-helper.d.ts +5 -2
- package/types/series/liquid/tooltip-helper.d.ts +4 -5
- package/types/series/progress/linear/tooltip-helper.d.ts +2 -3
- package/types/series/range-area/tooltip-helper.d.ts +1 -3
- package/types/series/range-column/tooltip-helper.d.ts +1 -2
- package/types/series/sankey/sankey.d.ts +1 -1
- package/types/series/sankey/tooltip-helper.d.ts +3 -3
- package/types/typings/spec/common.d.ts +3 -3
- package/types/typings/tooltip/position.d.ts +1 -0
- package/types/typings/tooltip/shape.d.ts +0 -1
- package/types/typings/tooltip/tooltip.d.ts +7 -0
|
@@ -3,7 +3,7 @@ import type { IGaugePointerSeriesSpec, IGaugeSeriesSpec } from '../../series/gau
|
|
|
3
3
|
import type { ILinearAxisSpec } from '../../component/axis/interface';
|
|
4
4
|
import type { ICircularProgressSeriesSpec } from '../../series/progress/circular/interface';
|
|
5
5
|
import type { IPolarChartSpec } from '../polar';
|
|
6
|
-
export interface IGaugeChartSpec extends Omit<IPolarChartSpec, 'axes'>, Omit<IGaugePointerSeriesSpec, 'data' | 'type' | 'morph'> {
|
|
6
|
+
export interface IGaugeChartSpec extends Omit<IPolarChartSpec, 'axes'>, Omit<IGaugePointerSeriesSpec, 'data' | 'type' | 'morph' | 'tooltip'> {
|
|
7
7
|
type: 'gauge';
|
|
8
8
|
gauge?: Omit<IGaugeSeriesSpec, 'data'> | Omit<ICircularProgressSeriesSpec, 'data'>;
|
|
9
9
|
axes?: (IPolarAxisSpec | ILinearAxisSpec)[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ITreemapSeriesSpec } from '../../series/treemap/interface';
|
|
2
2
|
import type { IChartSpec } from '../../typings/spec/common';
|
|
3
|
-
export interface ITreemapChartSpec extends Omit<IChartSpec, 'data' | 'series'>, ITreemapSeriesSpec {
|
|
3
|
+
export interface ITreemapChartSpec extends Omit<IChartSpec, 'data' | 'series'>, Omit<ITreemapSeriesSpec, 'tooltip'> {
|
|
4
4
|
type: 'treemap';
|
|
5
5
|
series?: ITreemapSeriesSpec[];
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IVennSeriesSpec } from '../../series/venn/interface';
|
|
2
|
-
import type { IChartSpec } from '../../typings/spec/common';
|
|
3
|
-
export interface IVennChartSpec extends
|
|
2
|
+
import type { IChartExtendsSeriesSpec, IChartSpec } from '../../typings/spec/common';
|
|
3
|
+
export interface IVennChartSpec extends IChartSpec, IChartExtendsSeriesSpec<IVennSeriesSpec> {
|
|
4
4
|
type: 'venn';
|
|
5
5
|
series?: IVennSeriesSpec[];
|
|
6
6
|
}
|
|
@@ -17,6 +17,7 @@ export type ICartesianTitle = ITitle & {
|
|
|
17
17
|
export type ICartesianLabel = ILabel & {
|
|
18
18
|
flush?: boolean;
|
|
19
19
|
lastVisible?: boolean | null;
|
|
20
|
+
firstVisible?: boolean | null;
|
|
20
21
|
containerAlign?: 'left' | 'right' | 'center' | 'top' | 'bottom' | 'middle';
|
|
21
22
|
} & AxisLabelOverlap;
|
|
22
23
|
export interface ILinearAxis extends IAxis {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IComponent } from '../../interface';
|
|
2
|
-
import type { ITextGraphicAttribute, IRichTextCharacter,
|
|
2
|
+
import type { ITextGraphicAttribute, IRichTextCharacter, ITextAttribute } from '@visactor/vrender-core';
|
|
3
3
|
import type { IOrientType, IPadding } from '../../../typings';
|
|
4
4
|
import type { IComponentSpec } from '../../base/interface';
|
|
5
5
|
interface ITitleSpecWithoutText extends Omit<IComponentSpec, 'orient'> {
|
|
@@ -21,7 +21,7 @@ interface ITitleSpecWithoutText extends Omit<IComponentSpec, 'orient'> {
|
|
|
21
21
|
height?: number;
|
|
22
22
|
align?: string;
|
|
23
23
|
verticalAlign?: string;
|
|
24
|
-
wordBreak?:
|
|
24
|
+
wordBreak?: ITextAttribute['wordBreak'];
|
|
25
25
|
maxLineWidth?: number;
|
|
26
26
|
heightLimit?: number;
|
|
27
27
|
lineClamp?: number;
|
|
@@ -32,7 +32,7 @@ interface ITitleSpecWithoutText extends Omit<IComponentSpec, 'orient'> {
|
|
|
32
32
|
height?: number;
|
|
33
33
|
align?: string;
|
|
34
34
|
verticalAlign?: string;
|
|
35
|
-
wordBreak?:
|
|
35
|
+
wordBreak?: ITextAttribute['wordBreak'];
|
|
36
36
|
maxLineWidth?: number;
|
|
37
37
|
heightLimit?: number;
|
|
38
38
|
lineClamp?: number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ITooltipLineActual, TooltipActiveType } from '../../typings';
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
2
|
+
export declare const TooltipHandlerType: {
|
|
3
|
+
dom: string;
|
|
4
|
+
canvas: string;
|
|
5
|
+
};
|
|
6
6
|
export declare const TOOLTIP_EL_CLASS_NAME = "vchart-tooltip-element";
|
|
7
7
|
export declare const TOOLTIP_MAX_LINE_COUNT = 20;
|
|
8
8
|
export declare const TOOLTIP_OTHERS_LINE: ITooltipLineActual;
|
|
9
9
|
export declare const TOOLTIP_TYPES: TooltipActiveType[];
|
|
10
|
+
export declare const DEFAULT_SHOW_DELAY = 50;
|
|
@@ -7,7 +7,7 @@ export type TooltipHandlerParams = DimensionEventParams & {
|
|
|
7
7
|
changePositionOnly?: boolean;
|
|
8
8
|
tooltip: ITooltip;
|
|
9
9
|
tooltipSpec?: ITooltipSpec;
|
|
10
|
-
|
|
10
|
+
activeTooltipSpec?: ITooltipActual;
|
|
11
11
|
groupDatum?: Datum[];
|
|
12
12
|
};
|
|
13
13
|
export interface ITooltipActiveTypeAsKeys<T, K, U> {
|
|
@@ -6,6 +6,7 @@ export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipP
|
|
|
6
6
|
activeType?: TooltipActiveType | TooltipActiveType[];
|
|
7
7
|
trigger?: MaybeArray<'hover' | 'click'> | 'none';
|
|
8
8
|
triggerOff?: MaybeArray<'hover' | 'click'> | 'none';
|
|
9
|
+
showDelay?: number;
|
|
9
10
|
hideTimer?: number;
|
|
10
11
|
lockAfterClick?: boolean;
|
|
11
12
|
style?: Omit<ITooltipTheme<string>, 'offset' | 'transitionDuration'>;
|
|
@@ -23,9 +24,16 @@ export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipP
|
|
|
23
24
|
y?: number;
|
|
24
25
|
};
|
|
25
26
|
}
|
|
27
|
+
type ISeriesToolipPattern = Pick<ITooltipPattern, 'visible' | 'title' | 'content' | 'hasShape' | 'shapeColor' | 'shapeFill' | 'shapeHollow' | 'shapeLineWidth' | 'shapeSize' | 'shapeStroke' | 'shapeType' | 'updateContent' | 'updateTitle' | 'updatePosition'>;
|
|
28
|
+
export interface ISeriesTooltipSpec extends Pick<ITooltipSpec, 'visible' | 'activeType' | 'handler'> {
|
|
29
|
+
dimension?: ISeriesToolipPattern;
|
|
30
|
+
mark?: ISeriesToolipPattern;
|
|
31
|
+
group?: Pick<IGroupTooltipPattern, 'triggerMark'> & ISeriesToolipPattern;
|
|
32
|
+
}
|
|
26
33
|
export interface ITooltipHandlerSpec {
|
|
27
34
|
showTooltip: (activeType: TooltipActiveType, tooltipData: TooltipData, params: TooltipHandlerParams) => Maybe<TooltipResult>;
|
|
28
35
|
hideTooltip: (params: TooltipHandlerParams) => Maybe<TooltipResult>;
|
|
29
36
|
release: () => void;
|
|
30
37
|
isTooltipShown?: () => boolean;
|
|
31
38
|
}
|
|
39
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ITextAttribute } from '@visactor/vrender-core';
|
|
2
2
|
import type { ITooltipShapePattern, StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';
|
|
3
3
|
import type { Padding } from '@visactor/vrender-components';
|
|
4
4
|
import type { ITokenKey } from '../../../theme/token';
|
|
@@ -14,7 +14,7 @@ export interface ITooltipTextTheme<ColorType = string> {
|
|
|
14
14
|
spacing?: number;
|
|
15
15
|
multiLine?: boolean;
|
|
16
16
|
maxWidth?: number;
|
|
17
|
-
wordBreak?:
|
|
17
|
+
wordBreak?: ITextAttribute['wordBreak'];
|
|
18
18
|
autoWidth?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export interface ITooltipTheme<ColorType = string> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseEventParams } from '../../../event/interface';
|
|
2
2
|
import type { ITooltipActual, TooltipActiveType, TooltipData } from '../../../typings';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TooltipHandlerParams } from '../interface';
|
|
4
4
|
import { TooltipResult } from '../interface/common';
|
|
5
5
|
import type { Tooltip } from '../tooltip';
|
|
6
6
|
import type { MouseEventData, TooltipInfo } from './interface';
|
|
@@ -8,15 +8,13 @@ import type { IDimensionInfo } from '../../../event/events/dimension';
|
|
|
8
8
|
export declare abstract class BaseTooltipProcessor {
|
|
9
9
|
readonly component: Tooltip;
|
|
10
10
|
abstract activeType: TooltipActiveType;
|
|
11
|
-
protected
|
|
12
|
-
protected _cacheActualTooltip: ITooltipActual | undefined;
|
|
11
|
+
protected _cacheActiveSpec: ITooltipActual | undefined;
|
|
13
12
|
constructor(component: Tooltip);
|
|
14
13
|
abstract showTooltip(info: TooltipInfo, params: BaseEventParams, changePositionOnly: boolean): TooltipResult;
|
|
15
14
|
abstract getMouseEventData(params: BaseEventParams): MouseEventData;
|
|
16
15
|
protected _showTooltipByHandler: (data: TooltipData | undefined, params: TooltipHandlerParams) => TooltipResult;
|
|
17
16
|
protected _preprocessDimensionInfo(dimensionInfo?: IDimensionInfo[]): IDimensionInfo[] | undefined;
|
|
18
|
-
protected _updateViewSpec(params: TooltipHandlerParams): void;
|
|
19
|
-
protected _updateActualTooltip(data: TooltipData, params: TooltipHandlerParams): void;
|
|
17
|
+
protected _updateViewSpec(data: TooltipData, params: TooltipHandlerParams): void;
|
|
20
18
|
shouldHandleTooltip(params: BaseEventParams, info: TooltipInfo): boolean;
|
|
21
19
|
clearCache(): void;
|
|
22
20
|
}
|
|
@@ -20,7 +20,11 @@ export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
|
20
20
|
static specKey: string;
|
|
21
21
|
specKey: string;
|
|
22
22
|
layoutType: 'none';
|
|
23
|
-
private
|
|
23
|
+
private _hideTimer?;
|
|
24
|
+
private _outTimer?;
|
|
25
|
+
private _showTimer?;
|
|
26
|
+
private _needInitEventOfTooltip?;
|
|
27
|
+
private _enterable;
|
|
24
28
|
protected _spec: ITooltipSpec;
|
|
25
29
|
tooltipHandler?: ITooltipHandler;
|
|
26
30
|
processor: ITooltipActiveTypeAsKeys<MarkTooltipProcessor, DimensionTooltipProcessor, GroupTooltipProcessor>;
|
|
@@ -28,8 +32,8 @@ export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
|
28
32
|
private _cacheInfo;
|
|
29
33
|
private _cacheParams;
|
|
30
34
|
private _cacheActiveType;
|
|
35
|
+
private _cacheEnterableRect;
|
|
31
36
|
private _eventList;
|
|
32
|
-
protected _isTooltipShown: boolean;
|
|
33
37
|
protected _clickLock: boolean;
|
|
34
38
|
isTooltipShown(): boolean;
|
|
35
39
|
changeRegions(regions: IRegion[]): void;
|
|
@@ -43,6 +47,7 @@ export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
|
43
47
|
release(): void;
|
|
44
48
|
beforeRelease(): void;
|
|
45
49
|
protected _initHandler(): void;
|
|
50
|
+
protected _initEventOfTooltipContent(): void;
|
|
46
51
|
protected _initProcessor(): void;
|
|
47
52
|
protected _initEvent(): void;
|
|
48
53
|
protected _mountEvent: (eType: EventType, query: EventQuery, callback: EventCallback<any>) => void;
|
|
@@ -50,15 +55,15 @@ export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
|
50
55
|
protected _getMouseOutHandler: (needPointerDetection?: boolean) => (params: BaseEventParams) => void;
|
|
51
56
|
protected _handleChartMouseOut: (params?: BaseEventParams) => void;
|
|
52
57
|
protected _getMouseMoveHandler: (isClick: boolean) => (params: BaseEventParams) => void;
|
|
58
|
+
protected _handleChartMouseMove: (params: BaseEventParams, isClick: boolean) => void;
|
|
53
59
|
protected _showTooltipByMouseEvent: (activeType: TooltipActiveType, mouseEventData: TotalMouseEventData, params: BaseEventParams, isClick: boolean, useCache?: boolean) => boolean;
|
|
54
60
|
protected _getMouseEventData: (params: BaseEventParams) => TotalMouseEventData;
|
|
55
61
|
protected _hideTooltipByHandler: (params: TooltipHandlerParams) => TooltipResult;
|
|
56
62
|
reInit(spec?: any): void;
|
|
57
63
|
showTooltip(datum: Datum, options: IShowTooltipOption): false | "none" | TooltipActiveType;
|
|
58
|
-
hideTooltip()
|
|
64
|
+
hideTooltip: () => boolean;
|
|
59
65
|
private _isSameAsCache;
|
|
60
66
|
private _isPointerInChart;
|
|
61
|
-
private _isPointerOnTooltip;
|
|
62
67
|
getVisible(): boolean;
|
|
63
68
|
}
|
|
64
69
|
export declare const registerTooltip: () => void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ITooltipSpec } from '../interface';
|
|
1
|
+
import type { Datum, ITooltipActual, ITooltipLineActual, ITooltipLinePattern, MaybeArray, TooltipActiveType, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../typings';
|
|
2
|
+
import type { ISeriesTooltipSpec, ITooltipSpec, TooltipHandlerParams } from '../interface';
|
|
3
3
|
import type { BaseEventParams } from '../../../event/interface';
|
|
4
4
|
export declare const getTooltipActualActiveType: (spec?: ITooltipSpec) => TooltipActiveType[];
|
|
5
|
-
export declare const isActiveTypeVisible: (type: TooltipActiveType, spec?:
|
|
5
|
+
export declare const isActiveTypeVisible: (type: TooltipActiveType, spec?: ISeriesTooltipSpec) => boolean;
|
|
6
6
|
export declare function isEmptyPos(params: BaseEventParams): boolean;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function parseContent(contentSpec: MaybeArray<TooltipPatternProperty<MaybeArray<ITooltipLinePattern>>>, defaultContent: ITooltipLinePattern, shapeAttrs: Record<string, TooltipContentProperty<any>>, data?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams): ITooltipLineActual[];
|
|
8
|
+
export declare function combineContents(patternList: ITooltipActual[]): ITooltipActual;
|
|
9
|
+
export declare const getTimeString: (value: any, timeFormat?: string, timeFormatMode?: 'local' | 'utc') => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TooltipActiveType } from '../../../typings';
|
|
1
|
+
import type { ITooltipActual, TooltipActiveType, TooltipData } from '../../../typings';
|
|
2
2
|
import type { ISeries } from '../../../series/interface';
|
|
3
|
-
import type {
|
|
4
|
-
import type { ITooltipSpec } from '
|
|
5
|
-
export declare const getTooltipSpecForShow: (activeType: TooltipActiveType, globalSpec: ITooltipSpec, series?: ISeries,
|
|
3
|
+
import type { TooltipHandlerParams } from '../interface/common';
|
|
4
|
+
import type { ITooltipSpec } from '../interface/spec';
|
|
5
|
+
export declare const getTooltipSpecForShow: (activeType: TooltipActiveType, globalSpec: ITooltipSpec, series?: ISeries, data?: TooltipData, params?: TooltipHandlerParams) => ITooltipActual;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Datum,
|
|
1
|
+
import type { Datum, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../typings';
|
|
2
2
|
import type { TooltipHandlerParams } from '../interface';
|
|
3
3
|
export declare const getTooltipContentValue: <T>(field?: TooltipContentProperty<T>, datum?: any, params?: TooltipHandlerParams, formatter?: string) => T;
|
|
4
4
|
export declare const getTooltipPatternValue: <T>(field?: TooltipPatternProperty<T>, data?: TooltipData, params?: TooltipHandlerParams) => T;
|
|
5
|
-
export declare const getTooltipContentPattern: (field?: ITooltipPattern['content'], data?: TooltipData, params?: TooltipHandlerParams) => Array<ITooltipLinePattern> | undefined;
|
|
6
5
|
export declare function getFirstDatumFromTooltipData(data: TooltipData): Datum;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DataView } from '@visactor/vdataset';
|
|
2
|
+
import type { Datum } from '../../typings';
|
|
2
3
|
export interface IPieOpt {
|
|
3
4
|
angleField: () => string;
|
|
4
5
|
startAngle: () => number;
|
|
@@ -13,7 +14,9 @@ export interface IPieOpt {
|
|
|
13
14
|
asK: string;
|
|
14
15
|
showAllZero: boolean;
|
|
15
16
|
supportNegative: boolean;
|
|
17
|
+
showEmptyCircle: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare const pie: (originData: Array<DataView>, op: IPieOpt) => {
|
|
18
20
|
[x: string]: any;
|
|
19
21
|
}[];
|
|
22
|
+
export declare const isDataEmpty: (data: Datum[], angleField: string, supportNegative: boolean) => boolean;
|
|
@@ -20,6 +20,8 @@ import type { ILayoutItem, ILayoutItemSpec } from '../layout/interface';
|
|
|
20
20
|
import type { ILayoutPoint, ILayoutRect } from '../typings/layout';
|
|
21
21
|
import type { ComponentTypeEnum } from '../component/interface';
|
|
22
22
|
import type { SeriesTypeEnum } from '../series';
|
|
23
|
+
import type { ITooltipSpec } from '../component/tooltip/interface';
|
|
24
|
+
import type { TooltipActiveType } from '../typings';
|
|
23
25
|
export interface IModelInitOption {
|
|
24
26
|
}
|
|
25
27
|
export interface IModelLayoutOption {
|
|
@@ -152,3 +154,15 @@ export interface IBaseModelSpecTransformer {
|
|
|
152
154
|
getTheme: (spec: any, chartSpec: any) => any;
|
|
153
155
|
transformSpec: (spec: any, chartSpec: any, chartSpecInfo?: IChartSpecInfo) => IBaseModelSpecTransformerResult<any, any>;
|
|
154
156
|
}
|
|
157
|
+
export interface ITooltipHelper {
|
|
158
|
+
spec: ITooltipSpec | undefined;
|
|
159
|
+
activeType: TooltipActiveType[];
|
|
160
|
+
activeTriggerSet: {
|
|
161
|
+
mark?: Set<IMark>;
|
|
162
|
+
group?: Set<IMark>;
|
|
163
|
+
};
|
|
164
|
+
ignoreTriggerSet: {
|
|
165
|
+
mark?: Set<IMark>;
|
|
166
|
+
};
|
|
167
|
+
updateTooltipSpec: () => void;
|
|
168
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options } from './constants';
|
|
2
|
-
import type { Maybe,
|
|
2
|
+
import type { Maybe, RenderMode } from '../../../typings';
|
|
3
3
|
import type { TooltipData, ITooltipActual, TooltipActiveType, ITooltipHandler, ITooltipPositionActual } from '../../../typings/tooltip';
|
|
4
4
|
import type { IGroup } from '@visactor/vrender-core';
|
|
5
5
|
import type { Compiler } from '../../../compile/compiler';
|
|
@@ -25,12 +25,6 @@ export declare abstract class BaseTooltipHandler extends BasePlugin implements I
|
|
|
25
25
|
protected _attributes?: ITooltipAttributes | null;
|
|
26
26
|
protected _chartContainer: Maybe<HTMLElement>;
|
|
27
27
|
protected _compiler: Compiler;
|
|
28
|
-
protected _isTooltipPaused: boolean;
|
|
29
|
-
protected _isPointerEscaped: boolean;
|
|
30
|
-
protected _cachePointerTimer: number;
|
|
31
|
-
protected _cachePointerPosition: ILayoutPoint;
|
|
32
|
-
protected _cacheTooltipPosition: ILayoutPoint;
|
|
33
|
-
protected _cacheTooltipSize: IContainerSize;
|
|
34
28
|
protected _container: Maybe<IGroup | HTMLElement>;
|
|
35
29
|
protected _isReleased: boolean;
|
|
36
30
|
onAdd(service: IComponentPluginService<any>): void;
|
|
@@ -41,18 +35,12 @@ export declare abstract class BaseTooltipHandler extends BasePlugin implements I
|
|
|
41
35
|
protected _changeTooltipPosition: ChangeTooltipPositionFunc;
|
|
42
36
|
hideTooltip(params: TooltipHandlerParams): TooltipResult;
|
|
43
37
|
release(): void;
|
|
44
|
-
protected _clearAllCache(): void;
|
|
45
38
|
protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams): void;
|
|
46
39
|
protected abstract _removeTooltip(): void;
|
|
47
40
|
protected _throttle(callback: any): (...args: unknown[]) => unknown;
|
|
48
41
|
protected _getDefaultOption(): Options;
|
|
49
42
|
protected _getActualTooltipPosition: (actualTooltip: ITooltipActual, params: TooltipHandlerParams, tooltipBoxSize: IContainerSize | undefined) => ITooltipPositionActual;
|
|
50
43
|
protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined;
|
|
51
|
-
protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams): {
|
|
52
|
-
x: any;
|
|
53
|
-
y: any;
|
|
54
|
-
};
|
|
55
|
-
protected _isPointerMovingToTooltip(params: TooltipHandlerParams): boolean;
|
|
56
44
|
protected _getParentElement(spec: ITooltipSpec): HTMLElement;
|
|
57
45
|
getTooltipContainer(): HTMLElement | IGroup;
|
|
58
46
|
protected _initFromSpec(): void;
|
|
@@ -27,6 +27,5 @@ export declare class DomTooltipHandler extends BaseTooltipHandler {
|
|
|
27
27
|
isTooltipShown(): boolean;
|
|
28
28
|
reInit(): void;
|
|
29
29
|
protected _updatePosition({ x, y }: ITooltipPositionActual): void;
|
|
30
|
-
protected _initEvent(el: HTMLElement): void;
|
|
31
30
|
}
|
|
32
31
|
export declare const registerDomTooltipHandler: () => void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { TooltipAttributes } from '@visactor/vrender-components';
|
|
2
|
-
import type { ITextAttribute, IFillStyle
|
|
2
|
+
import type { ITextAttribute, IFillStyle } from '@visactor/vrender-core';
|
|
3
3
|
export interface ITooltipTextStyle extends Partial<ITextAttribute & IFillStyle> {
|
|
4
4
|
spacing?: number;
|
|
5
5
|
multiLine?: boolean;
|
|
6
6
|
maxWidth?: number;
|
|
7
|
-
wordBreak?: RichTextWordBreak;
|
|
8
7
|
autoWidth?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export interface ITooltipAttributes extends TooltipAttributes {
|
|
@@ -2,11 +2,9 @@ import type { IDimensionData } from '../../../../event';
|
|
|
2
2
|
import { type ILayoutPoint } from '../../../../typings';
|
|
3
3
|
import type { IFixedTooltipPositionPattern, IGlobalTooltipPositionPattern, TooltipFixedPosition } from '../../../../typings/tooltip/position';
|
|
4
4
|
export declare const getActualTooltipPositionValue: (position: number | ((event: MouseEvent) => number), event: MouseEvent) => number;
|
|
5
|
-
export type
|
|
6
|
-
export
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const getHorizontalPositionType: (position: TooltipFixedPosition, defaultCase?: TooltipHorizontalPositionType) => TooltipHorizontalPositionType;
|
|
9
|
-
export declare const getVerticalPositionType: (position: TooltipFixedPosition, defaultCase?: TooltipVerticalPositionType) => TooltipVerticalPositionType;
|
|
5
|
+
export type TooltipPositionType = -2 | -1 | 0 | 1 | 2;
|
|
6
|
+
export declare const positionType: Record<TooltipFixedPosition, [TooltipPositionType, TooltipPositionType]>;
|
|
7
|
+
export declare const getPositionType: (position: TooltipFixedPosition, dim: 'x' | 'y', defaultCase?: TooltipPositionType) => TooltipPositionType;
|
|
10
8
|
export declare const getCartesianCrosshairRect: (dimensionData: IDimensionData, layoutStartPoint: ILayoutPoint) => {
|
|
11
9
|
visible: boolean;
|
|
12
10
|
start: {
|
|
@@ -53,7 +53,9 @@ export interface IRegionSpec extends ILayoutItemSpec {
|
|
|
53
53
|
}
|
|
54
54
|
export interface IGeoRegionSpec extends IRegionSpec {
|
|
55
55
|
coordinate?: 'geo';
|
|
56
|
-
roam?: boolean
|
|
56
|
+
roam?: boolean | {
|
|
57
|
+
blank?: boolean;
|
|
58
|
+
};
|
|
57
59
|
longitudeField?: string;
|
|
58
60
|
latitudeField?: string;
|
|
59
61
|
projection?: Partial<Omit<IProjectionSpec, 'name'>>;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import type { TooltipHandlerParams } from '../../component/tooltip/interface';
|
|
2
|
-
import type { ITooltipPattern, ShapeType, TooltipActiveType } from '../../typings';
|
|
1
|
+
import type { ISeriesTooltipSpec, ITooltipSpec, TooltipHandlerParams } from '../../component/tooltip/interface';
|
|
2
|
+
import type { ITooltipActual, ITooltipLineActual, ITooltipLinePattern, ITooltipPattern, MaybeArray, ShapeType, TooltipActiveType, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../typings';
|
|
3
3
|
import type { ISeries, ISeriesTooltipHelper } from '../interface';
|
|
4
|
-
import { BaseTooltipHelper } from '../../model/tooltip-helper';
|
|
5
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
6
4
|
import type { Datum } from '@visactor/vgrammar-core';
|
|
5
|
+
import type { IMark } from '../../mark/interface/common';
|
|
7
6
|
interface ISeriesCacheInfo {
|
|
8
7
|
seriesFields: string[];
|
|
9
8
|
dimensionFields: string[];
|
|
10
9
|
measureFields: string[];
|
|
11
10
|
type: string;
|
|
12
11
|
}
|
|
13
|
-
export declare class BaseSeriesTooltipHelper
|
|
12
|
+
export declare class BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
14
13
|
series: ISeries;
|
|
14
|
+
spec: ISeriesTooltipSpec | undefined;
|
|
15
|
+
activeType: TooltipActiveType[];
|
|
16
|
+
activeTriggerSet: {
|
|
17
|
+
mark: Set<IMark>;
|
|
18
|
+
group: Set<IMark>;
|
|
19
|
+
};
|
|
20
|
+
ignoreTriggerSet: {
|
|
21
|
+
mark: Set<IMark>;
|
|
22
|
+
};
|
|
15
23
|
protected _seriesCacheInfo: ISeriesCacheInfo;
|
|
16
24
|
constructor(series: ISeries);
|
|
17
25
|
updateTooltipSpec(): void;
|
|
@@ -28,6 +36,22 @@ export declare class BaseSeriesTooltipHelper extends BaseTooltipHelper implement
|
|
|
28
36
|
dimensionTooltipTitleCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
|
29
37
|
groupTooltipTitleCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
|
30
38
|
groupTooltipKeyCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
|
31
|
-
|
|
39
|
+
getHasShape: (isContent: boolean) => boolean;
|
|
40
|
+
protected getShapeAttrs(activeType: TooltipActiveType, isContent: boolean, chartTooltipSpec?: ITooltipSpec): {
|
|
41
|
+
shapeType: TooltipContentProperty<string>;
|
|
42
|
+
shapeFill: TooltipContentProperty<string>;
|
|
43
|
+
shapeStroke: TooltipContentProperty<string>;
|
|
44
|
+
shapeHollow: TooltipContentProperty<boolean>;
|
|
45
|
+
shapeLineWidth: TooltipContentProperty<number>;
|
|
46
|
+
shapeSize: any;
|
|
47
|
+
hasShape: boolean;
|
|
48
|
+
};
|
|
49
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
50
|
+
protected getDefaultContentList(activeType: TooltipActiveType): MaybeArray<TooltipPatternProperty<MaybeArray<ITooltipLinePattern>>>;
|
|
51
|
+
protected getContentList(activeType: TooltipActiveType, spec: ITooltipPattern, shapeAttrs: Record<string, TooltipContentProperty<any>>, data?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams): ITooltipLineActual[];
|
|
52
|
+
protected getTitleResult(activeType: TooltipActiveType, titleSpec: TooltipPatternProperty<ITooltipLinePattern>, shapeAttrs: Record<string, TooltipContentProperty<any>>, data?: TooltipData, params?: TooltipHandlerParams): ITooltipLineActual;
|
|
53
|
+
getTooltipData(activeType: TooltipActiveType, chartTooltipSpec?: ITooltipSpec, data?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams): ITooltipActual | null;
|
|
54
|
+
protected getDefaultTitlePattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
55
|
+
protected getDefaultContentPattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
32
56
|
}
|
|
33
57
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { Datum,
|
|
3
|
+
import type { Datum, ITooltipLinePattern, TooltipActiveType } from '../../typings';
|
|
4
4
|
import { BOX_PLOT_TOOLTIP_KEYS } from '../../constant/box-plot';
|
|
5
5
|
export declare class BoxPlotSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
6
|
+
protected getDefaultContentList(activeType: TooltipActiveType): ITooltipLinePattern[];
|
|
7
7
|
getContentKey: (contentType: BOX_PLOT_TOOLTIP_KEYS) => (datum: any) => string;
|
|
8
8
|
getContentValue: (contentType: BOX_PLOT_TOOLTIP_KEYS) => (datum: any) => any;
|
|
9
9
|
shapeColorCallback: (datum: Datum) => any;
|
|
@@ -31,7 +31,7 @@ export declare abstract class CartesianSeries<T extends ICartesianSeriesSpec = I
|
|
|
31
31
|
protected _specXField: string[];
|
|
32
32
|
protected _specYField: string[];
|
|
33
33
|
protected _direction: DirectionType;
|
|
34
|
-
get direction(): "
|
|
34
|
+
get direction(): "horizontal" | "vertical";
|
|
35
35
|
protected _scaleX: IBaseScale;
|
|
36
36
|
get scaleX(): IBaseScale;
|
|
37
37
|
setScaleX(s: IBaseScale): void;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Datum, ITooltipActual, ITooltipLinePattern, MaybeArray, TooltipActiveType, TooltipData, TooltipPatternProperty } from '../../typings';
|
|
4
|
+
import type { ITooltipSpec } from '../../component/tooltip/interface/spec';
|
|
5
|
+
import type { TooltipHandlerParams } from '../../component/tooltip/interface/common';
|
|
4
6
|
export declare class DotSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
7
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
8
|
+
protected getDefaultTitlePattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
9
|
+
shapeTypeCallback: () => string;
|
|
10
|
+
protected getDefaultContentList(): MaybeArray<TooltipPatternProperty<MaybeArray<ITooltipLinePattern>>>;
|
|
11
|
+
getTooltipData(activeType: TooltipActiveType, chartTooltipSpec?: ITooltipSpec, data?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams): ITooltipActual | null;
|
|
6
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
+
import type { TooltipActiveType } from '../../typings';
|
|
3
4
|
export declare class GaugePointerTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
4
|
-
|
|
5
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
5
6
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TooltipActiveType } from '../../typings';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
4
3
|
export declare class HeatmapSeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
5
|
-
|
|
4
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
6
5
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Datum, ITooltipActual, ShapeType, TooltipActiveType, TooltipContentCallback, TooltipData } from '../../typings';
|
|
2
2
|
import type { ISeries } from './series';
|
|
3
|
-
import type { ITooltipHelper } from '../../model/
|
|
4
|
-
import type {
|
|
3
|
+
import type { ITooltipHelper } from '../../model/interface';
|
|
4
|
+
import type { ITooltipSpec } from '../../component/tooltip/interface/spec';
|
|
5
|
+
import type { TooltipHandlerParams } from '../../component/tooltip/interface/common';
|
|
5
6
|
export interface ISeriesTooltipHelper extends ITooltipHelper {
|
|
6
7
|
series: ISeries;
|
|
7
|
-
|
|
8
|
+
getTooltipData: (activeType: TooltipActiveType, chartTooltipSpec?: ITooltipSpec, allData?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams) => ITooltipActual | null;
|
|
8
9
|
markTooltipKeyCallback: TooltipContentCallback<string>;
|
|
9
10
|
markTooltipValueCallback: TooltipContentCallback<string>;
|
|
10
11
|
shapeTypeCallback: TooltipContentCallback<ShapeType>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITooltipLinePattern, TooltipActiveType } from '../../typings';
|
|
4
4
|
export declare class LinkSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
5
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
6
|
+
protected getDefaultTitlePattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
7
|
+
shapeTypeCallback: () => string;
|
|
8
|
+
protected getDefaultContentList(): ITooltipLinePattern[];
|
|
6
9
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { Datum
|
|
3
|
+
import type { Datum } from '../../typings';
|
|
4
4
|
export declare class LiquidSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
getLiquidFillColor: (datum: Datum) => any;
|
|
5
|
+
markTooltipKeyCallback: (datum: any) => string;
|
|
6
|
+
markTooltipValueCallback: (datum: any) => any;
|
|
7
|
+
shapeStrokeCallback: (datum: Datum) => any;
|
|
9
8
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseSeriesTooltipHelper } from '../../base/tooltip-helper';
|
|
2
2
|
import type { ISeriesTooltipHelper } from '../../interface';
|
|
3
|
-
import type {
|
|
4
|
-
import type { IDimensionInfo } from '../../../event/events/dimension/interface';
|
|
3
|
+
import type { TooltipActiveType } from '../../../typings';
|
|
5
4
|
export declare class LinearProgressSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
5
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
7
6
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { ITooltipPattern, TooltipActiveType } from '../../typings';
|
|
4
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
5
3
|
export declare class RangeAreaSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
4
|
+
protected _getMeasureData: (datum: any) => string;
|
|
7
5
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { ITooltipPattern, TooltipActiveType } from '../../typings';
|
|
4
3
|
export declare class RangeColumnSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
4
|
+
protected _getMeasureData: (datum: any) => string;
|
|
6
5
|
}
|
|
@@ -27,7 +27,7 @@ export declare class SankeySeries<T extends ISankeySeriesSpec = ISankeySeriesSpe
|
|
|
27
27
|
private _colorScale;
|
|
28
28
|
private _nodeList;
|
|
29
29
|
private _needClear;
|
|
30
|
-
get direction(): "
|
|
30
|
+
get direction(): "horizontal" | "vertical";
|
|
31
31
|
getCategoryField(): string;
|
|
32
32
|
setCategoryField(f: string): string;
|
|
33
33
|
protected _valueField: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type {
|
|
4
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
3
|
+
import type { Datum } from '@visactor/vgrammar-core';
|
|
5
4
|
export declare class SankeySeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
5
|
+
protected _getDimensionData: (datum: any) => any;
|
|
6
|
+
markTooltipValueCallback: (datum: Datum) => string | undefined;
|
|
7
7
|
}
|