@visactor/vchart-types 1.11.0-alpha.1 → 1.11.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 +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/component/index.d.ts +2 -2
- package/types/component/tooltip/constant.d.ts +3 -0
- package/types/component/tooltip/interface/common.d.ts +10 -5
- package/types/component/tooltip/interface/spec.d.ts +2 -2
- package/types/component/tooltip/processor/base.d.ts +10 -5
- package/types/component/tooltip/processor/group-tooltip.d.ts +11 -0
- package/types/component/tooltip/processor/index.d.ts +1 -0
- package/types/component/tooltip/processor/interface.d.ts +4 -3
- package/types/component/tooltip/processor/mark-tooltip.d.ts +2 -2
- package/types/component/tooltip/processor/util.d.ts +1 -1
- package/types/component/tooltip/tooltip.d.ts +3 -3
- package/types/component/tooltip/utils/compose.d.ts +4 -0
- package/types/component/tooltip/utils/get-spec.d.ts +5 -0
- package/types/component/tooltip/utils/get-value.d.ts +6 -0
- package/types/component/tooltip/utils/index.d.ts +3 -0
- package/types/core/interface.d.ts +0 -1
- package/types/model/tooltip-helper.d.ts +4 -2
- package/types/plugin/components/tooltip-handler/base.d.ts +4 -9
- package/types/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.d.ts +1 -2
- package/types/plugin/components/tooltip-handler/constants.d.ts +0 -3
- package/types/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +1 -1
- package/types/plugin/components/tooltip-handler/utils/common.d.ts +1 -7
- package/types/plugin/components/tooltip-handler/utils/index.d.ts +0 -2
- package/types/series/base/base-series.d.ts +1 -0
- package/types/series/base/tooltip-helper.d.ts +1 -0
- package/types/series/index.d.ts +3 -5
- package/types/series/interface/series.d.ts +1 -0
- package/types/typings/spec/chart.d.ts +0 -2
- package/types/typings/tooltip/handler.d.ts +1 -1
- package/types/typings/tooltip/tooltip.d.ts +4 -0
|
@@ -34,7 +34,7 @@ import type { IMarkPointSpec, IMarkPointTheme } from './marker/mark-point';
|
|
|
34
34
|
import { MarkPoint, registerMarkPoint } from './marker/mark-point';
|
|
35
35
|
import type { ITooltipSpec, ITooltipTheme } from './tooltip';
|
|
36
36
|
import { Tooltip, registerTooltip } from './tooltip';
|
|
37
|
-
import type { ILabelSpec, ITotalLabelTheme
|
|
37
|
+
import type { ILabelSpec, ITotalLabelTheme } from './label';
|
|
38
38
|
import { Label, registerLabel } from './label';
|
|
39
39
|
import { TotalLabel, registerTotalLabel } from './label/total-label';
|
|
40
40
|
import { registerPoptip } from './poptip/index';
|
|
@@ -43,6 +43,6 @@ import type { IAxisCommonTheme, IAxisItemTheme, IBandAxisTheme } from './axis/in
|
|
|
43
43
|
import type { IPoptipTheme } from './poptip/interface';
|
|
44
44
|
export { ScrollBar, DataZoom, CustomMark, Brush, MapLabelComponent, CartesianAxis, CartesianBandAxis, CartesianLinearAxis, CartesianTimeAxis, CartesianLogAxis, CartesianSymlogAxis, PolarAxis, PolarBandAxis, PolarLinearAxis, DiscreteLegend, ContinuousLegend, Indicator, Title, GeoCoordinate, CartesianCrossHair, PolarCrossHair, Player, MarkArea, MarkLine, MarkPoint, Tooltip, Label, TotalLabel };
|
|
45
45
|
export { registerBrush, registerScrollBar, registerTitle, registerTooltip, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerContinuousLegend, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerGeoCoordinate, registerIndicator, registerLabel, registerTotalLabel, registerMapLabel, registerMarkArea, registerMarkLine, registerMarkPoint, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPoptip };
|
|
46
|
-
export type { IComponent, IScrollBarSpec, IBrushSpec, ICartesianAxisSpec, ICartesianBandAxisSpec, ICartesianCrosshairSpec, ICartesianLinearAxisSpec, ICartesianTimeAxisSpec, ICartesianLogAxisSpec, IContinuousLegendSpec, IDataZoomSpec, IDiscreteLegendSpec, IGeoCoordinateSpec, IIndicatorSpec, ILabelSpec,
|
|
46
|
+
export type { IComponent, IScrollBarSpec, IBrushSpec, ICartesianAxisSpec, ICartesianBandAxisSpec, ICartesianCrosshairSpec, ICartesianLinearAxisSpec, ICartesianTimeAxisSpec, ICartesianLogAxisSpec, IContinuousLegendSpec, IDataZoomSpec, IDiscreteLegendSpec, IGeoCoordinateSpec, IIndicatorSpec, ILabelSpec, IMapLabelSpec, IMarkAreaSpec, IMarkLineSpec, IStepMarkLineSpec, IMarkPointSpec, IPlayerSpec, IPolarAxisSpec, IPolarBandAxisSpec, IPolarCrosshairSpec, IPolarLinearAxisSpec, ITitleSpec, ITooltipSpec };
|
|
47
47
|
export type { IComponentTheme, ICrosshairTheme, IAxisItemTheme, IAxisCommonTheme, IBandAxisTheme, IPolarAxisCommonTheme, ICartesianAxisCommonTheme, IBrushTheme, IDataZoomTheme, IScrollBarTheme, IIndicatorTheme, IMapLabelTheme, ITotalLabelTheme, ISizeLegendTheme, IColorLegendTheme, IDiscreteLegendTheme, IContinuousLegendTheme, IMarkAreaTheme, IMarkLineTheme, IMarkPointTheme, IPlayerTheme, IPoptipTheme, ITitleTheme, ITooltipTheme };
|
|
48
48
|
export * from './tooltip/interface';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { ITooltipLineActual } from '../../typings';
|
|
1
2
|
export declare class TooltipHandlerType {
|
|
2
3
|
static dom: string;
|
|
3
4
|
static canvas: string;
|
|
4
5
|
}
|
|
5
6
|
export declare const TOOLTIP_EL_CLASS_NAME = "vchart-tooltip-element";
|
|
7
|
+
export declare const TOOLTIP_MAX_LINE_COUNT = 20;
|
|
8
|
+
export declare const TOOLTIP_OTHERS_LINE: ITooltipLineActual;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import type { DimensionEventParams } from '../../../event/events/dimension/interface';
|
|
2
|
-
import type { DimensionTooltipInfo, MarkTooltipInfo } from '../processor/interface';
|
|
3
|
-
import type { Datum, IShowTooltipOption } from '../../../typings';
|
|
2
|
+
import type { DimensionTooltipInfo, GroupTooltipInfo, MarkTooltipInfo } from '../processor/interface';
|
|
3
|
+
import type { Datum, IShowTooltipOption, ITooltipActual } from '../../../typings';
|
|
4
4
|
import type { IComponent } from '../../interface';
|
|
5
|
+
import type { ITooltipSpec } from './spec';
|
|
5
6
|
export type TooltipHandlerParams = DimensionEventParams & {
|
|
6
7
|
changePositionOnly?: boolean;
|
|
7
8
|
tooltip: ITooltip;
|
|
9
|
+
tooltipSpec?: ITooltipSpec;
|
|
10
|
+
tooltipActual?: ITooltipActual;
|
|
11
|
+
groupDatum?: Datum[];
|
|
8
12
|
};
|
|
9
|
-
export interface ITooltipActiveTypeAsKeys<T, K> {
|
|
13
|
+
export interface ITooltipActiveTypeAsKeys<T, K, U> {
|
|
10
14
|
mark: T;
|
|
11
15
|
dimension: K;
|
|
16
|
+
group: U;
|
|
12
17
|
}
|
|
13
18
|
export type TotalMouseEventData = {
|
|
14
|
-
tooltipInfo: Partial<ITooltipActiveTypeAsKeys<MarkTooltipInfo, DimensionTooltipInfo>>;
|
|
15
|
-
ignore: Partial<ITooltipActiveTypeAsKeys<boolean, boolean>>;
|
|
19
|
+
tooltipInfo: Partial<ITooltipActiveTypeAsKeys<MarkTooltipInfo, DimensionTooltipInfo, GroupTooltipInfo>>;
|
|
20
|
+
ignore: Partial<ITooltipActiveTypeAsKeys<boolean, boolean, boolean>>;
|
|
16
21
|
};
|
|
17
22
|
export declare const enum TooltipResult {
|
|
18
23
|
success = 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ITooltipActual, ITooltipPattern, Maybe, MaybeArray, TooltipActiveType, TooltipData } from '../../../typings';
|
|
1
|
+
import type { IGroupTooltipPattern, ITooltipActual, ITooltipPattern, Maybe, MaybeArray, TooltipActiveType, TooltipData } from '../../../typings';
|
|
2
2
|
import type { ITooltipActiveTypeAsKeys, TooltipHandlerParams, TooltipResult } from './common';
|
|
3
3
|
import type { ITooltipTheme } from './theme';
|
|
4
|
-
export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipPattern, ITooltipPattern>> {
|
|
4
|
+
export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipPattern, ITooltipPattern, IGroupTooltipPattern>> {
|
|
5
5
|
visible?: boolean;
|
|
6
6
|
activeType?: TooltipActiveType | TooltipActiveType[];
|
|
7
7
|
trigger?: MaybeArray<'hover' | 'click'> | 'none';
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import type { BaseEventParams } from '../../../event/interface';
|
|
2
|
-
import type { TooltipActiveType, TooltipData } from '../../../typings';
|
|
3
|
-
import type { TooltipHandlerParams } from '../interface';
|
|
2
|
+
import type { ITooltipActual, TooltipActiveType, TooltipData } from '../../../typings';
|
|
3
|
+
import type { ITooltipSpec, TooltipHandlerParams } from '../interface';
|
|
4
4
|
import { TooltipResult } from '../interface/common';
|
|
5
5
|
import type { Tooltip } from '../tooltip';
|
|
6
|
-
import type { MouseEventData, TooltipInfo } from './interface';
|
|
6
|
+
import type { DimensionTooltipInfo, MouseEventData, TooltipInfo } from './interface';
|
|
7
7
|
import type { IDimensionInfo } from '../../../event/events/dimension';
|
|
8
8
|
export declare abstract class BaseTooltipProcessor {
|
|
9
9
|
readonly component: Tooltip;
|
|
10
|
-
activeType: TooltipActiveType;
|
|
10
|
+
abstract activeType: TooltipActiveType;
|
|
11
|
+
protected _cacheViewSpec: ITooltipSpec | undefined;
|
|
12
|
+
protected _cacheActualTooltip: ITooltipActual | undefined;
|
|
11
13
|
constructor(component: Tooltip);
|
|
12
14
|
abstract showTooltip(info: TooltipInfo, params: BaseEventParams, changePositionOnly: boolean): TooltipResult;
|
|
13
15
|
abstract shouldHandleTooltip(params: BaseEventParams, mouseEventData: Partial<MouseEventData>): boolean;
|
|
14
|
-
abstract getMouseEventData(params: BaseEventParams): MouseEventData;
|
|
16
|
+
abstract getMouseEventData(params: BaseEventParams, dimensionInfo?: DimensionTooltipInfo): MouseEventData;
|
|
15
17
|
protected _showTooltipByHandler: (data: TooltipData | undefined, params: TooltipHandlerParams) => TooltipResult;
|
|
16
18
|
protected _preprocessDimensionInfo(dimensionInfo?: IDimensionInfo[]): IDimensionInfo[] | undefined;
|
|
17
19
|
protected _getDimensionInfo(params: BaseEventParams): IDimensionInfo[];
|
|
20
|
+
protected _updateViewSpec(params: TooltipHandlerParams): void;
|
|
21
|
+
protected _updateActualTooltip(data: TooltipData, params: TooltipHandlerParams): void;
|
|
22
|
+
clearCache(): void;
|
|
18
23
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BaseEventParams } from '../../../event/interface';
|
|
2
|
+
import type { TooltipActiveType } from '../../../typings';
|
|
3
|
+
import type { DimensionTooltipInfo, GroupTooltipInfo, MouseEventData } from './interface';
|
|
4
|
+
import { BaseTooltipProcessor } from './base';
|
|
5
|
+
export declare class GroupTooltipProcessor extends BaseTooltipProcessor {
|
|
6
|
+
activeType: TooltipActiveType;
|
|
7
|
+
showTooltip(info: GroupTooltipInfo, params: BaseEventParams, changePositionOnly: boolean): import("../interface").TooltipResult;
|
|
8
|
+
shouldHandleTooltip(params: BaseEventParams, mouseEventData: Partial<MouseEventData>): boolean;
|
|
9
|
+
getMouseEventData(params: BaseEventParams, dimensionInfo?: DimensionTooltipInfo): MouseEventData;
|
|
10
|
+
protected _getGroupDatum(params: BaseEventParams): any;
|
|
11
|
+
}
|
|
@@ -3,13 +3,14 @@ import type { IMark } from '../../../mark/interface';
|
|
|
3
3
|
import type { ISeries } from '../../../series/interface';
|
|
4
4
|
import type { IDimensionInfo } from '../../../event/events/dimension/interface';
|
|
5
5
|
export type DimensionTooltipInfo = IDimensionInfo[];
|
|
6
|
-
export type MarkTooltipInfo = {
|
|
7
|
-
datum:
|
|
6
|
+
export type MarkTooltipInfo<T = Datum> = {
|
|
7
|
+
datum: T;
|
|
8
8
|
mark: IMark;
|
|
9
9
|
series: ISeries;
|
|
10
10
|
dimensionInfo: DimensionTooltipInfo;
|
|
11
11
|
};
|
|
12
|
-
export type
|
|
12
|
+
export type GroupTooltipInfo = MarkTooltipInfo<Datum | Datum[]>;
|
|
13
|
+
export type TooltipInfo = DimensionTooltipInfo | MarkTooltipInfo | GroupTooltipInfo;
|
|
13
14
|
export type MouseEventData = {
|
|
14
15
|
tooltipInfo: TooltipInfo;
|
|
15
16
|
ignore: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BaseEventParams } from '../../../event/interface';
|
|
2
2
|
import type { TooltipActiveType } from '../../../typings';
|
|
3
|
-
import type { MarkTooltipInfo, MouseEventData } from './interface';
|
|
3
|
+
import type { DimensionTooltipInfo, MarkTooltipInfo, MouseEventData } from './interface';
|
|
4
4
|
import { BaseTooltipProcessor } from './base';
|
|
5
5
|
export declare class MarkTooltipProcessor extends BaseTooltipProcessor {
|
|
6
6
|
activeType: TooltipActiveType;
|
|
7
7
|
showTooltip(info: MarkTooltipInfo, params: BaseEventParams, changePositionOnly: boolean): import("../interface").TooltipResult;
|
|
8
8
|
shouldHandleTooltip(params: BaseEventParams, mouseEventData: Partial<MouseEventData>): boolean;
|
|
9
|
-
getMouseEventData(params: BaseEventParams): MouseEventData;
|
|
9
|
+
getMouseEventData(params: BaseEventParams, dimensionInfo?: DimensionTooltipInfo): MouseEventData;
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Maybe } from '@visactor/vutils';
|
|
2
2
|
import type { DimensionTooltipInfo, MarkTooltipInfo, TooltipInfo } from './interface';
|
|
3
|
-
export declare const isMarkInfo: (info: Maybe<TooltipInfo>) => info is MarkTooltipInfo
|
|
3
|
+
export declare const isMarkInfo: (info: Maybe<TooltipInfo>) => info is MarkTooltipInfo<any>;
|
|
4
4
|
export declare const isDimensionInfo: (info: Maybe<TooltipInfo>) => info is DimensionTooltipInfo;
|
|
@@ -7,8 +7,7 @@ import type { ITooltipHandler, ITooltipLineActual, TooltipActiveType } from '../
|
|
|
7
7
|
import type { Datum, IShowTooltipOption } from '../../typings';
|
|
8
8
|
import type { ITooltip, ITooltipActiveTypeAsKeys, ITooltipSpec, TooltipHandlerParams, TotalMouseEventData } from './interface';
|
|
9
9
|
import { TooltipResult } from './interface/common';
|
|
10
|
-
import { DimensionTooltipProcessor } from './processor
|
|
11
|
-
import { MarkTooltipProcessor } from './processor/mark-tooltip';
|
|
10
|
+
import { GroupTooltipProcessor, DimensionTooltipProcessor, MarkTooltipProcessor } from './processor';
|
|
12
11
|
import type { Maybe } from '@visactor/vutils';
|
|
13
12
|
import type { IGraphic } from '@visactor/vrender-core';
|
|
14
13
|
import { TooltipSpecTransformer } from './tooltip-transformer';
|
|
@@ -32,8 +31,9 @@ export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
|
32
31
|
private _alwaysShow;
|
|
33
32
|
private _cacheInfo;
|
|
34
33
|
private _cacheParams;
|
|
34
|
+
private _cacheActiveType;
|
|
35
35
|
private _eventList;
|
|
36
|
-
protected _processor: ITooltipActiveTypeAsKeys<MarkTooltipProcessor, DimensionTooltipProcessor>;
|
|
36
|
+
protected _processor: ITooltipActiveTypeAsKeys<MarkTooltipProcessor, DimensionTooltipProcessor, GroupTooltipProcessor>;
|
|
37
37
|
protected _isTooltipShown: boolean;
|
|
38
38
|
protected _clickLock: boolean;
|
|
39
39
|
isTooltipShown(): boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ITooltipLinePattern, ITooltipPattern, TooltipData, ITooltipLineActual } from '../../../typings/tooltip';
|
|
2
|
+
import type { TooltipActualTitleContent, TooltipHandlerParams } from '..';
|
|
3
|
+
export declare const getShowContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => TooltipActualTitleContent | null;
|
|
4
|
+
export declare const getOneLineData: (datum: any, config: ITooltipLinePattern, params: TooltipHandlerParams) => ITooltipLineActual;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TooltipActiveType } from '../../../typings';
|
|
2
|
+
import type { ISeries } from '../../../series/interface';
|
|
3
|
+
import type { IDimensionInfo } from '../../../event/events/dimension/interface';
|
|
4
|
+
import type { ITooltipSpec } from '..';
|
|
5
|
+
export declare const getTooltipSpecForShow: (activeType: TooltipActiveType, globalSpec: ITooltipSpec, series?: ISeries, dimensionInfo?: IDimensionInfo[]) => ITooltipSpec;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Datum, ITooltipLinePattern, ITooltipPattern, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../typings';
|
|
2
|
+
import type { TooltipHandlerParams } from '../interface';
|
|
3
|
+
export declare const getTooltipContentValue: <T>(field?: TooltipContentProperty<T>, datum?: any, params?: TooltipHandlerParams, formatter?: string) => T;
|
|
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
|
+
export declare function getFirstDatumFromTooltipData(data: TooltipData): Datum;
|
|
@@ -6,8 +6,8 @@ export type TooltipTrigger = IModel | IMark;
|
|
|
6
6
|
export interface ITooltipHelper {
|
|
7
7
|
spec: ITooltipSpec | undefined;
|
|
8
8
|
activeType: TooltipActiveType[];
|
|
9
|
-
activeTriggerSet: ITooltipActiveTypeAsKeys<Set<TooltipTrigger>, Set<TooltipTrigger>>;
|
|
10
|
-
ignoreTriggerSet: ITooltipActiveTypeAsKeys<Set<TooltipTrigger>, Set<TooltipTrigger>>;
|
|
9
|
+
activeTriggerSet: ITooltipActiveTypeAsKeys<Set<TooltipTrigger>, Set<TooltipTrigger>, Set<TooltipTrigger>>;
|
|
10
|
+
ignoreTriggerSet: ITooltipActiveTypeAsKeys<Set<TooltipTrigger>, Set<TooltipTrigger>, Set<TooltipTrigger>>;
|
|
11
11
|
updateTooltipSpec: () => void;
|
|
12
12
|
}
|
|
13
13
|
export declare abstract class BaseTooltipHelper implements ITooltipHelper {
|
|
@@ -16,10 +16,12 @@ export declare abstract class BaseTooltipHelper implements ITooltipHelper {
|
|
|
16
16
|
activeTriggerSet: {
|
|
17
17
|
mark: Set<TooltipTrigger>;
|
|
18
18
|
dimension: Set<TooltipTrigger>;
|
|
19
|
+
group: Set<TooltipTrigger>;
|
|
19
20
|
};
|
|
20
21
|
ignoreTriggerSet: {
|
|
21
22
|
mark: Set<TooltipTrigger>;
|
|
22
23
|
dimension: Set<TooltipTrigger>;
|
|
24
|
+
group: Set<TooltipTrigger>;
|
|
23
25
|
};
|
|
24
26
|
abstract updateTooltipSpec(): void;
|
|
25
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Options } from './constants';
|
|
2
2
|
import type { Maybe, ILayoutPoint, RenderMode } from '../../../typings';
|
|
3
|
-
import type { TooltipData, ITooltipActual, TooltipActiveType, ITooltipHandler,
|
|
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';
|
|
6
6
|
import type { IContainerSize } from '@visactor/vrender-components';
|
|
@@ -10,8 +10,8 @@ import { TooltipResult } from '../../../component/tooltip';
|
|
|
10
10
|
import type { IComponentPlugin, IComponentPluginService } from '../interface';
|
|
11
11
|
import { BasePlugin } from '../../base/base-plugin';
|
|
12
12
|
import type { ITooltipAttributes } from './interface';
|
|
13
|
-
type ChangeTooltipFunc = (visible: boolean, params: TooltipHandlerParams,
|
|
14
|
-
type ChangeTooltipPositionFunc = (
|
|
13
|
+
type ChangeTooltipFunc = (visible: boolean, params: TooltipHandlerParams, data?: TooltipData) => TooltipResult;
|
|
14
|
+
type ChangeTooltipPositionFunc = (params: TooltipHandlerParams, data: TooltipData) => TooltipResult;
|
|
15
15
|
export declare abstract class BaseTooltipHandler extends BasePlugin implements ITooltipHandler, IComponentPlugin {
|
|
16
16
|
static readonly pluginType: 'component';
|
|
17
17
|
static readonly specKey = "tooltip";
|
|
@@ -25,8 +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 _cacheViewSpec: ITooltipSpec | undefined;
|
|
29
|
-
protected _cacheActualTooltip: ITooltipActual | undefined;
|
|
30
28
|
protected _isTooltipPaused: boolean;
|
|
31
29
|
protected _isPointerEscaped: boolean;
|
|
32
30
|
protected _cachePointerTimer: number;
|
|
@@ -44,13 +42,10 @@ export declare abstract class BaseTooltipHandler extends BasePlugin implements I
|
|
|
44
42
|
hideTooltip(params: TooltipHandlerParams): TooltipResult;
|
|
45
43
|
release(): void;
|
|
46
44
|
protected _clearAllCache(): void;
|
|
47
|
-
protected
|
|
48
|
-
protected _clearCacheOfPosition(): void;
|
|
49
|
-
protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: ITooltipActual): void;
|
|
45
|
+
protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams): void;
|
|
50
46
|
protected abstract _removeTooltip(): void;
|
|
51
47
|
protected _throttle(callback: any): (...args: unknown[]) => unknown;
|
|
52
48
|
protected _getDefaultOption(): Options;
|
|
53
|
-
protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => ITooltipActual;
|
|
54
49
|
protected _getActualTooltipPosition: (actualTooltip: ITooltipActual, params: TooltipHandlerParams, tooltipBoxSize: IContainerSize | undefined) => ITooltipPositionActual;
|
|
55
50
|
protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined;
|
|
56
51
|
protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams): {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ITooltipActual } from '../../../../typings/tooltip';
|
|
2
1
|
import { BaseTooltipHandler } from '../base';
|
|
3
2
|
import { Tooltip as TooltipComponent } from '@visactor/vrender-components';
|
|
4
3
|
import type { TooltipHandlerParams } from '../../../../component/tooltip';
|
|
@@ -15,7 +14,7 @@ export declare class CanvasTooltipHandler extends BaseTooltipHandler {
|
|
|
15
14
|
private _initTooltipComponent;
|
|
16
15
|
private _getLayer;
|
|
17
16
|
protected _removeTooltip(): void;
|
|
18
|
-
protected _updateTooltip(visible: boolean, params: TooltipHandlerParams
|
|
17
|
+
protected _updateTooltip(visible: boolean, params: TooltipHandlerParams): void;
|
|
19
18
|
isTooltipShown(): boolean;
|
|
20
19
|
release(): void;
|
|
21
20
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { ITooltipLineActual } from '../../../typings';
|
|
2
1
|
import { escapeHTML } from './utils/common';
|
|
3
2
|
export declare const TOOLTIP_CONTAINER_EL_CLASS_NAME = "vchart-tooltip-container";
|
|
4
|
-
export declare const TOOLTIP_MAX_LINE_COUNT = 20;
|
|
5
3
|
export declare const TOOLTIP_EMPTY_STRING = "";
|
|
6
|
-
export declare const TOOLTIP_OTHERS_LINE: ITooltipLineActual;
|
|
7
4
|
export declare const DEFAULT_OPTIONS: {
|
|
8
5
|
offsetX: number;
|
|
9
6
|
offsetY: number;
|
|
@@ -21,7 +21,7 @@ export declare class DomTooltipHandler extends BaseTooltipHandler {
|
|
|
21
21
|
onAdd(service: IComponentPluginService<any>): void;
|
|
22
22
|
initEl(): void;
|
|
23
23
|
protected _removeTooltip(): void;
|
|
24
|
-
protected _updateTooltip(visible: boolean, params: TooltipHandlerParams
|
|
24
|
+
protected _updateTooltip(visible: boolean, params: TooltipHandlerParams): void;
|
|
25
25
|
protected _initStyle(): void;
|
|
26
26
|
protected _getParentElement(spec: ITooltipSpec): HTMLElement;
|
|
27
27
|
isTooltipShown(): boolean;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ITooltipLinePattern, ITooltipPattern, MaybeArray, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../../typings';
|
|
1
|
+
import type { MaybeArray } from '../../../../typings';
|
|
3
2
|
import type { ITooltipTextStyle } from '../interface/style';
|
|
4
3
|
import type { TooltipRichTextAttrs } from '@visactor/vrender-components';
|
|
5
|
-
import type { TooltipHandlerParams } from '../../../../component/tooltip';
|
|
6
4
|
export declare function escapeHTML(value: any): string;
|
|
7
|
-
export declare const getTooltipContentValue: <T>(field?: TooltipContentProperty<T>, datum?: any, params?: TooltipHandlerParams, formatter?: string) => T;
|
|
8
|
-
export declare const getTooltipPatternValue: <T>(field?: TooltipPatternProperty<T>, data?: TooltipData, params?: TooltipHandlerParams) => T;
|
|
9
|
-
export declare const getTooltipContentPattern: (field?: ITooltipPattern['content'], data?: TooltipData, params?: TooltipHandlerParams) => Array<ITooltipLinePattern> | undefined;
|
|
10
|
-
export declare function getFirstDatumFromTooltipData(data: TooltipData): Datum;
|
|
11
5
|
export declare function pickFirstValidValue<T>(isValid: (element?: T) => any, ...elements: T[]): T | undefined;
|
|
12
6
|
export declare function convertToColorString(color: any, defaultColor?: string): string;
|
|
13
7
|
export declare const getScale: (element: HTMLElement, boundingClientRect?: DOMRect) => number;
|
|
@@ -36,6 +36,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
36
36
|
protected _rootMark: IGroupMark;
|
|
37
37
|
getRootMark(): IGroupMark;
|
|
38
38
|
protected _seriesMark: Maybe<IMark>;
|
|
39
|
+
getSeriesMark(): IMark;
|
|
39
40
|
protected _layoutLevel: number;
|
|
40
41
|
protected _rawData: DataView;
|
|
41
42
|
getRawData(): DataView;
|
|
@@ -18,6 +18,7 @@ export declare class BaseSeriesTooltipHelper extends BaseTooltipHelper implement
|
|
|
18
18
|
protected _getSeriesCacheInfo: () => ISeriesCacheInfo;
|
|
19
19
|
protected _getDimensionData: (datum: any) => any;
|
|
20
20
|
protected _getMeasureData: (datum: any) => any;
|
|
21
|
+
protected _getSeriesFieldData: (datum: any) => any;
|
|
21
22
|
protected _getSeriesStyle: (datum: any, styleKey: string | string[], defaultValue?: any) => any;
|
|
22
23
|
contentKeyCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
|
23
24
|
contentValueCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
package/types/series/index.d.ts
CHANGED
|
@@ -63,10 +63,8 @@ import type { IProgressLikeSeriesSpec } from './polar/progress-like';
|
|
|
63
63
|
import { ProgressLikeSeries } from './polar/progress-like';
|
|
64
64
|
import type { IRoseLikeSeriesSpec } from './polar/rose-like';
|
|
65
65
|
import { RoseLikeSeries } from './polar/rose-like';
|
|
66
|
-
import type { ILiquidSeriesSpec } from './liquid/interface';
|
|
67
|
-
import { LiquidSeries, registerLiquidSeries } from './liquid/liquid';
|
|
68
66
|
import type { ISeries, ICartesianSeries, IPolarSeries, IGeoSeries } from './interface';
|
|
69
|
-
export { WaterfallSeries, Bar3dSeries, BarSeries, BoxPlotSeries, LineSeries, RadarSeries, RangeAreaSeries, RangeColumn3dSeries, RangeColumnSeries, MapSeries, Pie3dSeries, PieSeries, SankeySeries, ScatterSeries, SunburstSeries, RoseLikeSeries, RoseSeries, AreaSeries, DotSeries, LinearProgressSeries, LinkSeries, CirclePackingSeries, CircularProgressSeries, WordCloud3dSeries, WordCloudSeries, Funnel3dSeries, FunnelSeries, TreemapSeries, GaugePointerSeries, GaugeSeries, HeatmapSeries, BaseSeries, CartesianSeries, PolarSeries, ProgressLikeSeries, CorrelationSeries
|
|
70
|
-
export { registerAreaSeries, registerBar3dSeries, registerBarSeries, registerBoxplotSeries, registerCirclePackingSeries, registerCircularProgressSeries, registerDotSeries, registerFunnel3dSeries, registerFunnelSeries, registerGaugePointerSeries, registerGaugeSeries, registerHeatmapSeries, registerLineSeries, registerLinearProgressSeries, registerLinkSeries, registerMapSeries, registerPie3dSeries, registerPieSeries, registerRadarSeries, registerRangeAreaSeries, registerRangeColumn3dSeries, registerRangeColumnSeries, registerRoseSeries, registerSankeySeries, registerScatterSeries, registerSunBurstSeries, registerTreemapSeries, registerWaterfallSeries, registerWordCloud3dSeries, registerWordCloudSeries
|
|
71
|
-
export type { ISeries, ICartesianSeries, IPolarSeries, IGeoSeries, IRoseLikeSeriesSpec, IAreaSeriesSpec, IBar3dSeriesSpec, IBarSeriesSpec, IBoxPlotSeriesSpec, ICartesianSeriesSpec, ICirclePackingSeriesSpec, ICircularProgressSeriesSpec, IDotSeriesSpec, IFunnel3dSeriesSpec, IFunnelSeriesSpec, IGaugePointerSeriesSpec, IGaugeSeriesSpec, IHeatmapSeriesSpec, ILineSeriesSpec, ILinearProgressSeriesSpec, ILinkSeriesSpec, IMapSeriesSpec, IPie3dSeriesSpec, IPieSeriesSpec, IPolarSeriesSpec, IProgressLikeSeriesSpec, IRadarSeriesSpec, IRangeAreaSeriesSpec, IRangeColumn3dSeriesSpec, IRangeColumnSeriesSpec, IRoseSeriesSpec, ISankeySeriesSpec, IScatterSeriesSpec, ISunburstSeriesSpec, ITreemapSeriesSpec, IWaterfallSeriesSpec, IWordCloud3dSeriesSpec, IWordCloudSeriesSpec, ICorrelationSeriesSpec
|
|
67
|
+
export { WaterfallSeries, Bar3dSeries, BarSeries, BoxPlotSeries, LineSeries, RadarSeries, RangeAreaSeries, RangeColumn3dSeries, RangeColumnSeries, MapSeries, Pie3dSeries, PieSeries, SankeySeries, ScatterSeries, SunburstSeries, RoseLikeSeries, RoseSeries, AreaSeries, DotSeries, LinearProgressSeries, LinkSeries, CirclePackingSeries, CircularProgressSeries, WordCloud3dSeries, WordCloudSeries, Funnel3dSeries, FunnelSeries, TreemapSeries, GaugePointerSeries, GaugeSeries, HeatmapSeries, BaseSeries, CartesianSeries, PolarSeries, ProgressLikeSeries, CorrelationSeries };
|
|
68
|
+
export { registerAreaSeries, registerBar3dSeries, registerBarSeries, registerBoxplotSeries, registerCirclePackingSeries, registerCircularProgressSeries, registerDotSeries, registerFunnel3dSeries, registerFunnelSeries, registerGaugePointerSeries, registerGaugeSeries, registerHeatmapSeries, registerLineSeries, registerLinearProgressSeries, registerLinkSeries, registerMapSeries, registerPie3dSeries, registerPieSeries, registerRadarSeries, registerRangeAreaSeries, registerRangeColumn3dSeries, registerRangeColumnSeries, registerRoseSeries, registerSankeySeries, registerScatterSeries, registerSunBurstSeries, registerTreemapSeries, registerWaterfallSeries, registerWordCloud3dSeries, registerWordCloudSeries };
|
|
69
|
+
export type { ISeries, ICartesianSeries, IPolarSeries, IGeoSeries, IRoseLikeSeriesSpec, IAreaSeriesSpec, IBar3dSeriesSpec, IBarSeriesSpec, IBoxPlotSeriesSpec, ICartesianSeriesSpec, ICirclePackingSeriesSpec, ICircularProgressSeriesSpec, IDotSeriesSpec, IFunnel3dSeriesSpec, IFunnelSeriesSpec, IGaugePointerSeriesSpec, IGaugeSeriesSpec, IHeatmapSeriesSpec, ILineSeriesSpec, ILinearProgressSeriesSpec, ILinkSeriesSpec, IMapSeriesSpec, IPie3dSeriesSpec, IPieSeriesSpec, IPolarSeriesSpec, IProgressLikeSeriesSpec, IRadarSeriesSpec, IRangeAreaSeriesSpec, IRangeColumn3dSeriesSpec, IRangeColumnSeriesSpec, IRoseSeriesSpec, ISankeySeriesSpec, IScatterSeriesSpec, ISunburstSeriesSpec, ITreemapSeriesSpec, IWaterfallSeriesSpec, IWordCloud3dSeriesSpec, IWordCloudSeriesSpec, ICorrelationSeriesSpec };
|
|
72
70
|
export * from './interface';
|
|
@@ -53,6 +53,7 @@ export interface ISeries extends IModel {
|
|
|
53
53
|
getMarkInId: (id: number) => IMark | undefined;
|
|
54
54
|
getRootMark: () => IGroupMark;
|
|
55
55
|
getActiveMarks: () => IMark[];
|
|
56
|
+
getSeriesMark: () => IMark;
|
|
56
57
|
getStackData: () => ISeriesStackData;
|
|
57
58
|
getStack: () => boolean;
|
|
58
59
|
getStackValue: () => StringOrNumber | undefined;
|
|
@@ -25,7 +25,6 @@ import type { IWaterfallChartSpec } from '../../chart/waterfall';
|
|
|
25
25
|
import type { ICorrelationChartSpec } from '../../chart/correlation';
|
|
26
26
|
import type { IWordCloudChartSpec, IWordCloud3dChartSpec } from '../../chart/word-cloud';
|
|
27
27
|
import type { IChartSpec } from './common';
|
|
28
|
-
import type { ILiquidChartSpec } from '../../chart/liquid/interface';
|
|
29
28
|
export interface ChartSpecMap {
|
|
30
29
|
readonly common: ICommonChartSpec;
|
|
31
30
|
readonly area: IAreaChartSpec;
|
|
@@ -59,6 +58,5 @@ export interface ChartSpecMap {
|
|
|
59
58
|
readonly circlePacking: ICirclePackingChartSpec;
|
|
60
59
|
readonly heatmap: IHeatmapChartSpec;
|
|
61
60
|
readonly correlation: ICorrelationChartSpec;
|
|
62
|
-
readonly liquid: ILiquidChartSpec;
|
|
63
61
|
}
|
|
64
62
|
export type ISpec = ChartSpecMap[keyof ChartSpecMap] | IChartSpec;
|
|
@@ -5,4 +5,4 @@ export interface ITooltipHandler extends ITooltipHandlerSpec {
|
|
|
5
5
|
reInit?: () => any;
|
|
6
6
|
}
|
|
7
7
|
export type TooltipData = IDimensionInfo[] | IDimensionData[];
|
|
8
|
-
export type TooltipActiveType = 'mark' | 'dimension';
|
|
8
|
+
export type TooltipActiveType = 'mark' | 'dimension' | 'group';
|
|
@@ -16,6 +16,10 @@ export interface ITooltipPattern extends ITooltipShapePattern {
|
|
|
16
16
|
maxLineCount?: number;
|
|
17
17
|
activeType?: TooltipActiveType;
|
|
18
18
|
}
|
|
19
|
+
export type GroupTooltipTriggerMark = 'line' | 'area' | 'point' | 'bar';
|
|
20
|
+
export interface IGroupTooltipPattern extends ITooltipPattern {
|
|
21
|
+
triggerMark?: MaybeArray<GroupTooltipTriggerMark>;
|
|
22
|
+
}
|
|
19
23
|
export interface ITooltipActual {
|
|
20
24
|
visible?: boolean;
|
|
21
25
|
title?: ITooltipLineActual;
|