@visactor/vchart-types 1.10.0-alpha.4 → 1.10.0-alpha.6

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.
Files changed (82) hide show
  1. package/package.json +3 -3
  2. package/tsconfig.tsbuildinfo +1 -1
  3. package/types/chart/base/base-chart.d.ts +1 -1
  4. package/types/chart/interface/chart.d.ts +1 -1
  5. package/types/compile/compiler.d.ts +1 -1
  6. package/types/component/axis/base-axis.d.ts +9 -6
  7. package/types/component/axis/cartesian/axis.d.ts +1 -5
  8. package/types/component/axis/cartesian/time-axis.d.ts +1 -1
  9. package/types/component/axis/cartesian/util/index.d.ts +0 -1
  10. package/types/component/axis/interface/common.d.ts +2 -1
  11. package/types/component/axis/interface/spec.d.ts +2 -0
  12. package/types/component/axis/polar/axis.d.ts +1 -5
  13. package/types/component/base/util.d.ts +5 -0
  14. package/types/component/crosshair/base.d.ts +4 -1
  15. package/types/component/crosshair/cartesian.d.ts +1 -7
  16. package/types/component/crosshair/interface/cartesian.d.ts +46 -0
  17. package/types/component/crosshair/interface/common.d.ts +7 -0
  18. package/types/component/crosshair/interface/index.d.ts +3 -0
  19. package/types/component/crosshair/interface/polar.d.ts +23 -0
  20. package/types/component/crosshair/interface/spec.d.ts +1 -0
  21. package/types/component/crosshair/polar.d.ts +2 -2
  22. package/types/component/crosshair/utils/cartesian.d.ts +32 -0
  23. package/types/component/crosshair/utils/common.d.ts +9 -0
  24. package/types/component/crosshair/utils/index.d.ts +1 -0
  25. package/types/component/crosshair/utils/polar.d.ts +37 -0
  26. package/types/component/data-zoom/data-zoom/data-zoom.d.ts +1 -0
  27. package/types/component/data-zoom/data-zoom/interface.d.ts +4 -5
  28. package/types/component/data-zoom/scroll-bar/interface.d.ts +2 -4
  29. package/types/component/data-zoom/util.d.ts +0 -4
  30. package/types/component/index.d.ts +1 -0
  31. package/types/component/interface/theme.d.ts +8 -0
  32. package/types/component/label/interface.d.ts +1 -1
  33. package/types/component/legend/continuous/interface.d.ts +6 -12
  34. package/types/component/legend/discrete/interface.d.ts +17 -4
  35. package/types/component/legend/discrete/legend.d.ts +1 -0
  36. package/types/component/legend/util.d.ts +1 -2
  37. package/types/component/player/interface/theme.d.ts +1 -1
  38. package/types/component/tooltip/interface/common.d.ts +2 -2
  39. package/types/component/tooltip/interface/event.d.ts +0 -2
  40. package/types/component/tooltip/interface/index.d.ts +1 -0
  41. package/types/component/tooltip/interface/spec.d.ts +2 -2
  42. package/types/component/tooltip/interface/theme.d.ts +3 -3
  43. package/types/component/tooltip/tooltip.d.ts +3 -3
  44. package/types/component/util.d.ts +8 -0
  45. package/types/core/factory.d.ts +3 -0
  46. package/types/core/index.d.ts +1 -0
  47. package/types/core/interface.d.ts +1 -1
  48. package/types/core/vchart.d.ts +2 -1
  49. package/types/event/events/dimension/interface.d.ts +3 -2
  50. package/types/index.d.ts +1 -0
  51. package/types/interaction/dimension-trigger.d.ts +1 -6
  52. package/types/mark/base/base-mark.d.ts +3 -3
  53. package/types/mark/index.d.ts +2 -3
  54. package/types/mark/interface/type.d.ts +0 -1
  55. package/types/plugin/chart/formatter/formatter.d.ts +28 -0
  56. package/types/plugin/chart/formatter/index.d.ts +1 -0
  57. package/types/plugin/components/index.d.ts +2 -5
  58. package/types/plugin/components/tooltip-handler/base.d.ts +6 -6
  59. package/types/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.d.ts +2 -2
  60. package/types/plugin/components/tooltip-handler/constants.d.ts +2 -2
  61. package/types/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +8 -4
  62. package/types/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +2 -2
  63. package/types/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +2 -2
  64. package/types/plugin/components/tooltip-handler/dom/model/interface.d.ts +2 -2
  65. package/types/plugin/components/tooltip-handler/utils/attribute.d.ts +2 -2
  66. package/types/plugin/components/tooltip-handler/utils/common.d.ts +3 -3
  67. package/types/plugin/components/tooltip-handler/utils/compose.d.ts +2 -2
  68. package/types/plugin/components/tooltip-handler/utils/position.d.ts +18 -3
  69. package/types/plugin/index.d.ts +1 -0
  70. package/types/series/base/tooltip-helper.d.ts +3 -3
  71. package/types/series/gauge/interface.d.ts +3 -3
  72. package/types/series/interface/common.d.ts +1 -1
  73. package/types/series/interface/theme.d.ts +17 -1
  74. package/types/series/progress/circular/interface.d.ts +5 -5
  75. package/types/series/sunburst/sunburst.d.ts +1 -1
  76. package/types/typings/spec/common.d.ts +4 -3
  77. package/types/typings/tooltip/line.d.ts +5 -2
  78. package/types/typings/tooltip/position.d.ts +21 -10
  79. package/types/typings/tooltip/shape.d.ts +2 -2
  80. package/types/typings/tooltip/tooltip.d.ts +8 -8
  81. package/types/typings/visual.d.ts +2 -4
  82. package/types/util/index.d.ts +1 -2
@@ -1,6 +1,6 @@
1
1
  import type { ControllerLayout, OrientType } from '@visactor/vrender-components';
2
2
  import type { ISymbolMarkSpec, IRectMarkSpec } from '../../../typings';
3
- import type { BaseGraphicAttributes } from '@visactor/vrender-components/es/core/type';
3
+ import type { BaseGraphicAttributes } from '@visactor/vrender-components';
4
4
  import type { ILayoutItemSpec } from '../../../layout/interface';
5
5
  export interface IPlayerTheme extends ILayoutItemSpec {
6
6
  visible?: boolean;
@@ -1,10 +1,10 @@
1
1
  import type { DimensionEventParams } from '../../../event/events/dimension/interface';
2
- import type { BaseEventParams } from '../../../event/interface';
3
2
  import type { DimensionTooltipInfo, MarkTooltipInfo } from '../processor/interface';
4
3
  import type { Datum, IShowTooltipOption } from '../../../typings';
5
4
  import type { IComponent } from '../../interface';
6
- export type TooltipHandlerParams = (BaseEventParams | DimensionEventParams) & {
5
+ export type TooltipHandlerParams = DimensionEventParams & {
7
6
  changePositionOnly?: boolean;
7
+ tooltip: ITooltip;
8
8
  };
9
9
  export interface ITooltipActiveTypeAsKeys<T, K> {
10
10
  mark: T;
@@ -1,8 +1,6 @@
1
1
  import type { TooltipActiveType, TooltipData } from '../../../typings';
2
- import type { IComponent } from '../../interface/common';
3
2
  import type { TooltipHandlerParams } from './common';
4
3
  export type TooltipEventParams = TooltipHandlerParams & {
5
4
  activeType?: TooltipActiveType;
6
5
  tooltipData?: TooltipData;
7
- tooltip: IComponent;
8
6
  };
@@ -1,3 +1,4 @@
1
1
  export * from './common';
2
2
  export * from './spec';
3
3
  export * from './theme';
4
+ export * from './event';
@@ -1,4 +1,4 @@
1
- import type { IToolTipActual, ITooltipPattern, Maybe, TooltipActiveType, TooltipData } from '../../../typings';
1
+ import type { ITooltipActual, ITooltipPattern, Maybe, TooltipActiveType, TooltipData } from '../../../typings';
2
2
  import type { ITooltipActiveTypeAsKeys, TooltipHandlerParams, TooltipResult } from './common';
3
3
  import type { ITooltipTheme } from './theme';
4
4
  export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipPattern, ITooltipPattern>> {
@@ -15,7 +15,7 @@ export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipP
15
15
  enterable?: boolean;
16
16
  transitionDuration?: number;
17
17
  throttleInterval?: number;
18
- updateElement?: (tooltipElement: HTMLElement, actualTooltip: IToolTipActual, params: TooltipHandlerParams) => void;
18
+ updateElement?: (tooltipElement: HTMLElement, actualTooltip: ITooltipActual, params: TooltipHandlerParams) => void;
19
19
  offset?: {
20
20
  x?: number;
21
21
  y?: number;
@@ -1,6 +1,6 @@
1
1
  import type { RichTextWordBreak } from '@visactor/vrender-core';
2
- import type { StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';
3
- import type { Padding } from '@visactor/vrender-components/es/core/type';
2
+ import type { ITooltipShapeActual, StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';
3
+ import type { Padding } from '@visactor/vrender-components';
4
4
  import type { ITokenKey } from '../../../theme/token';
5
5
  export interface ITooltipTextTheme<ColorType = string> {
6
6
  fontFamily?: string;
@@ -37,7 +37,7 @@ export interface ITooltipTheme<ColorType = string> {
37
37
  shape?: {
38
38
  size?: number;
39
39
  spacing?: number;
40
- };
40
+ } & ITooltipShapeActual;
41
41
  titleLabel?: ITooltipTextTheme<ColorType>;
42
42
  keyLabel?: Omit<ITooltipTextTheme<ColorType>, 'autoWidth'>;
43
43
  valueLabel?: ITooltipTextTheme<ColorType>;
@@ -3,7 +3,7 @@ import type { IModelLayoutOption, IModelRenderOption, IModelSpecInfo } from '../
3
3
  import type { IRegion } from '../../region/interface';
4
4
  import { BaseComponent } from '../base/base-component';
5
5
  import type { BaseEventParams, EventCallback, EventQuery, EventType } from '../../event/interface';
6
- import type { ITooltipHandler, IToolTipLineActual, TooltipActiveType } from '../../typings/tooltip';
6
+ import type { ITooltipHandler, ITooltipLineActual, TooltipActiveType } from '../../typings/tooltip';
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';
@@ -13,8 +13,8 @@ import type { Maybe } from '@visactor/vutils';
13
13
  import type { IGraphic } from '@visactor/vrender-core';
14
14
  import { TooltipSpecTransformer } from './tooltip-transformer';
15
15
  export type TooltipActualTitleContent = {
16
- title?: IToolTipLineActual;
17
- content?: IToolTipLineActual[];
16
+ title?: ITooltipLineActual;
17
+ content?: ITooltipLineActual[];
18
18
  };
19
19
  export declare class Tooltip extends BaseComponent<any> implements ITooltip {
20
20
  protected layoutZIndex: number;
@@ -1,2 +1,10 @@
1
1
  import type { ITheme } from '../theme';
2
+ import type { Datum } from '../typings';
2
3
  export declare function getComponentThemeFromOption(type: string, chartTheme: ITheme): any;
4
+ export declare function getFormatFunction(formatMethod?: any, formatter?: string | string[], text?: string | number, datum?: Datum): {
5
+ formatFunc: any;
6
+ args: (string | number | Datum)[];
7
+ } | {
8
+ formatFunc?: undefined;
9
+ args?: undefined;
10
+ };
@@ -19,6 +19,7 @@ export declare class Factory {
19
19
  private static _implements;
20
20
  private static _chartPlugin;
21
21
  private static _componentPlugin;
22
+ private static _formatter;
22
23
  static transforms: {
23
24
  [key: string]: Transform;
24
25
  };
@@ -62,4 +63,6 @@ export declare class Factory {
62
63
  static getChartPlugins(): IChartPluginConstructor[];
63
64
  static getComponentPlugins(): IComponentPluginConstructor[];
64
65
  static getComponentPluginInType(type: string): IComponentPluginConstructor;
66
+ static registerFormatter(func: typeof Factory['_formatter']): void;
67
+ static getFormatter(): (text: string | number | string[] | number[], datum: any, formatter: string | string[]) => any;
65
68
  }
@@ -10,6 +10,7 @@ export * from '../theme/interface';
10
10
  export * from '../constant';
11
11
  export * from './interface';
12
12
  export * from '../typings/spec/index';
13
+ export * from '../typings/tooltip';
13
14
  export * from '../theme/index';
14
15
  export { vglobal } from '@visactor/vrender-core';
15
16
  export * from '../plugin';
@@ -1,5 +1,5 @@
1
1
  import type { DataSet } from '@visactor/vdataset';
2
- import type { IParserOptions } from '@visactor/vdataset/es/parser';
2
+ import type { IParserOptions } from '@visactor/vdataset';
3
3
  import type { Datum, IInitOption, IMarkStateSpec, IPoint, IRegionQuerier, IShowTooltipOption, ISpec, ITooltipHandler, Maybe, MaybeArray, StringOrNumber } from '../typings';
4
4
  import type { IMorphConfig } from '../animation/spec';
5
5
  import type { IBoundsLike } from '@visactor/vutils';
@@ -5,7 +5,7 @@ import type { ISeriesConstructor } from '../series/interface';
5
5
  import type { DimensionIndexOption, IChart, IChartConstructor, IChartSpecInfo } from '../chart/interface';
6
6
  import type { IComponentConstructor } from '../component/interface';
7
7
  import type { EventCallback, EventParams, EventQuery, EventType } from '../event/interface';
8
- import type { IParserOptions } from '@visactor/vdataset/es/parser';
8
+ import type { IParserOptions } from '@visactor/vdataset';
9
9
  import type { Transform, DataView } from '@visactor/vdataset';
10
10
  import { DataSet } from '@visactor/vdataset';
11
11
  import type { Stage } from '@visactor/vrender-core';
@@ -46,6 +46,7 @@ export declare class VChart implements IVChart {
46
46
  static readonly Utils: {
47
47
  measureText: (text: string, textSpec?: Partial<import("@visactor/vrender-core").ITextGraphicAttribute>, option?: Partial<import("@visactor/vutils").ITextMeasureOption>, useNaiveCanvas?: boolean) => import("@visactor/vutils").ITextSize;
48
48
  };
49
+ static readonly vglobal: import("@visactor/vrender-core").IGlobal;
49
50
  protected _originalSpec: any;
50
51
  protected _spec: any;
51
52
  getSpec(): any;
@@ -1,7 +1,7 @@
1
1
  import type { BaseEventParams } from '../../interface';
2
2
  import type { ISeries } from '../../../series/interface';
3
3
  import type { Datum } from '../../../typings';
4
- import type { AxisComponent } from '../../../component/axis/base-axis';
4
+ import type { IAxis } from '../../../component/axis';
5
5
  export declare enum DimensionEventEnum {
6
6
  dimensionHover = "dimensionHover",
7
7
  dimensionClick = "dimensionClick"
@@ -9,7 +9,8 @@ export declare enum DimensionEventEnum {
9
9
  export interface IDimensionInfo {
10
10
  index?: number;
11
11
  value: string | number;
12
- axis?: AxisComponent;
12
+ position?: number;
13
+ axis?: IAxis;
13
14
  data: IDimensionData[];
14
15
  }
15
16
  export interface IDimensionData {
package/types/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './component';
8
8
  export * from './layout';
9
9
  export * from './env';
10
10
  export * from './event';
11
+ export * from './plugin';
@@ -10,7 +10,6 @@ export declare class DimensionTrigger implements ITrigger {
10
10
  protected _option: ITriggerOption;
11
11
  protected _marks: MarkSet;
12
12
  protected _markReverse: MarkSet;
13
- protected _lastDimensionEvent: DimensionEventParams;
14
13
  private _hover;
15
14
  get hover(): IHoverSpec;
16
15
  private _select;
@@ -23,10 +22,6 @@ export declare class DimensionTrigger implements ITrigger {
23
22
  protected initEvent(): void;
24
23
  protected releaseEvent(): void;
25
24
  private initConfig;
26
- protected getEventElement(params: DimensionEventParams, reverse?: boolean): {
27
- el: IElement;
28
- mark: IMark;
29
- }[];
30
- protected dimensionDataEqual(params: DimensionEventParams): boolean;
25
+ protected getEventElement(params: DimensionEventParams, reverse?: boolean): IElement[];
31
26
  private onHover;
32
27
  }
@@ -1,5 +1,5 @@
1
1
  import type { IAttributeOpt, IModelMarkAttributeContext } from '../../compile/mark/interface';
2
- import type { Datum, IMarkSpec, ICommonSpec } from '../../typings';
2
+ import type { Datum, IMarkSpec, ICommonSpec, ValueType } from '../../typings';
3
3
  import type { IMarkRaw, IMarkStateStyle, IMarkStyle, IMarkOption, StyleConvert, MarkInputStyle } from '../interface';
4
4
  import { CompilableMark } from '../../compile/mark/compilable-mark';
5
5
  import type { StateValueType } from '../../compile/mark';
@@ -17,11 +17,11 @@ export declare class BaseMark<T extends ICommonSpec> extends CompilableMark impl
17
17
  constructor(name: string, option: IMarkOption);
18
18
  created(): void;
19
19
  initStyleWithSpec(spec: IMarkSpec<T>, key?: string): void;
20
- convertAngleToRadian(styleConverter: StyleConvert<number>): StyleConvert<any>;
20
+ protected _transformStyleValue<T>(styleConverter: StyleConvert<T>, transform: (value: ValueType<T>) => ValueType<T>): StyleConvert<any>;
21
+ convertAngleToRadian(styleConverter: StyleConvert<number>): any;
21
22
  isUserLevel(level: number): boolean;
22
23
  setStyle<U extends keyof T>(style: Partial<IMarkStyle<T>>, state?: StateValueType, level?: number, stateStyle?: IMarkStateStyle<T>): void;
23
24
  getStyle(key: string, state?: StateValueType): any;
24
- protected _filterStyle(style: Partial<IMarkStyle<T>>, state: StateValueType, level: number, stateStyle?: IMarkStateStyle<T>): Partial<IMarkStyle<T>>;
25
25
  protected _filterAttribute<U extends keyof T>(attr: U, style: MarkInputStyle<T[U]>, state: StateValueType, level: number, isUserLevel: boolean, stateStyle?: IMarkStateStyle<T>): StyleConvert<T[U]>;
26
26
  setReferer<U extends keyof T>(mark: IMarkRaw<T>, styleKey?: U, state?: StateValueType, stateStyle?: IMarkStateStyle<T>): void;
27
27
  setPostProcess<U extends keyof T>(key: U, postProcessFunc: any, state?: StateValueType): void;
@@ -13,10 +13,9 @@ import { Arc3dMark } from './arc-3d';
13
13
  import { ComponentMark } from './component';
14
14
  import { LinkPathMark } from './link-path';
15
15
  import { RippleMark } from './ripple';
16
- import { ProgressArcMark } from './progress-arc';
17
16
  import { CellMark } from './cell';
18
17
  import { BaseMark } from './base';
19
18
  import { PolygonMark } from './polygon/polygon';
20
19
  import { Pyramid3dMark } from './polygon/pyramid-3d';
21
- export type { IBoxPlotMarkSpec, ILineMarkSpec, ISymbolMarkSpec, IGroupMarkSpec, IRuleMarkSpec, ITextMarkSpec, IAreaMarkSpec, IRect3dMarkSpec, IRectMarkSpec, IPathMarkSpec, IArcMarkSpec, IArc3dMarkSpec, ICommonSpec, IPolygonMarkSpec, IPyramid3dMarkSpec, ILinkPathMarkSpec, IRippleMarkSpec, IProgressArcMarkSpec, ConvertToMarkStyleSpec, ICellMarkSpec } from '../typings/visual';
22
- export { BoxPlotMark, LineMark, SymbolMark, GroupMark, RuleMark, TextMark, AreaMark, Rect3dMark, RectMark, PathMark, Arc3dMark, ArcMark, ComponentMark, PolygonMark, Pyramid3dMark, LinkPathMark, RippleMark, ProgressArcMark, CellMark, BaseMark };
20
+ export type { IBoxPlotMarkSpec, ILineMarkSpec, ISymbolMarkSpec, IGroupMarkSpec, IRuleMarkSpec, ITextMarkSpec, IAreaMarkSpec, IRect3dMarkSpec, IRectMarkSpec, IPathMarkSpec, IArcMarkSpec, IArc3dMarkSpec, ICommonSpec, IPolygonMarkSpec, IPyramid3dMarkSpec, ILinkPathMarkSpec, IRippleMarkSpec, ConvertToMarkStyleSpec, ICellMarkSpec } from '../typings/visual';
21
+ export { BoxPlotMark, LineMark, SymbolMark, GroupMark, RuleMark, TextMark, AreaMark, Rect3dMark, RectMark, PathMark, Arc3dMark, ArcMark, ComponentMark, PolygonMark, Pyramid3dMark, LinkPathMark, RippleMark, CellMark, BaseMark };
@@ -16,7 +16,6 @@ export declare const enum MarkTypeEnum {
16
16
  pyramid3d = "pyramid3d",
17
17
  boxPlot = "boxPlot",
18
18
  linkPath = "linkPath",
19
- progressArc = "progressArc",
20
19
  cell = "cell",
21
20
  ripple = "ripple",
22
21
  liquid = "liquid",
@@ -0,0 +1,28 @@
1
+ import { BasePlugin } from '../../base/base-plugin';
2
+ import { IChartPlugin, IChartPluginService } from '../interface';
3
+ export declare class FormatterPlugin extends BasePlugin implements IChartPlugin {
4
+ static readonly pluginType: 'chart';
5
+ static readonly specKey = "formatter";
6
+ static readonly type: string;
7
+ readonly type: string;
8
+ private readonly _timeModeFormat;
9
+ protected _spec: {
10
+ timeMode: 'utc' | 'local';
11
+ customFormatter: (specifier: string, text: string | number | string[] | number[], datum: any) => string | string[];
12
+ numericFormatter: (specifier: string, text: string | number | string[] | number[]) => string;
13
+ timeFormatter: (specifier: string, text: string | number | string[] | number[]) => string;
14
+ };
15
+ protected _formatter: (text: string | number | string[] | number[], datum: any, formatter: string | string[]) => string | number | (string | number)[];
16
+ private _timeFormatter;
17
+ private _numericFormatter;
18
+ private _numericSpecifier;
19
+ private _numericFormatterCache;
20
+ private _isNumericFormatterCache;
21
+ constructor();
22
+ onInit(service: IChartPluginService, chartSpec: any): void;
23
+ protected _format(text: string | number | string[] | number[], datum: any, formatter: string | string[]): string | number | (string | number)[];
24
+ protected _formatSingleLine(text: string | number, datum: any, formatter: string): string | number;
25
+ protected _formatSingleText(text: string | number, formatter: string): string | number;
26
+ dispose(): void;
27
+ }
28
+ export declare const registerFormatPlugin: () => void;
@@ -0,0 +1 @@
1
+ export * from './formatter';
@@ -1,5 +1,2 @@
1
- import { AxisSyncPlugin } from './axis-sync';
2
- declare const _default: {
3
- AxisSyncPlugin: typeof AxisSyncPlugin;
4
- };
5
- export default _default;
1
+ export * from './axis-sync';
2
+ export * from './tooltip-handler';
@@ -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, ITooltipPattern, ITooltipPositionActual } from '../../../typings/tooltip';
3
+ import type { TooltipData, ITooltipActual, TooltipActiveType, ITooltipHandler, ITooltipPattern, 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';
@@ -26,7 +26,7 @@ export declare abstract class BaseTooltipHandler extends BasePlugin implements I
26
26
  protected _chartContainer: Maybe<HTMLElement>;
27
27
  protected _compiler: Compiler;
28
28
  protected _cacheViewSpec: ITooltipSpec | undefined;
29
- protected _cacheActualTooltip: IToolTipActual | undefined;
29
+ protected _cacheActualTooltip: ITooltipActual | undefined;
30
30
  protected _isTooltipPaused: boolean;
31
31
  protected _isPointerEscaped: boolean;
32
32
  protected _cachePointerTimer: number;
@@ -46,13 +46,13 @@ export declare abstract class BaseTooltipHandler extends BasePlugin implements I
46
46
  protected _clearAllCache(): void;
47
47
  protected _clearCacheOfContent(): void;
48
48
  protected _clearCacheOfPosition(): void;
49
- protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: IToolTipActual): void;
49
+ protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: ITooltipActual): void;
50
50
  protected abstract _removeTooltip(): void;
51
51
  protected _throttle(callback: any): (...args: unknown[]) => unknown;
52
52
  protected _getDefaultOption(): Options;
53
- protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => IToolTipActual;
54
- protected _getActualTooltipPosition: (actualTooltip: IToolTipActual, params: TooltipHandlerParams, tooltipBoxSize: IContainerSize | undefined) => ITooltipPositionActual;
55
- protected _getTooltipBoxSize(actualTooltip: IToolTipActual, changePositionOnly: boolean): IContainerSize | undefined;
53
+ protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => ITooltipActual;
54
+ protected _getActualTooltipPosition: (actualTooltip: ITooltipActual, params: TooltipHandlerParams, tooltipBoxSize: IContainerSize | undefined) => ITooltipPositionActual;
55
+ protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined;
56
56
  protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams): {
57
57
  x: any;
58
58
  y: any;
@@ -1,4 +1,4 @@
1
- import type { IToolTipActual } from '../../../../typings/tooltip';
1
+ import type { ITooltipActual } from '../../../../typings/tooltip';
2
2
  import { BaseTooltipHandler } from '../base';
3
3
  import { Tooltip as TooltipComponent } from '@visactor/vrender-components';
4
4
  import type { TooltipHandlerParams } from '../../../../component/tooltip';
@@ -15,7 +15,7 @@ export declare class CanvasTooltipHandler extends BaseTooltipHandler {
15
15
  private _initTooltipComponent;
16
16
  private _getLayer;
17
17
  protected _removeTooltip(): void;
18
- protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: IToolTipActual): void;
18
+ protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: ITooltipActual): void;
19
19
  isTooltipShown(): boolean;
20
20
  release(): void;
21
21
  }
@@ -1,10 +1,10 @@
1
- import type { IToolTipLineActual } from '../../../typings';
1
+ import type { ITooltipLineActual } from '../../../typings';
2
2
  import { escapeHTML } from './utils/common';
3
3
  export declare const TOOLTIP_EL_CLASS_NAME = "vchart-tooltip-element";
4
4
  export declare const TOOLTIP_CONTAINER_EL_CLASS_NAME = "vchart-tooltip-container";
5
5
  export declare const TOOLTIP_MAX_LINE_COUNT = 20;
6
6
  export declare const TOOLTIP_EMPTY_STRING = "";
7
- export declare const TOOLTIP_OTHERS_LINE: IToolTipLineActual;
7
+ export declare const TOOLTIP_OTHERS_LINE: ITooltipLineActual;
8
8
  export declare const DEFAULT_OPTIONS: {
9
9
  offsetX: number;
10
10
  offsetY: number;
@@ -1,17 +1,19 @@
1
- import type { IToolTipActual } from '../../../../typings/tooltip';
1
+ import type { ITooltipActual, ITooltipPositionActual } from '../../../../typings/tooltip';
2
2
  import { BaseTooltipHandler } from '../base';
3
3
  import type { IDomTooltipStyle } from './interface';
4
4
  import { TooltipModel } from './model/tooltip-model';
5
- import type { Maybe } from '@visactor/vutils';
5
+ import { type Maybe } from '@visactor/vutils';
6
6
  import type { ITooltipSpec, TooltipHandlerParams } from '../../../../component/tooltip';
7
7
  import type { IComponentPluginService } from '../../interface';
8
+ import type { ILayoutPoint } from '../../../../typings';
8
9
  export declare class DomTooltipHandler extends BaseTooltipHandler {
9
10
  static readonly type: string;
10
11
  readonly type: string;
11
12
  protected _tooltipContainer: HTMLElement;
12
13
  protected _domStyle: IDomTooltipStyle;
13
- protected _tooltipActual?: IToolTipActual;
14
+ protected _tooltipActual?: ITooltipActual;
14
15
  protected _container: Maybe<HTMLDivElement>;
16
+ protected _cacheCustomTooltipPosition: ILayoutPoint;
15
17
  protected model: TooltipModel;
16
18
  getVisibility(): boolean;
17
19
  setVisibility(_value: boolean): void;
@@ -19,10 +21,12 @@ export declare class DomTooltipHandler extends BaseTooltipHandler {
19
21
  onAdd(service: IComponentPluginService<any>): void;
20
22
  initEl(): void;
21
23
  protected _removeTooltip(): void;
22
- protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: IToolTipActual): void;
24
+ protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: ITooltipActual): void;
23
25
  protected _initStyle(): void;
24
26
  protected _getParentElement(spec: ITooltipSpec): HTMLElement;
25
27
  isTooltipShown(): boolean;
26
28
  reInit(): void;
29
+ protected _updatePosition({ x, y }: ITooltipPositionActual): void;
30
+ protected _initEvent(el: HTMLElement): void;
27
31
  }
28
32
  export declare const registerDomTooltipHandler: () => void;
@@ -1,5 +1,5 @@
1
1
  import type { Maybe } from '@visactor/vutils';
2
- import type { IToolTipLineActual } from '../../../../../typings';
2
+ import type { ITooltipLineActual } from '../../../../../typings';
3
3
  import type { ITooltipModelOption } from './interface';
4
4
  export declare class BaseTooltipModel {
5
5
  static type: string;
@@ -9,7 +9,7 @@ export declare class BaseTooltipModel {
9
9
  readonly childIndex: number;
10
10
  protected _option: ITooltipModelOption;
11
11
  setOption(option: ITooltipModelOption): void;
12
- protected _renderContentCache: IToolTipLineActual[] | null;
12
+ protected _renderContentCache: ITooltipLineActual[] | null;
13
13
  children: Record<number, BaseTooltipModel>;
14
14
  product: Maybe<HTMLElement>;
15
15
  getParentEl(): HTMLElement;
@@ -1,7 +1,7 @@
1
1
  import { BaseTooltipModel } from './base-tooltip-model';
2
2
  import type { ITooltipModelOption } from './interface';
3
3
  import type { IShapeSvgOption } from './shape-model';
4
- import type { IToolTipLineActual } from '../../../../../typings';
4
+ import type { ITooltipLineActual } from '../../../../../typings';
5
5
  export type ContentColumnType = 'shape-box' | 'key-box' | 'value-box';
6
6
  export declare class ContentColumnModel extends BaseTooltipModel {
7
7
  readonly className: ContentColumnType;
@@ -19,5 +19,5 @@ export declare class ContentColumnModel extends BaseTooltipModel {
19
19
  common?: import("../interface").IShapeStyle;
20
20
  items?: import("../interface").IShapeStyle[];
21
21
  };
22
- protected _getShapeSvgOption(line: IToolTipLineActual, index: number): IShapeSvgOption;
22
+ protected _getShapeSvgOption(line: ITooltipLineActual, index: number): IShapeSvgOption;
23
23
  }
@@ -1,10 +1,10 @@
1
- import type { IToolTipActual, Maybe } from '../../../../../typings';
1
+ import type { ITooltipActual, Maybe } from '../../../../../typings';
2
2
  import type { IDomTooltipStyle } from '../interface';
3
3
  import type { ITooltipAttributes } from '../../interface';
4
4
  export interface ITooltipModelOption {
5
5
  valueToHtml: (value: any) => string;
6
6
  getTooltipStyle: () => IDomTooltipStyle;
7
- getTooltipActual: () => Maybe<IToolTipActual>;
7
+ getTooltipActual: () => Maybe<ITooltipActual>;
8
8
  getTooltipAttributes: () => Maybe<ITooltipAttributes>;
9
9
  getContainer: () => HTMLElement;
10
10
  }
@@ -1,8 +1,8 @@
1
1
  import type { TooltipPanelAttrs } from '@visactor/vrender-components';
2
- import type { IToolTipActual } from '../../../../typings';
2
+ import type { ITooltipActual } from '../../../../typings';
3
3
  import type { ITooltipAttributes, ITooltipTextStyle } from '../interface';
4
4
  import type { ITheme } from '../../../../theme';
5
5
  import type { ITooltipSpec, ITooltipTextTheme, ITooltipTheme } from '../../../../component/tooltip';
6
6
  export declare function getTextAttributes(style?: ITooltipTextTheme, globalTheme?: ITheme, defaultAttributes?: Partial<ITooltipTextStyle>): ITooltipTextStyle;
7
7
  export declare const getPanelAttributes: (style: ITooltipTheme['panel']) => TooltipPanelAttrs;
8
- export declare const getTooltipAttributes: (actualTooltip: IToolTipActual, spec: ITooltipSpec, globalTheme: ITheme) => ITooltipAttributes;
8
+ export declare const getTooltipAttributes: (actualTooltip: ITooltipActual, spec: ITooltipSpec, globalTheme: ITheme) => ITooltipAttributes;
@@ -1,12 +1,12 @@
1
1
  import type { Datum } from '@visactor/vgrammar-core';
2
- import type { IToolTipLinePattern, ITooltipPattern, MaybeArray, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../../typings';
2
+ import type { ITooltipLinePattern, ITooltipPattern, MaybeArray, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../../typings';
3
3
  import type { ITooltipTextStyle } from '../interface/style';
4
4
  import type { TooltipRichTextAttrs } from '@visactor/vrender-components';
5
5
  import type { TooltipHandlerParams } from '../../../../component/tooltip';
6
6
  export declare function escapeHTML(value: any): string;
7
- export declare const getTooltipContentValue: <T>(field?: TooltipContentProperty<T>, datum?: any, params?: TooltipHandlerParams) => T;
7
+ export declare const getTooltipContentValue: <T>(field?: TooltipContentProperty<T>, datum?: any, params?: TooltipHandlerParams, formatter?: string) => T;
8
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;
9
+ export declare const getTooltipContentPattern: (field?: ITooltipPattern['content'], data?: TooltipData, params?: TooltipHandlerParams) => Array<ITooltipLinePattern> | undefined;
10
10
  export declare function getFirstDatumFromTooltipData(data: TooltipData): Datum;
11
11
  export declare function pickFirstValidValue<T>(isValid: (element?: T) => any, ...elements: T[]): T | undefined;
12
12
  export declare function convertToColorString(color: any, defaultColor?: string): string;
@@ -1,4 +1,4 @@
1
- import type { IToolTipLinePattern, ITooltipPattern, TooltipData, IToolTipLineActual } from '../../../../typings/tooltip';
1
+ import type { ITooltipLinePattern, ITooltipPattern, TooltipData, ITooltipLineActual } from '../../../../typings/tooltip';
2
2
  import type { TooltipActualTitleContent, TooltipHandlerParams } from '../../../../component/tooltip';
3
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;
4
+ export declare const getOneLineData: (datum: any, config: ITooltipLinePattern, params: TooltipHandlerParams) => ITooltipLineActual;
@@ -1,7 +1,22 @@
1
- import type { TooltipFixedPosition } from '../../../../typings/tooltip/position';
1
+ import type { IDimensionInfo } from '../../../../event';
2
+ import type { ICartesianSeries } from '../../../../series';
3
+ import type { ILayoutPoint } from '../../../../typings';
4
+ import type { IFixedTooltipPositionPattern, IGlobalTooltipPositionPattern, TooltipFixedPosition } from '../../../../typings/tooltip/position';
2
5
  export declare const getActualTooltipPositionValue: (position: number | ((event: MouseEvent) => number), event: MouseEvent) => number;
3
- export type TooltipHorizontalPositionType = 'left' | 'right' | 'middle';
4
- export type TooltipVerticalPositionType = 'top' | 'bottom' | 'middle';
6
+ export type TooltipHorizontalPositionType = 'left' | 'right' | 'center' | 'centerLeft' | 'centerRight';
7
+ export type TooltipVerticalPositionType = 'top' | 'bottom' | 'center' | 'centerTop' | 'centerBottom';
5
8
  export declare const positionType: Record<TooltipFixedPosition, [TooltipHorizontalPositionType, TooltipVerticalPositionType]>;
6
9
  export declare const getHorizontalPositionType: (position: TooltipFixedPosition, defaultCase?: TooltipHorizontalPositionType) => TooltipHorizontalPositionType;
7
10
  export declare const getVerticalPositionType: (position: TooltipFixedPosition, defaultCase?: TooltipVerticalPositionType) => TooltipVerticalPositionType;
11
+ export declare const getCartesianCrosshairRect: (dimensionInfo: IDimensionInfo[], series: ICartesianSeries, layoutStartPoint: ILayoutPoint) => {
12
+ start: {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ end: {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ };
21
+ export declare const isGlobalTooltipPositionPattern: (obj: any) => obj is IGlobalTooltipPositionPattern;
22
+ export declare const isFixedTooltipPositionPattern: (obj: any) => obj is IFixedTooltipPositionPattern;
@@ -1 +1,2 @@
1
1
  export * from './chart';
2
+ export * from './components';
@@ -1,5 +1,5 @@
1
1
  import type { TooltipHandlerParams } from '../../component/tooltip/interface';
2
- import type { IToolTipLinePattern, ITooltipPattern, ShapeType, TooltipActiveType } from '../../typings';
2
+ import type { ITooltipLinePattern, ITooltipPattern, ShapeType, TooltipActiveType } from '../../typings';
3
3
  import type { ISeries, ISeriesTooltipHelper } from '../interface';
4
4
  import { BaseTooltipHelper } from '../../model/tooltip-helper';
5
5
  import type { IDimensionInfo } from '../../event/events/dimension/interface';
@@ -26,6 +26,6 @@ export declare class BaseSeriesTooltipHelper extends BaseTooltipHelper implement
26
26
  titleValueCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
27
27
  getDefaultTooltipPattern(activeType: TooltipActiveType, dimensionInfo?: IDimensionInfo[]): ITooltipPattern | null;
28
28
  }
29
- export declare const addExtraInfoToTooltipTitlePattern: <T>(pattern: ITooltipPattern['title'], extraInfo: T | ((line: IToolTipLinePattern) => T), overwrite?: boolean) => ITooltipPattern['title'] | undefined;
30
- export declare const addExtraInfoToTooltipContentPattern: <T>(pattern: ITooltipPattern['content'], extraInfo: T | ((line: IToolTipLinePattern) => T), overwrite?: boolean) => ITooltipPattern['content'] | undefined;
29
+ export declare const addExtraInfoToTooltipTitlePattern: <T>(pattern: ITooltipPattern['title'], extraInfo: T | ((line: ITooltipLinePattern) => T), overwrite?: boolean) => ITooltipPattern['title'] | undefined;
30
+ export declare const addExtraInfoToTooltipContentPattern: <T>(pattern: ITooltipPattern['content'], extraInfo: T | ((line: ITooltipLinePattern) => T), overwrite?: boolean) => ITooltipPattern['content'] | undefined;
31
31
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { IMarkSpec, IMarkTheme } from '../../typings/spec';
2
- import type { IArcMarkSpec, IPathMarkSpec, IProgressArcMarkSpec, IRectMarkSpec } from '../../typings/visual';
2
+ import type { IArcMarkSpec, IPathMarkSpec, IRectMarkSpec } from '../../typings/visual';
3
3
  import type { IProgressLikeSeriesSpec, IProgressLikeSeriesTheme } from '../polar/progress-like/interface';
4
4
  import type { IAnimationSpec } from '../../animation/spec';
5
5
  import type { ProgressLikeAppearPreset } from '../polar/progress-like';
@@ -37,13 +37,13 @@ export type GaugeMarks = 'segment' | 'track';
37
37
  export interface IGaugeSeriesSpec extends IProgressLikeSeriesSpec, IAnimationSpec<GaugeMarks, ProgressLikeAppearPreset> {
38
38
  type: 'gauge';
39
39
  padAngle?: number;
40
- [SeriesMarkNameEnum.segment]?: IMarkSpec<IProgressArcMarkSpec>;
40
+ [SeriesMarkNameEnum.segment]?: IMarkSpec<IArcMarkSpec>;
41
41
  [SeriesMarkNameEnum.track]?: IMarkSpec<IArcMarkSpec>;
42
42
  [SeriesMarkNameEnum.label]?: IGaugeLabelSpec;
43
43
  }
44
44
  export interface IGaugeSeriesTheme extends IProgressLikeSeriesTheme {
45
45
  padAngle?: number;
46
- [SeriesMarkNameEnum.segment]?: Partial<IMarkTheme<IProgressArcMarkSpec>>;
46
+ [SeriesMarkNameEnum.segment]?: Partial<IMarkTheme<IArcMarkSpec>>;
47
47
  [SeriesMarkNameEnum.track]?: Partial<IMarkTheme<IArcMarkSpec>>;
48
48
  [SeriesMarkNameEnum.label]?: IGaugeLabelSpec;
49
49
  }
@@ -58,7 +58,7 @@ export interface ISeriesMarkInitOption {
58
58
  parent?: IGroupMark | false;
59
59
  isSeriesMark?: boolean;
60
60
  depend?: IGrammarItem | IGrammarItem[];
61
- key?: string;
61
+ key?: string | ((datum: any) => string);
62
62
  groupKey?: string;
63
63
  morph?: boolean;
64
64
  defaultMorphElementKey?: string;