@visactor/vchart-types 1.7.0 → 1.7.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.
@@ -10,7 +10,7 @@ import type { ISeries } from '../../series/interface';
10
10
  import type { IChartEvaluateOption, IChartLayoutOption, IChartOption, IChartRenderOption, ILayoutParams } from './common';
11
11
  import type { IBoundsLike, IPadding } from '@visactor/vutils';
12
12
  import type { ICompilable } from '../../compile/interface';
13
- import type { IRegionQuerier, MaybeArray, Datum, IMarkStateSpec, StringOrNumber, IShowTooltipOption, IDataValues, ILayoutRect } from '../../typings';
13
+ import type { IRegionQuerier, MaybeArray, Datum, IMarkStateSpec, StringOrNumber, IShowTooltipOption, IDataValues, ILayoutRect, IData } from '../../typings';
14
14
  import type { DataView } from '@visactor/vdataset';
15
15
  export type DimensionIndexOption = {
16
16
  filter?: (cmp: IComponent) => boolean;
@@ -18,9 +18,15 @@ export type DimensionIndexOption = {
18
18
  showTooltipOption?: IShowTooltipOption;
19
19
  crosshair?: boolean;
20
20
  };
21
+ export interface IChartData {
22
+ parseData: (dataSpec: IData) => void;
23
+ updateData: (dataSpec: IData, fullUp?: boolean, forceMerge?: boolean) => boolean;
24
+ getSeriesData: (id: StringOrNumber | undefined, index: number | undefined) => DataView | undefined;
25
+ }
21
26
  export interface IChart extends ICompilable {
22
27
  padding: IPadding;
23
28
  readonly type: string;
29
+ readonly chartData: IChartData;
24
30
  getSpec: () => any;
25
31
  setSpec: (s: any) => void;
26
32
  reDataFlow: () => void;
@@ -11,7 +11,7 @@ export interface IAttributeParams {
11
11
  srView?: IView;
12
12
  group?: any;
13
13
  }
14
- export interface IChartOption extends Omit<IModelOption, 'getChartViewRect' | 'getChartLayoutRect' | 'globalScale' | 'getChart'> {
14
+ export interface IChartOption extends Omit<IModelOption, 'getChartViewRect' | 'getChartLayoutRect' | 'globalScale' | 'getChart' | 'getSeriesData'> {
15
15
  container: HTMLElement | null;
16
16
  canvas?: HTMLCanvasElement | OffscreenCanvas | string;
17
17
  modeParams?: IRenderOption['modeParams'];
@@ -1,5 +1,5 @@
1
1
  import type { Options } from './constants';
2
- import type { Maybe } from '../../../typings';
2
+ import type { Maybe, ILayoutPoint } from '../../../typings';
3
3
  import type { TooltipData, IToolTipActual, TooltipActiveType, ITooltipHandler, ITooltipPattern, ITooltipPositionActual } from '../../../typings/tooltip';
4
4
  import type { Tooltip } from '../tooltip';
5
5
  import type { ITooltipSpec, TooltipHandlerParams } from '../interface';
@@ -25,6 +25,12 @@ export declare abstract class BaseTooltipHandler implements ITooltipHandler {
25
25
  protected _compiler: Compiler;
26
26
  protected _cacheViewSpec: ITooltipSpec | undefined;
27
27
  protected _cacheActualTooltip: IToolTipActual | undefined;
28
+ protected _isTooltipPaused: boolean;
29
+ protected _isPointerEscaped: boolean;
30
+ protected _cachePointerTimer: number;
31
+ protected _cachePointerPosition: ILayoutPoint;
32
+ protected _cacheTooltipPosition: ILayoutPoint;
33
+ protected _cacheTooltipSize: IContainerSize;
28
34
  protected _container: Maybe<IGroup | HTMLElement>;
29
35
  protected _isReleased: boolean;
30
36
  constructor(tooltipId: string, component: Tooltip);
@@ -35,6 +41,9 @@ export declare abstract class BaseTooltipHandler implements ITooltipHandler {
35
41
  protected _changeTooltipPosition: ChangeTooltipPositionFunc;
36
42
  hideTooltip(params: TooltipHandlerParams): TooltipResult;
37
43
  release(): void;
44
+ protected _clearAllCache(): void;
45
+ protected _clearCacheOfContent(): void;
46
+ protected _clearCacheOfPosition(): void;
38
47
  protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: IToolTipActual): void;
39
48
  protected abstract _removeTooltip(): void;
40
49
  protected _throttle(callback: any): (...args: unknown[]) => unknown;
@@ -42,6 +51,11 @@ export declare abstract class BaseTooltipHandler implements ITooltipHandler {
42
51
  protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => IToolTipActual;
43
52
  protected _getActualTooltipPosition: (actualTooltip: IToolTipActual, params: TooltipHandlerParams, tooltipBoxSize: IContainerSize | undefined) => ITooltipPositionActual;
44
53
  protected _getTooltipBoxSize(actualTooltip: IToolTipActual, changePositionOnly: boolean): IContainerSize | undefined;
54
+ protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams): {
55
+ x: any;
56
+ y: any;
57
+ };
58
+ protected _isPointerMovingToTooltip(params: TooltipHandlerParams): boolean;
45
59
  protected _getParentElement(spec: ITooltipSpec): HTMLElement;
46
60
  getTooltipContainer(): IGroup | HTMLElement;
47
61
  protected _initFromSpec(): void;
@@ -1,5 +1,5 @@
1
1
  import type { IBoundsLike } from '@visactor/vutils';
2
- import type { DataSet } from '@visactor/vdataset';
2
+ import type { DataSet, DataView } from '@visactor/vdataset';
3
3
  import type { IEvent, IEventDispatcher } from '../event/interface';
4
4
  import type { IMark, IMarkRaw, IMarkStyle, MarkTypeEnum } from '../mark/interface';
5
5
  import type { RenderMode } from '../typings/spec/common';
@@ -100,6 +100,7 @@ export interface IModelOption extends ICompilableInitOption {
100
100
  getChartLayoutRect: () => IRect;
101
101
  getChartViewRect: () => ILayoutRect;
102
102
  getChart: () => IChart;
103
+ getSeriesData: (id: StringOrNumber | undefined, index: number | undefined) => DataView | undefined;
103
104
  globalScale: IGlobalScale;
104
105
  animation: boolean;
105
106
  onError: (...args: any[]) => void;
@@ -29,6 +29,7 @@ export declare class BasePieSeries<T extends IBasePieSeriesSpec> extends PolarSe
29
29
  protected _labelMark: ITextMark | null;
30
30
  protected _labelLineMark: IPathMark | null;
31
31
  protected _theme: Maybe<IPieSeriesTheme>;
32
+ protected _buildMarkAttributeContext(): void;
32
33
  setAttrFromSpec(): void;
33
34
  initData(): void;
34
35
  initMark(): void;
@@ -4,6 +4,7 @@ import type { IPoint } from '../typings/coordinate';
4
4
  import type { ILayoutNumber, ILayoutRect, IPercent, IPercentOffset, ILayoutPaddingSpec, ILayoutOrientPadding } from '../typings/layout';
5
5
  export declare function isValidOrient(orient: string): boolean;
6
6
  export declare function isPointInRect(point: IPoint, rect: IRect): boolean;
7
+ export declare function isPointInTriangle(point: IPoint, v1: IPoint, v2: IPoint, v3: IPoint): boolean;
7
8
  export declare function isPercent(v: any): v is IPercent;
8
9
  export declare function isPercentOffset(v: any): v is IPercentOffset;
9
10
  export declare function calcLayoutNumber(v: ILayoutNumber | undefined, size: number, callOp?: ILayoutRect): number;