@visactor/vchart-types 2.0.10-alpha.1 → 2.0.11-alpha.0
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 +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/types/chart/base/base-chart.d.ts +2 -0
- package/types/chart/interface/chart.d.ts +2 -0
- package/types/chart/interface/common.d.ts +5 -1
- package/types/core/vchart.d.ts +2 -0
- package/types/model/interface.d.ts +4 -0
- package/types/typings/spec/common.d.ts +5 -0
|
@@ -15,6 +15,7 @@ import type { IParserOptions } from '@visactor/vdataset';
|
|
|
15
15
|
import type { IBoundsLike, Maybe } from '@visactor/vutils';
|
|
16
16
|
import { CompilableBase } from '../../compile/compilable-base';
|
|
17
17
|
import type { IGlobalScale } from '../../scale/interface';
|
|
18
|
+
import type { IAxis } from '../../component/axis/interface/common';
|
|
18
19
|
import type { IMorphConfig } from '../../animation/spec';
|
|
19
20
|
import type { IInteraction } from '../../interaction/interface/common';
|
|
20
21
|
export declare class BaseChart<T extends IChartSpec> extends CompilableBase implements IChart {
|
|
@@ -161,5 +162,6 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
161
162
|
}): IMarkGraphic[];
|
|
162
163
|
protected _setStateInDatum(stateKey: string, d: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
163
164
|
setDimensionIndex(value: StringOrNumber, opt: DimensionIndexOption): void;
|
|
165
|
+
showCrosshair(cb: (axis: IAxis) => false | string | number): void;
|
|
164
166
|
getColorScheme(): any;
|
|
165
167
|
}
|
|
@@ -14,6 +14,7 @@ import type { DataView } from '@visactor/vdataset';
|
|
|
14
14
|
import type { IGlobalScale } from '../../scale/interface';
|
|
15
15
|
import type { IMorphConfig } from '../../animation/spec';
|
|
16
16
|
import type { IMarkGraphic } from '../../mark/interface/common';
|
|
17
|
+
import type { IAxis } from '../../component/axis/interface';
|
|
17
18
|
export type DimensionIndexOption = {
|
|
18
19
|
filter?: (cmp: IComponent) => boolean;
|
|
19
20
|
tooltip?: boolean;
|
|
@@ -95,6 +96,7 @@ export interface IChart extends ICompilable {
|
|
|
95
96
|
setCurrentTheme: () => void;
|
|
96
97
|
getSeriesData: (id: StringOrNumber | undefined, index: number | undefined) => DataView | undefined;
|
|
97
98
|
setDimensionIndex: (value: StringOrNumber, opt: DimensionIndexOption) => void;
|
|
99
|
+
showCrosshair: (cb: (axis: IAxis) => false | string | number) => void;
|
|
98
100
|
filterGraphicsByDatum: (datum: MaybeArray<Datum> | null, opt?: {
|
|
99
101
|
filter?: (series: ISeries, mark: IMark) => boolean;
|
|
100
102
|
region?: IRegionQuerier;
|
|
@@ -4,7 +4,7 @@ import type { IModelOption, IModelSpecInfo } from '../../model/interface';
|
|
|
4
4
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
5
5
|
import type { ISeriesSpecInfo } from '../../series/interface';
|
|
6
6
|
import type { IRegionSpecInfo } from '../../region/interface';
|
|
7
|
-
import type { IPerformanceHook } from '../../typings';
|
|
7
|
+
import type { IPerformanceHook, TooltipActiveType } from '../../typings';
|
|
8
8
|
export interface IChartOption extends Omit<IModelOption, 'getChartViewRect' | 'getChartLayoutRect' | 'globalScale' | 'getChart' | 'getSeriesData' | 'animation'> {
|
|
9
9
|
container: HTMLElement | null;
|
|
10
10
|
canvas?: HTMLCanvasElement | OffscreenCanvas | string;
|
|
@@ -12,6 +12,10 @@ export interface IChartOption extends Omit<IModelOption, 'getChartViewRect' | 'g
|
|
|
12
12
|
viewBox?: IBoundsLike;
|
|
13
13
|
layout?: LayoutCallBack;
|
|
14
14
|
disableTriggerEvent?: boolean;
|
|
15
|
+
componentShowContent?: {
|
|
16
|
+
tooltip?: boolean | Partial<Record<TooltipActiveType, boolean>>;
|
|
17
|
+
crosshair?: boolean;
|
|
18
|
+
};
|
|
15
19
|
performanceHook?: IPerformanceHook;
|
|
16
20
|
}
|
|
17
21
|
export interface IChartSpecTransformerOption extends Partial<IChartOption> {
|
package/types/core/vchart.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { Compiler } from '../compile/compiler';
|
|
|
22
22
|
import type { IMorphConfig } from '../animation/spec';
|
|
23
23
|
import type { DataLinkAxis, DataLinkSeries, IGlobalConfig, IVChart, IVChartRenderOption } from './interface';
|
|
24
24
|
import { InstanceManager } from './instance-manager';
|
|
25
|
+
import type { IAxis } from '../component/axis';
|
|
25
26
|
export declare class VChart implements IVChart {
|
|
26
27
|
readonly id: number;
|
|
27
28
|
static useRegisters(comps: (() => void)[]): void;
|
|
@@ -180,6 +181,7 @@ export declare class VChart implements IVChart {
|
|
|
180
181
|
getComponents(): import("../component/interface").IComponent[];
|
|
181
182
|
getScale(scaleId: string): import("@visactor/vscale").IBaseScale;
|
|
182
183
|
setDimensionIndex(value: StringOrNumber, opt?: DimensionIndexOption): void;
|
|
184
|
+
showCrosshair(cb: (axis: IAxis) => false | string | number): void;
|
|
183
185
|
stopAnimation(): void;
|
|
184
186
|
reRunNormalAnimation(): void;
|
|
185
187
|
pauseAnimation(): void;
|
|
@@ -120,6 +120,10 @@ export interface IModelOption extends ICompilableInitOption {
|
|
|
120
120
|
animation?: boolean;
|
|
121
121
|
onError: (...args: any[]) => void;
|
|
122
122
|
disableTriggerEvent?: boolean;
|
|
123
|
+
componentShowContent?: {
|
|
124
|
+
tooltip?: boolean | Partial<Record<TooltipActiveType, boolean>>;
|
|
125
|
+
crosshair?: boolean;
|
|
126
|
+
};
|
|
123
127
|
getDimensionInfo?: (chart: IChart | undefined, pos: ILayoutPoint, isTooltip?: boolean) => IDimensionInfo[] | null;
|
|
124
128
|
getDimensionInfoByValue?: (axis: IAxis, value: any) => IDimensionInfo | null;
|
|
125
129
|
getRectByDimensionData?: (dimensionData: IDimensionData, layoutStartPoint: ILayoutPoint) => any;
|
|
@@ -27,6 +27,7 @@ import type { IColor, ICustomPath2D, IGraphic, IRichTextCharacter } from '@visac
|
|
|
27
27
|
import type { ICommonAxisSpec } from '../../component/axis/interface';
|
|
28
28
|
import type { IMediaQuerySpec } from './media-query';
|
|
29
29
|
import type { IModelSpec } from '../../model/interface';
|
|
30
|
+
import type { TooltipActiveType } from '../tooltip/handler';
|
|
30
31
|
export type IChartPadding = ILayoutOrientPadding | number;
|
|
31
32
|
export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
|
|
32
33
|
dom?: string | HTMLElement;
|
|
@@ -39,6 +40,10 @@ export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
|
|
|
39
40
|
onError?: (...args: any[]) => void;
|
|
40
41
|
theme?: string | ITheme;
|
|
41
42
|
disableTriggerEvent?: boolean;
|
|
43
|
+
componentShowContent?: {
|
|
44
|
+
tooltip?: boolean | Partial<Record<TooltipActiveType, boolean>>;
|
|
45
|
+
crosshair?: boolean;
|
|
46
|
+
};
|
|
42
47
|
resizeDelay?: number;
|
|
43
48
|
}
|
|
44
49
|
export declare enum RenderModeEnum {
|