@visactor/vchart-types 1.8.10-alpha.0 → 1.9.0-alpha.1

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 (115) hide show
  1. package/package.json +1 -1
  2. package/tsconfig.tsbuildinfo +1 -1
  3. package/types/chart/base/base-chart-transformer.d.ts +1 -0
  4. package/types/chart/base/base-chart.d.ts +1 -0
  5. package/types/chart/base/util.d.ts +7 -0
  6. package/types/chart/index.d.ts +5 -3
  7. package/types/chart/interface/chart.d.ts +1 -0
  8. package/types/chart/interface/common.d.ts +1 -4
  9. package/types/chart/interface/type.d.ts +2 -1
  10. package/types/chart/liquid/index.d.ts +2 -0
  11. package/types/chart/liquid/interface.d.ts +7 -0
  12. package/types/chart/liquid/liquid-transformer.d.ts +6 -0
  13. package/types/chart/liquid/liquid.d.ts +13 -0
  14. package/types/compile/compiler.d.ts +16 -5
  15. package/types/compile/data/compilable-data.d.ts +1 -1
  16. package/types/compile/data/interface.d.ts +1 -1
  17. package/types/compile/mark/compilable-mark.d.ts +4 -2
  18. package/types/compile/mark/interface.d.ts +3 -2
  19. package/types/compile/mark/mark-state-manager.d.ts +2 -2
  20. package/types/compile/signal/state-manager.d.ts +1 -1
  21. package/types/component/axis/base-axis.d.ts +8 -9
  22. package/types/component/axis/cartesian/axis.d.ts +5 -11
  23. package/types/component/axis/cartesian/band-axis.d.ts +1 -0
  24. package/types/component/axis/cartesian/interface/common.d.ts +3 -5
  25. package/types/component/axis/cartesian/interface/spec.d.ts +4 -19
  26. package/types/component/axis/interface/common.d.ts +10 -0
  27. package/types/component/axis/interface/spec.d.ts +4 -7
  28. package/types/component/axis/mixin/band-axis-mixin.d.ts +13 -1
  29. package/types/component/axis/polar/axis.d.ts +7 -3
  30. package/types/component/axis/polar/band-axis.d.ts +1 -0
  31. package/types/component/axis/util.d.ts +6 -0
  32. package/types/component/base/base-component.d.ts +0 -5
  33. package/types/component/crosshair/base.d.ts +10 -2
  34. package/types/component/crosshair/cartesian.d.ts +5 -0
  35. package/types/component/crosshair/config.d.ts +1 -2
  36. package/types/component/crosshair/interface/spec.d.ts +2 -1
  37. package/types/component/indicator/indicator.d.ts +2 -0
  38. package/types/component/indicator/interface.d.ts +1 -0
  39. package/types/component/interface/common.d.ts +1 -0
  40. package/types/component/label/base-label.d.ts +0 -3
  41. package/types/component/label/interface.d.ts +1 -0
  42. package/types/component/legend/base-legend.d.ts +1 -1
  43. package/types/component/legend/util.d.ts +1 -1
  44. package/types/core/factory.d.ts +5 -0
  45. package/types/core/vchart.d.ts +7 -3
  46. package/types/event/events/dimension/util/cartesian.d.ts +1 -1
  47. package/types/interaction/interface.d.ts +24 -2
  48. package/types/layout/interface.d.ts +3 -0
  49. package/types/layout/layout-item.d.ts +2 -1
  50. package/types/mark/interface/type.d.ts +1 -0
  51. package/types/mark/liquid.d.ts +13 -0
  52. package/types/model/base-model.d.ts +1 -2
  53. package/types/model/interface.d.ts +3 -2
  54. package/types/plugin/components/axis-sync/axis-sync.d.ts +13 -0
  55. package/types/plugin/components/axis-sync/index.d.ts +1 -0
  56. package/types/plugin/components/axis-sync/tick-align-transform.d.ts +7 -0
  57. package/types/plugin/components/axis-sync/zero-align-transform.d.ts +15 -0
  58. package/types/plugin/components/index.d.ts +1 -1
  59. package/types/plugin/components/register.d.ts +2 -0
  60. package/types/plugin/components/tooltip-handler/base.d.ts +65 -0
  61. package/types/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.d.ts +22 -0
  62. package/types/plugin/components/tooltip-handler/canvas/index.d.ts +1 -0
  63. package/types/plugin/components/tooltip-handler/constants.d.ts +17 -0
  64. package/types/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +28 -0
  65. package/types/plugin/components/tooltip-handler/dom/index.d.ts +1 -0
  66. package/types/plugin/components/tooltip-handler/dom/interface.d.ts +57 -0
  67. package/types/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +25 -0
  68. package/types/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +23 -0
  69. package/types/plugin/components/tooltip-handler/dom/model/content-model.d.ts +15 -0
  70. package/types/plugin/components/tooltip-handler/dom/model/interface.d.ts +9 -0
  71. package/types/plugin/components/tooltip-handler/dom/model/shape-model.d.ts +23 -0
  72. package/types/plugin/components/tooltip-handler/dom/model/style-constants.d.ts +8 -0
  73. package/types/plugin/components/tooltip-handler/dom/model/text-model.d.ts +5 -0
  74. package/types/plugin/components/tooltip-handler/dom/model/title-model.d.ts +15 -0
  75. package/types/plugin/components/tooltip-handler/dom/model/tooltip-model.d.ts +21 -0
  76. package/types/plugin/components/tooltip-handler/dom/util.d.ts +6 -0
  77. package/types/plugin/components/tooltip-handler/index.d.ts +2 -0
  78. package/types/plugin/components/tooltip-handler/interface/common.d.ts +4 -0
  79. package/types/plugin/components/tooltip-handler/interface/index.d.ts +2 -0
  80. package/types/plugin/components/tooltip-handler/interface/style.d.ts +8 -0
  81. package/types/plugin/components/tooltip-handler/utils/attribute.d.ts +8 -0
  82. package/types/plugin/components/tooltip-handler/utils/common.d.ts +19 -0
  83. package/types/plugin/components/tooltip-handler/utils/compose.d.ts +4 -0
  84. package/types/plugin/components/tooltip-handler/utils/get-spec.d.ts +5 -0
  85. package/types/plugin/components/tooltip-handler/utils/index.d.ts +6 -0
  86. package/types/plugin/components/tooltip-handler/utils/pattern.d.ts +4 -0
  87. package/types/plugin/components/tooltip-handler/utils/position.d.ts +7 -0
  88. package/types/region/interface.d.ts +0 -3
  89. package/types/series/bar/bar.d.ts +12 -3
  90. package/types/series/bar/interface.d.ts +5 -2
  91. package/types/series/base/base-series.d.ts +30 -5
  92. package/types/series/cartesian/cartesian.d.ts +6 -0
  93. package/types/series/gauge/gauge-pointer.d.ts +1 -0
  94. package/types/series/heatmap/heatmap.d.ts +1 -0
  95. package/types/series/interface/common.d.ts +1 -1
  96. package/types/series/interface/series.d.ts +0 -2
  97. package/types/series/interface/theme.d.ts +2 -0
  98. package/types/series/interface/type.d.ts +6 -2
  99. package/types/series/link/link.d.ts +1 -0
  100. package/types/series/liquid/animation.d.ts +14 -0
  101. package/types/series/liquid/constant.d.ts +2 -0
  102. package/types/series/liquid/interface.d.ts +35 -0
  103. package/types/series/liquid/liquid.d.ts +50 -0
  104. package/types/series/liquid/tooltip-helper.d.ts +9 -0
  105. package/types/series/liquid/util.d.ts +2 -0
  106. package/types/series/mixin/line-mixin.d.ts +0 -2
  107. package/types/series/pie/pie.d.ts +1 -0
  108. package/types/series/progress/circular/circular.d.ts +1 -0
  109. package/types/series/progress/linear/linear.d.ts +1 -0
  110. package/types/series/word-cloud/base.d.ts +5 -5
  111. package/types/theme/builtin/common/series/liquid.d.ts +2 -0
  112. package/types/typings/layout.d.ts +1 -0
  113. package/types/typings/spec/common.d.ts +3 -2
  114. package/types/typings/tooltip/line.d.ts +4 -0
  115. package/types/typings/visual.d.ts +6 -0
@@ -39,7 +39,10 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
39
39
  trigger: CrossHairTrigger;
40
40
  enable: boolean;
41
41
  showDefault: boolean;
42
- triggerOff: CrossHairTrigger | 'none';
42
+ triggerOff: 'none' | number;
43
+ private _timer?;
44
+ private _clickLock?;
45
+ private _hasActive?;
43
46
  get enableRemain(): boolean;
44
47
  private _limitBounds;
45
48
  constructor(spec: T, options: IComponentOption);
@@ -62,7 +65,10 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
62
65
  private _registerEvent;
63
66
  private _eventOff;
64
67
  updateLayoutAttribute(): void;
65
- private _handleEvent;
68
+ private _handleIn;
69
+ private _handleClickInEvent;
70
+ private _handleHoverInEvent;
71
+ private _handleOutEvent;
66
72
  private _getTriggerEvent;
67
73
  protected _getAxisInfoByField<T = IAxis>(field: 'x' | 'y' | 'category' | 'value'): IAxisInfo<T>;
68
74
  changeRegions(regions: IRegion[]): void;
@@ -73,4 +79,6 @@ export declare abstract class BaseCrossHair<T extends ICartesianCrosshairSpec |
73
79
  protected _parseCrosshairSpec(): void;
74
80
  protected _parseField(field: ICrosshairCategoryFieldSpec, fieldName: string): any;
75
81
  protected _filterAxisByPoint<T>(axisMap: IAxisInfo<T>, relativeX: number, relativeY: number): IAxisInfo<T>;
82
+ protected clearEvent(): void;
83
+ clear(): void;
76
84
  }
@@ -2,6 +2,7 @@ import type { Maybe } from '@visactor/vutils';
2
2
  import type { IComponentOption } from '../interface';
3
3
  import { ComponentTypeEnum } from '../interface/type';
4
4
  import type { ICartesianCrosshairSpec } from './interface';
5
+ import type { IBound } from './base';
5
6
  import { BaseCrossHair } from './base';
6
7
  import type { IGraphic } from '@visactor/vrender-core';
7
8
  import type { IAxis } from '../axis/interface';
@@ -35,6 +36,10 @@ export declare class CartesianCrossHair<T extends ICartesianCrosshairSpec = ICar
35
36
  private _getAllAxisValues;
36
37
  protected _layoutCrosshair(relativeX: number, relativeY: number): void;
37
38
  hide(): void;
39
+ _setRegionArea(outRegion: IBound, currentValue: Map<number, {
40
+ v: StringOrNumber;
41
+ axis: IAxis;
42
+ }>): void;
38
43
  layoutByValue(tag?: number): void;
39
44
  private _layoutVertical;
40
45
  private _layoutHorizontal;
@@ -13,6 +13,5 @@ export declare function getDefaultCrosshairTriggerEventByMode(mode: RenderMode):
13
13
  export declare enum LayoutType {
14
14
  ALL = 3,
15
15
  HORIZONTAL = 2,
16
- VERTICAL = 1,
17
- NONE = 0
16
+ VERTICAL = 1
18
17
  }
@@ -11,7 +11,8 @@ export interface ICrossHair extends IComponent {
11
11
  export type CrossHairTrigger = 'click' | 'hover' | ['click', 'hover'];
12
12
  export interface ICommonCrosshairSpec extends IComponentSpec {
13
13
  trigger?: CrossHairTrigger;
14
- triggerOff?: CrossHairTrigger | 'none';
14
+ triggerOff?: CrossHairTrigger | 'none' | number;
15
+ lockAfterClick?: boolean;
15
16
  labelZIndex?: number;
16
17
  gridZIndex?: number;
17
18
  }
@@ -4,6 +4,7 @@ import type { IRegion } from '../../region/interface';
4
4
  import type { IIndicator, IIndicatorSpec } from './interface';
5
5
  import type { Maybe } from '../../typings';
6
6
  import type { IModelSpecInfo } from '../../model/interface';
7
+ import { Indicator as IndicatorComponents } from '@visactor/vrender-components';
7
8
  import type { IGraphic } from '@visactor/vrender-core';
8
9
  export declare class Indicator<T extends IIndicatorSpec> extends BaseComponent<T> implements IIndicator {
9
10
  static type: ComponentTypeEnum;
@@ -37,5 +38,6 @@ export declare class Indicator<T extends IIndicatorSpec> extends BaseComponent<T
37
38
  private isRelativeModel;
38
39
  protected _getNeedClearVRenderComponents(): IGraphic[];
39
40
  clear(): void;
41
+ getIndicatorComponent(): IndicatorComponents;
40
42
  }
41
43
  export declare const registerIndicator: () => void;
@@ -10,6 +10,7 @@ export interface IIndicatorItemSpec {
10
10
  autoLimit?: boolean;
11
11
  autoFit?: boolean;
12
12
  fitPercent?: number;
13
+ fitStrategy?: 'default' | 'inscribed';
13
14
  style?: Omit<ConvertToMarkStyleSpec<ITextMarkSpec>, 'visible' | 'text'> & {
14
15
  type?: 'text' | 'rich' | 'html';
15
16
  text?: string | string[] | number | number[] | IRichTextCharacter[];
@@ -19,6 +19,7 @@ export interface IComponentOption extends IModelOption {
19
19
  getComponentByIndex: (key: string, index: number) => IComponent | undefined;
20
20
  getComponentByUserId: (userId: StringOrNumber) => IComponent | undefined;
21
21
  getComponentsByKey: (key: string) => IComponent[];
22
+ getComponentsByType: (type: string) => IComponent[];
22
23
  }
23
24
  export interface IComponent extends ILayoutModel {
24
25
  readonly name: string;
@@ -21,9 +21,6 @@ export declare abstract class BaseLabelComponent<T = any> extends BaseComponent<
21
21
  selected?: Partial<import("../..").ITextMarkSpec>;
22
22
  selected_reverse?: Partial<import("../..").ITextMarkSpec>;
23
23
  };
24
- } | {
25
- hover: boolean;
26
- select: boolean;
27
24
  };
28
25
  _compareSpec(spec: T, prevSpec: T): {
29
26
  change: boolean;
@@ -26,6 +26,7 @@ export interface ILabelSpec extends IComponentSpec {
26
26
  labelLayout?: 'series' | 'region';
27
27
  centerOffset?: number;
28
28
  support3d?: boolean;
29
+ syncState?: boolean;
29
30
  }
30
31
  type LabelStateStyle<T> = {
31
32
  hover?: T;
@@ -17,7 +17,7 @@ export declare abstract class BaseLegend<T extends ILegendCommonSpec> extends Ba
17
17
  protected _visible: boolean;
18
18
  get visible(): boolean;
19
19
  protected _position: 'start' | 'middle' | 'end';
20
- get position(): "middle" | "start" | "end";
20
+ get position(): "start" | "end" | "middle";
21
21
  protected _legendData: CompilableData;
22
22
  getLegendData(): any;
23
23
  private _preSelectedData;
@@ -21,6 +21,6 @@ export declare function transformLegendTitleAttributes(title: ITitle): {
21
21
  maxWidth?: number;
22
22
  minWidth?: number;
23
23
  space?: number;
24
- align?: "center" | "start" | "end";
24
+ align?: "start" | "end" | "center";
25
25
  };
26
26
  export declare function getLayout(spec: ILegendCommonSpec): "vertical" | "horizontal";
@@ -8,6 +8,7 @@ import type { Transform, Parser } from '@visactor/vdataset';
8
8
  import type { ILayoutConstructor } from '../layout/interface';
9
9
  import type { MarkAnimationSpec } from '@visactor/vgrammar-core';
10
10
  import type { IChartPluginConstructor } from '../plugin/chart/interface';
11
+ import type { IComponentPluginConstructor } from '../plugin/components/interface';
11
12
  export declare class Factory {
12
13
  private static _charts;
13
14
  private static _series;
@@ -17,6 +18,7 @@ export declare class Factory {
17
18
  private static _animations;
18
19
  private static _implements;
19
20
  private static _chartPlugin;
21
+ private static _componentPlugin;
20
22
  static transforms: {
21
23
  [key: string]: Transform;
22
24
  };
@@ -36,6 +38,7 @@ export declare class Factory {
36
38
  static registerAnimation(key: string, animation: (params?: any, preset?: any) => MarkAnimationSpec): void;
37
39
  static registerImplement(key: string, implement: (...args: any) => void): void;
38
40
  static registerChartPlugin(key: string, plugin: IChartPluginConstructor): void;
41
+ static registerComponentPlugin(key: string, plugin: IComponentPluginConstructor): void;
39
42
  static createChart(chartType: string, spec: any, options: IChartOption): IChart | null;
40
43
  static createChartSpecTransformer(chartType: string, option: IChartSpecTransformerOption): IChartSpecTransformer | null;
41
44
  static createRegion(regionType: string, spec: any, options: IModelOption): IRegion | null;
@@ -57,4 +60,6 @@ export declare class Factory {
57
60
  static getImplementInKey(key: string): (...args: any) => void;
58
61
  static getSeriesMarkMap(seriesType: string): Partial<Record<SeriesMarkNameEnum, ISeriesMarkInfo>>;
59
62
  static getChartPlugins(): IChartPluginConstructor[];
63
+ static getComponentPlugins(): IComponentPluginConstructor[];
64
+ static getComponentPluginInType(type: string): IComponentPluginConstructor;
60
65
  }
@@ -6,8 +6,8 @@ import type { DimensionIndexOption, IChart, IChartConstructor, IChartSpecInfo }
6
6
  import type { IComponentConstructor } from '../component/interface';
7
7
  import type { EventCallback, EventParams, EventQuery, EventType } from '../event/interface';
8
8
  import type { IParserOptions } from '@visactor/vdataset/es/parser';
9
- import type { Transform } from '@visactor/vdataset';
10
- import { DataSet, DataView } from '@visactor/vdataset';
9
+ import type { Transform, DataView } from '@visactor/vdataset';
10
+ import { DataSet } from '@visactor/vdataset';
11
11
  import type { Stage } from '@visactor/vrender-core';
12
12
  import type { GeoSourceType } from '../typings/geo';
13
13
  import type { GeoSourceOption } from '../series/map/geo-source';
@@ -102,12 +102,13 @@ export declare class VChart implements IVChart {
102
102
  private _updateAnimateState;
103
103
  release(): void;
104
104
  updateData(id: StringOrNumber, data: DataView | Datum[] | string, options?: IParserOptions): Promise<IVChart>;
105
+ private _updateDataById;
105
106
  updateDataInBatches(list: {
106
107
  id: string;
107
108
  data: Datum[];
108
109
  options?: IParserOptions;
109
110
  }[]): Promise<IVChart>;
110
- updateDataSync(id: StringOrNumber, data: DataView | Datum[], options?: IParserOptions): IVChart;
111
+ updateDataSync(id: StringOrNumber, data: DataView | Datum[] | string, options?: IParserOptions): IVChart;
111
112
  updateFullDataSync(data: IDataValues | IDataValues[], reRender?: boolean): IVChart;
112
113
  updateFullData(data: IDataValues | IDataValues[], reRender?: boolean): Promise<IVChart>;
113
114
  updateSpec(spec: ISpec, forceMerge?: boolean, morphConfig?: IMorphConfig): Promise<IVChart>;
@@ -124,6 +125,9 @@ export declare class VChart implements IVChart {
124
125
  } | ((model: IModel) => boolean), spec: unknown, forceMerge?: boolean, morphConfig?: IMorphConfig): IVChart;
125
126
  protected _updateModelSpec(model: IModel, spec: unknown, sync?: boolean, forceMerge?: boolean, morphConfig?: IMorphConfig): IVChart | Promise<IVChart>;
126
127
  resize(width: number, height: number): Promise<IVChart>;
128
+ resizeSync(width: number, height: number): IVChart;
129
+ protected _beforeResize(width: number, height: number): boolean;
130
+ protected _afterResize(): IVChart;
127
131
  updateViewBox(viewBox: IBoundsLike, reRender?: boolean, reLayout?: boolean): IVChart;
128
132
  on(eType: EventType, handler: EventCallback<EventParams>): void;
129
133
  on(eType: EventType, query: EventQuery, handler: EventCallback<EventParams>): void;
@@ -3,6 +3,6 @@ import type { IDimensionInfo } from '../interface';
3
3
  import type { CartesianAxis } from '../../../../component/axis/cartesian';
4
4
  import type { ICartesianSeries } from '../../../../series/interface';
5
5
  import type { ILayoutPoint } from '../../../../typings/layout';
6
- export declare const getCartesianDimensionInfo: (chart: IChart | undefined, pos: ILayoutPoint) => IDimensionInfo[] | null;
6
+ export declare const getCartesianDimensionInfo: (chart: IChart | undefined, pos: ILayoutPoint, isTooltip?: boolean) => IDimensionInfo[] | null;
7
7
  export declare const getDimensionInfoByPosition: (axis: CartesianAxis, posValue: number, posKey: 'x' | 'y', getDimensionField: (series: ICartesianSeries) => string | string[]) => IDimensionInfo | null;
8
8
  export declare const getDimensionInfoByValue: (axis: CartesianAxis, value: any, getDimensionField?: (series: ICartesianSeries) => string | string[]) => IDimensionInfo | null;
@@ -1,9 +1,10 @@
1
- import type { IElement } from '@visactor/vgrammar-core';
1
+ import type { ElementActiveByLegendSpec, ElementActiveSpec, ElementHighlightByGroupSpec, ElementHighlightByKeySpec, ElementHighlightByLegendSpec, ElementHighlightByNameSpec, ElementHighlightSpec, ElementSelectSpec, IElement } from '@visactor/vgrammar-core';
2
2
  import type { IMark } from '../mark/interface';
3
3
  import type { RenderMode } from '../typings/spec/common';
4
4
  import type { BaseEventParams, IEventDispatcher, EventType } from '../event/interface';
5
5
  import type { IModel } from '../model/interface';
6
6
  import type { StateValue } from '../compile/mark';
7
+ import type { StringOrNumber } from '../typings/common';
7
8
  export interface IInteraction {
8
9
  registerMark: (state: StateValue, mark: IMark) => void;
9
10
  filterEventMark: (params: BaseEventParams, state: StateValue) => boolean;
@@ -41,10 +42,31 @@ export type ISelectSpec = {
41
42
  enable?: boolean;
42
43
  mode?: 'single' | 'multiple';
43
44
  trigger?: Trigger;
44
- triggerOff?: Trigger;
45
+ triggerOff?: Trigger | number;
45
46
  };
46
47
  export interface ITriggerSpec {
47
48
  hover?: IHoverSpec | boolean;
48
49
  select?: ISelectSpec | boolean;
49
50
  }
51
+ interface IBaseInteractionSpec {
52
+ markIds?: StringOrNumber[];
53
+ markNames?: StringOrNumber[];
54
+ }
55
+ export type IElementActiveSpec = IBaseInteractionSpec & Pick<ElementActiveSpec, 'type' | 'trigger' | 'triggerOff' | 'state'>;
56
+ export type IElementSelectSpec = IBaseInteractionSpec & Pick<ElementSelectSpec, 'type' | 'trigger' | 'triggerOff' | 'state' | 'isMultiple' | 'reverseState'>;
57
+ export type IElementHighlightSpec = IBaseInteractionSpec & Pick<ElementHighlightSpec, 'type' | 'blurState' | 'highlightState' | 'triggerOff' | 'trigger'>;
58
+ export type IElementHighlightByKeySpec = IBaseInteractionSpec & Pick<ElementHighlightByKeySpec, 'type' | 'blurState' | 'highlightState' | 'triggerOff' | 'trigger'>;
59
+ export type IElementHighlightByGroup = IBaseInteractionSpec & Pick<ElementHighlightByGroupSpec, 'type' | 'blurState' | 'highlightState' | 'triggerOff' | 'trigger'>;
60
+ export type IElementActiveByLegend = IBaseInteractionSpec & Pick<ElementActiveByLegendSpec, 'type' | 'filterType' | 'state'>;
61
+ export type IElementHighlightByLegend = IBaseInteractionSpec & Pick<ElementHighlightByLegendSpec, 'type' | 'filterType' | 'blurState' | 'highlightState'>;
62
+ export type IElementHighlightByName = IBaseInteractionSpec & Pick<ElementHighlightByNameSpec, 'type' | 'blurState' | 'highlightState' | 'graphicName' | 'parseData'>;
63
+ export interface ICustomInteraction extends IBaseInteractionSpec {
64
+ type: string;
65
+ }
66
+ export type IInteractionItemSpec = IElementActiveSpec | IElementSelectSpec | IElementHighlightSpec | IElementHighlightByKeySpec | IElementHighlightByGroup | IElementActiveByLegend | IElementHighlightByLegend | IElementHighlightByName;
67
+ export interface IInteractionSpec {
68
+ hover?: IHoverSpec | boolean;
69
+ select?: ISelectSpec | boolean;
70
+ interactions?: IInteractionItemSpec[];
71
+ }
50
72
  export {};
@@ -52,6 +52,7 @@ export interface ILayoutItem {
52
52
  layoutBindRegionID: number | number[];
53
53
  layoutOrient: IOrientType;
54
54
  autoIndent: boolean;
55
+ alignSelf?: 'start' | 'end' | 'middle';
55
56
  layoutPaddingLeft: number;
56
57
  layoutPaddingTop: number;
57
58
  layoutPaddingRight: number;
@@ -85,8 +86,10 @@ export interface ILayoutItem {
85
86
  export interface ILayoutItemSpec {
86
87
  layoutType?: ILayoutType;
87
88
  layoutLevel?: number;
89
+ alignSelf?: 'start' | 'end' | 'middle';
88
90
  orient?: IOrientType;
89
91
  padding?: ILayoutPaddingSpec;
92
+ indent?: ILayoutPaddingSpec;
90
93
  noOuterPadding?: boolean;
91
94
  width?: ILayoutNumber;
92
95
  maxWidth?: ILayoutNumber;
@@ -3,7 +3,7 @@ import type { IRect, IPoint } from '../typings';
3
3
  import type { IBoundsLike } from '@visactor/vutils';
4
4
  import type { ILayoutItem, ILayoutItemInitOption, ILayoutItemSpec } from './interface';
5
5
  import type { IChartLayoutOption } from '../chart/interface/common';
6
- import type { ILayoutPoint, ILayoutRect } from '../typings/layout';
6
+ import type { ILayoutAlignSelf, ILayoutPoint, ILayoutRect } from '../typings/layout';
7
7
  export declare class LayoutItem implements ILayoutItem {
8
8
  protected _spec: ILayoutItemSpec;
9
9
  getSpec(): ILayoutItemSpec;
@@ -43,6 +43,7 @@ export declare class LayoutItem implements ILayoutItem {
43
43
  layoutOffsetY: ILayoutItem['layoutOffsetY'];
44
44
  layoutLevel: ILayoutItem['layoutLevel'];
45
45
  chartLayoutRect: ILayoutRect;
46
+ alignSelf: ILayoutAlignSelf;
46
47
  protected _model: ILayoutModel;
47
48
  get model(): ILayoutModel;
48
49
  get type(): string;
@@ -19,6 +19,7 @@ export declare enum MarkTypeEnum {
19
19
  progressArc = "progressArc",
20
20
  cell = "cell",
21
21
  ripple = "ripple",
22
+ liquid = "liquid",
22
23
  component = "component",
23
24
  label = "label"
24
25
  }
@@ -0,0 +1,13 @@
1
+ import type { ILiquidMarkSpec } from '../typings';
2
+ import type { IMarkStyle } from './interface';
3
+ import { MarkTypeEnum } from './interface/type';
4
+ import { BaseMark } from './base';
5
+ import type { ILiquidMark } from '../series/liquid/liquid';
6
+ import type { IGroupMark } from '@visactor/vgrammar-core';
7
+ export declare class LiquidMark extends BaseMark<ILiquidMarkSpec> implements ILiquidMark {
8
+ static readonly type = MarkTypeEnum.liquid;
9
+ readonly type = MarkTypeEnum.liquid;
10
+ protected _getDefaultStyle(): IMarkStyle<ILiquidMarkSpec>;
11
+ protected _initProduct(group?: string | IGroupMark): void;
12
+ }
13
+ export declare const registerLiquidMark: () => void;
@@ -25,8 +25,6 @@ export declare abstract class BaseModel<T extends IModelSpec> extends Compilable
25
25
  getData(): CompilableData;
26
26
  protected _layout?: ILayoutItem;
27
27
  get layout(): ILayoutItem;
28
- protected _specIndex: number;
29
- getSpecIndex(): number;
30
28
  readonly specKey: string;
31
29
  protected _option: IModelOption;
32
30
  getOption(): IModelOption;
@@ -79,4 +77,5 @@ export declare abstract class BaseModel<T extends IModelSpec> extends Compilable
79
77
  protected _getDataIdKey(): string | ((datum: Datum) => string) | undefined;
80
78
  getColorScheme(): import("..").IThemeColorScheme;
81
79
  getSpecInfo(): IModelSpecInfo<any>;
80
+ getSpecIndex(): number;
82
81
  }
@@ -100,7 +100,7 @@ export interface IModelOption extends ICompilableInitOption {
100
100
  map: Map<StringOrNumber, IModel | IMark>;
101
101
  mode: RenderMode;
102
102
  globalInstance: VChart;
103
- specIndex?: number;
103
+ regionIndexes?: Array<number>;
104
104
  specKey?: string;
105
105
  specPath?: Array<string | number>;
106
106
  specInfoPath?: Array<string | number>;
@@ -120,8 +120,9 @@ export interface IModelSpecInfo<T extends Record<string, unknown> = any> {
120
120
  spec: T;
121
121
  specPath?: Array<string | number>;
122
122
  specInfoPath?: Array<string | number>;
123
- specIndex?: number;
124
123
  theme?: any;
124
+ regionIndexes?: number[];
125
+ seriesIndexes?: number[];
125
126
  }
126
127
  export interface IModelConstructor {
127
128
  readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;
@@ -0,0 +1,13 @@
1
+ import type { IComponentPlugin, IComponentPluginService } from '../interface';
2
+ import type { CartesianAxis, ILinearAxisSync } from '../../../component/axis/cartesian';
3
+ import { BasePlugin } from '../../base/base-plugin';
4
+ export declare class AxisSyncPlugin extends BasePlugin<IComponentPluginService> implements IComponentPlugin<IComponentPluginService> {
5
+ static readonly pluginType: 'component';
6
+ static readonly type: string;
7
+ readonly type: string;
8
+ constructor();
9
+ protected _checkEnableSync(axis: CartesianAxis): ILinearAxisSync | false;
10
+ private _getTargetAxis;
11
+ onInit(service: IComponentPluginService, axis: CartesianAxis): void;
12
+ onDidCompile(service: IComponentPluginService, axis: CartesianAxis): void;
13
+ }
@@ -0,0 +1 @@
1
+ export * from './axis-sync';
@@ -0,0 +1,7 @@
1
+ import type { Datum } from '../../../typings';
2
+ import type { CartesianAxis } from '../../../component';
3
+ export interface ITickAlignOpt {
4
+ targetAxis: () => CartesianAxis;
5
+ currentAxis: () => CartesianAxis;
6
+ }
7
+ export declare const tickAlign: (data: Array<Datum>, op: ITickAlignOpt) => Datum[];
@@ -0,0 +1,15 @@
1
+ import type { CartesianAxis } from '../../../component';
2
+ import type { LinearAxisMixin } from '../../../component/axis/mixin/linear-axis-mixin';
3
+ type ScaleInfo = {
4
+ total: number;
5
+ negative: number;
6
+ positive: number;
7
+ includeZero: boolean;
8
+ extendable_min: boolean;
9
+ extendable_max: boolean;
10
+ domain: number[];
11
+ };
12
+ export declare function isValidAlignDomain(domain: number[]): boolean;
13
+ export declare function getScaleInfo(axis: LinearAxisMixin, domain: number[]): ScaleInfo;
14
+ export declare const zeroAlign: (targetAxis: CartesianAxis, currentAxis: CartesianAxis) => void;
15
+ export {};
@@ -1,4 +1,4 @@
1
- import { AxisSyncPlugin } from './axis-sync-plugin/';
1
+ import { AxisSyncPlugin } from './axis-sync';
2
2
  declare const _default: {
3
3
  AxisSyncPlugin: typeof AxisSyncPlugin;
4
4
  };
@@ -0,0 +1,2 @@
1
+ import type { IComponentPluginConstructor } from './interface';
2
+ export declare const registerComponentPlugin: (plugin: IComponentPluginConstructor) => void;
@@ -0,0 +1,65 @@
1
+ import type { Options } from './constants';
2
+ import type { Maybe, ILayoutPoint, RenderMode } from '../../../typings';
3
+ import type { TooltipData, IToolTipActual, TooltipActiveType, ITooltipHandler, ITooltipPattern, ITooltipPositionActual } from '../../../typings/tooltip';
4
+ import type { IGroup } from '@visactor/vrender-core';
5
+ import type { Compiler } from '../../../compile/compiler';
6
+ import type { IContainerSize, TooltipAttributes } from '@visactor/vrender-components';
7
+ import type { IChartOption } from '../../../chart/interface';
8
+ import type { ITooltipSpec, Tooltip, TooltipHandlerParams } from '../../../component/tooltip';
9
+ import { TooltipResult } from '../../../component/tooltip';
10
+ import type { IComponentPlugin, IComponentPluginService } from '../interface';
11
+ import { BasePlugin } from '../../base/base-plugin';
12
+ type ChangeTooltipFunc = (visible: boolean, params: TooltipHandlerParams, changePositionOnly?: boolean, activeType?: TooltipActiveType, data?: TooltipData) => TooltipResult;
13
+ type ChangeTooltipPositionFunc = (changePositionOnly: boolean, data: TooltipData, params: TooltipHandlerParams) => TooltipResult;
14
+ export declare abstract class BaseTooltipHandler extends BasePlugin implements ITooltipHandler, IComponentPlugin {
15
+ static readonly pluginType: 'component';
16
+ static readonly specKey = "tooltip";
17
+ readonly type: string;
18
+ protected _visible: boolean;
19
+ protected _option: Options;
20
+ protected _chartOption: IChartOption;
21
+ protected _env: RenderMode;
22
+ get env(): "desktop-browser" | "mobile-browser" | "node" | "worker" | "miniApp" | "wx" | "desktop-miniApp" | "lynx";
23
+ protected _component: Tooltip;
24
+ protected _attributes?: TooltipAttributes | null;
25
+ protected _chartContainer: Maybe<HTMLElement>;
26
+ protected _compiler: Compiler;
27
+ protected _cacheViewSpec: ITooltipSpec | undefined;
28
+ protected _cacheActualTooltip: IToolTipActual | undefined;
29
+ protected _isTooltipPaused: boolean;
30
+ protected _isPointerEscaped: boolean;
31
+ protected _cachePointerTimer: number;
32
+ protected _cachePointerPosition: ILayoutPoint;
33
+ protected _cacheTooltipPosition: ILayoutPoint;
34
+ protected _cacheTooltipSize: IContainerSize;
35
+ protected _container: Maybe<IGroup | HTMLElement>;
36
+ protected _isReleased: boolean;
37
+ onAdd(service: IComponentPluginService<any>): void;
38
+ showTooltip: (activeType: TooltipActiveType, data: TooltipData, params: TooltipHandlerParams) => TooltipResult;
39
+ protected changeTooltip: ChangeTooltipFunc;
40
+ protected _changeTooltip: ChangeTooltipFunc;
41
+ protected changeTooltipPosition: ChangeTooltipPositionFunc;
42
+ protected _changeTooltipPosition: ChangeTooltipPositionFunc;
43
+ hideTooltip(params: TooltipHandlerParams): TooltipResult;
44
+ release(): void;
45
+ protected _clearAllCache(): void;
46
+ protected _clearCacheOfContent(): void;
47
+ protected _clearCacheOfPosition(): void;
48
+ protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: IToolTipActual): void;
49
+ protected abstract _removeTooltip(): void;
50
+ protected _throttle(callback: any): (...args: unknown[]) => unknown;
51
+ protected _getDefaultOption(): Options;
52
+ protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => IToolTipActual;
53
+ protected _getActualTooltipPosition: (actualTooltip: IToolTipActual, params: TooltipHandlerParams, tooltipBoxSize: IContainerSize | undefined) => ITooltipPositionActual;
54
+ protected _getTooltipBoxSize(actualTooltip: IToolTipActual, changePositionOnly: boolean): IContainerSize | undefined;
55
+ protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams): {
56
+ x: any;
57
+ y: any;
58
+ };
59
+ protected _isPointerMovingToTooltip(params: TooltipHandlerParams): boolean;
60
+ protected _getParentElement(spec: ITooltipSpec): HTMLElement;
61
+ getTooltipContainer(): IGroup | HTMLElement;
62
+ protected _initFromSpec(): void;
63
+ reInit(): void;
64
+ }
65
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { IToolTipActual } from '../../../../typings/tooltip';
2
+ import { BaseTooltipHandler } from '../base';
3
+ import { Tooltip as TooltipComponent } from '@visactor/vrender-components';
4
+ import type { TooltipHandlerParams } from '../../../../component/tooltip';
5
+ import type { IComponentPluginService } from '../../interface';
6
+ export declare class CanvasTooltipHandler extends BaseTooltipHandler {
7
+ static readonly type: string;
8
+ readonly type: string;
9
+ private _layer;
10
+ protected _el?: HTMLCanvasElement;
11
+ protected _tooltipCanvasId?: string;
12
+ protected _tooltipComponent: TooltipComponent;
13
+ constructor();
14
+ onAdd(service: IComponentPluginService<any>): void;
15
+ private _initTooltipComponent;
16
+ private _getLayer;
17
+ protected _removeTooltip(): void;
18
+ protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: IToolTipActual): void;
19
+ isTooltipShown(): boolean;
20
+ release(): void;
21
+ }
22
+ export declare const registerCanvasTooltipHandler: () => void;
@@ -0,0 +1 @@
1
+ export * from './canvas-tooltip-handler';
@@ -0,0 +1,17 @@
1
+ import type { IToolTipLineActual } from '../../../typings';
2
+ import { escapeHTML } from './utils/common';
3
+ export declare const TOOLTIP_EL_CLASS_NAME = "vchart-tooltip-element";
4
+ export declare const TOOLTIP_CONTAINER_EL_CLASS_NAME = "vchart-tooltip-container";
5
+ export declare const TOOLTIP_MAX_LINE_COUNT = 20;
6
+ export declare const TOOLTIP_EMPTY_STRING = "";
7
+ export declare const TOOLTIP_OTHERS_LINE: IToolTipLineActual;
8
+ export declare const DEFAULT_OPTIONS: {
9
+ offsetX: number;
10
+ offsetY: number;
11
+ sanitize: typeof escapeHTML;
12
+ };
13
+ export type Options = typeof DEFAULT_OPTIONS;
14
+ export declare class TooltipHandlerType {
15
+ static dom: string;
16
+ static canvas: string;
17
+ }
@@ -0,0 +1,28 @@
1
+ import type { IToolTipActual } from '../../../../typings/tooltip';
2
+ import { BaseTooltipHandler } from '../base';
3
+ import type { IDomTooltipStyle } from './interface';
4
+ import { TooltipModel } from './model/tooltip-model';
5
+ import type { Maybe } from '@visactor/vutils';
6
+ import type { ITooltipSpec, TooltipHandlerParams } from '../../../../component/tooltip';
7
+ import type { IComponentPluginService } from '../../interface';
8
+ export declare class DomTooltipHandler extends BaseTooltipHandler {
9
+ static readonly type: string;
10
+ readonly type: string;
11
+ protected _tooltipContainer: HTMLElement;
12
+ protected _domStyle: IDomTooltipStyle;
13
+ protected _tooltipActual?: IToolTipActual;
14
+ protected _container: Maybe<HTMLDivElement>;
15
+ protected model: TooltipModel;
16
+ getVisibility(): boolean;
17
+ setVisibility(_value: boolean): void;
18
+ constructor();
19
+ onAdd(service: IComponentPluginService<any>): void;
20
+ initEl(): void;
21
+ protected _removeTooltip(): void;
22
+ protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: IToolTipActual): void;
23
+ protected _initStyle(): void;
24
+ protected _getParentElement(spec: ITooltipSpec): HTMLElement;
25
+ isTooltipShown(): boolean;
26
+ reInit(): void;
27
+ }
28
+ export declare const registerDomTooltipHandler: () => void;
@@ -0,0 +1 @@
1
+ export * from './dom-tooltip-handler';
@@ -0,0 +1,57 @@
1
+ import type { FontWeight, TextAlign } from '../../../../typings/visual';
2
+ export interface IDomTooltipStyle {
3
+ panel: IPadding & IBorder & {
4
+ width?: string;
5
+ height?: string;
6
+ minHeight?: string;
7
+ backgroundColor?: string;
8
+ boxShadow?: string;
9
+ pointerEvents?: 'auto' | 'none';
10
+ transitionDuration?: string;
11
+ transitionProperty?: string;
12
+ transitionTimingFunction?: string;
13
+ };
14
+ title: ILabelStyle;
15
+ content: IMargin;
16
+ shapeColumn: TooltipColumnStyle<IShapeStyle>;
17
+ keyColumn: TooltipColumnStyle<ILabelStyle>;
18
+ valueColumn: TooltipColumnStyle<ILabelStyle>;
19
+ }
20
+ export type TooltipColumnStyle<T> = IMargin & {
21
+ width?: string;
22
+ common?: T;
23
+ items?: T[];
24
+ };
25
+ export interface ILabelStyle extends IMargin {
26
+ fontFamily?: string;
27
+ fontSize?: string;
28
+ color?: string;
29
+ textAlign?: TextAlign;
30
+ lineHeight?: string;
31
+ fontWeight?: FontWeight;
32
+ whiteSpace?: string;
33
+ wordBreak?: string;
34
+ maxWidth?: string;
35
+ width?: string;
36
+ }
37
+ export interface IShapeStyle extends IMargin {
38
+ width?: string;
39
+ height?: string;
40
+ }
41
+ export interface IMargin {
42
+ marginLeft?: string;
43
+ marginRight?: string;
44
+ marginTop?: string;
45
+ marginBottom?: string;
46
+ }
47
+ export interface IPadding {
48
+ paddingTop?: string;
49
+ paddingRight?: string;
50
+ paddingBottom?: string;
51
+ paddingLeft?: string;
52
+ }
53
+ export interface IBorder {
54
+ borderColor?: string;
55
+ borderWidth?: string;
56
+ borderRadius?: string;
57
+ }