@visactor/vchart-types 1.12.4-alpha.1 → 1.12.4-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/chart/base/base-chart.d.ts +1 -0
- package/types/chart/chart-meta/data.d.ts +1 -2
- package/types/chart/gauge/interface.d.ts +1 -1
- package/types/chart/mosaic/mosaic.d.ts +0 -1
- package/types/chart/pie/interface.d.ts +2 -2
- package/types/chart/polar/interface.d.ts +2 -0
- package/types/chart/treemap/interface.d.ts +1 -1
- package/types/chart/venn/interface.d.ts +2 -2
- package/types/compile/interface/compiler.d.ts +15 -0
- package/types/compile/mark/compilable-mark.d.ts +7 -39
- package/types/compile/mark/interface.d.ts +5 -25
- package/types/component/axis/base-axis.d.ts +2 -2
- package/types/component/axis/cartesian/axis.d.ts +2 -0
- package/types/component/axis/cartesian/interface/common.d.ts +1 -0
- package/types/component/axis/interface/spec.d.ts +1 -0
- package/types/component/axis/mixin/util/break-data.d.ts +1 -1
- package/types/component/axis/polar/axis.d.ts +1 -1
- package/types/component/axis/polar/interface/spec.d.ts +3 -1
- package/types/component/custom-mark/custom-mark.d.ts +1 -4
- package/types/component/data-zoom/data-filter-base-component.d.ts +3 -0
- package/types/component/data-zoom/data-zoom/data-zoom.d.ts +0 -3
- package/types/component/data-zoom/scroll-bar/scroll-bar.d.ts +0 -3
- package/types/component/geo/geo-coordinate.d.ts +7 -0
- package/types/component/interface/common.d.ts +1 -1
- package/types/component/interface/index.d.ts +0 -1
- package/types/component/label/base-label.d.ts +1 -2
- package/types/component/label/interface.d.ts +2 -2
- package/types/component/label/label.d.ts +0 -1
- package/types/component/label/total-label.d.ts +1 -1
- package/types/component/label/util.d.ts +5 -5
- package/types/component/marker/base-marker.d.ts +4 -1
- package/types/component/marker/interface.d.ts +9 -2
- package/types/component/marker/utils.d.ts +4 -4
- package/types/component/player/player.d.ts +1 -3
- package/types/component/title/interface/spec.d.ts +3 -3
- package/types/component/title/interface/theme.d.ts +1 -1
- package/types/component/tooltip/constant.d.ts +5 -4
- package/types/component/tooltip/interface/common.d.ts +1 -1
- package/types/component/tooltip/interface/spec.d.ts +23 -3
- package/types/component/tooltip/interface/theme.d.ts +2 -2
- package/types/component/tooltip/processor/base.d.ts +3 -5
- package/types/component/tooltip/tooltip.d.ts +13 -6
- package/types/component/tooltip/utils/common.d.ts +6 -4
- package/types/component/tooltip/utils/get-spec.d.ts +4 -4
- package/types/component/tooltip/utils/get-value.d.ts +1 -2
- package/types/component/tooltip/utils/index.d.ts +0 -1
- package/types/component/util.d.ts +3 -0
- package/types/core/vchart.d.ts +1 -1
- package/types/data/initialize.d.ts +1 -2
- package/types/data/transforms/pie.d.ts +3 -0
- package/types/mark/interface/common.d.ts +10 -0
- package/types/model/base-model.d.ts +2 -2
- package/types/model/interface.d.ts +14 -0
- package/types/plugin/chart/media-query/media-query.d.ts +1 -0
- package/types/plugin/chart/plugin-service.d.ts +2 -0
- package/types/plugin/components/axis-sync/zero-align-transform.d.ts +1 -0
- package/types/plugin/components/tooltip-handler/base.d.ts +1 -16
- package/types/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +0 -1
- package/types/plugin/components/tooltip-handler/interface/style.d.ts +1 -2
- package/types/plugin/components/tooltip-handler/utils/position.d.ts +3 -5
- package/types/region/interface.d.ts +3 -1
- package/types/series/area/area.d.ts +2 -0
- package/types/series/bar/bar.d.ts +4 -4
- package/types/series/base/base-series.d.ts +8 -7
- package/types/series/base/tooltip-helper.d.ts +30 -6
- package/types/series/box-plot/box-plot.d.ts +1 -0
- package/types/series/box-plot/tooltip-helper.d.ts +2 -2
- package/types/series/cartesian/cartesian.d.ts +1 -1
- package/types/series/correlation/correlation.d.ts +1 -0
- package/types/series/dot/dot.d.ts +0 -1
- package/types/series/dot/tooltip-helper.d.ts +8 -2
- package/types/series/funnel/funnel.d.ts +2 -0
- package/types/series/funnel/interface.d.ts +3 -1
- package/types/series/gauge/interface.d.ts +1 -1
- package/types/series/gauge/pointer-tooltip-helper.d.ts +2 -1
- package/types/series/heatmap/tooltip-helper.d.ts +2 -3
- package/types/series/interface/common.d.ts +1 -9
- package/types/series/interface/tooltip-helper.d.ts +5 -4
- package/types/series/link/tooltip-helper.d.ts +5 -2
- package/types/series/liquid/tooltip-helper.d.ts +4 -5
- package/types/series/map/map.d.ts +1 -0
- package/types/series/mixin/line-mixin.d.ts +2 -2
- package/types/series/pie/interface.d.ts +3 -3
- package/types/series/pie/pie.d.ts +1 -0
- package/types/series/polar/animation.d.ts +9 -11
- package/types/series/progress/linear/tooltip-helper.d.ts +2 -3
- package/types/series/radar/animation.d.ts +0 -3
- package/types/series/range-area/tooltip-helper.d.ts +1 -3
- package/types/series/range-column/tooltip-helper.d.ts +1 -2
- package/types/series/sankey/sankey.d.ts +2 -1
- package/types/series/sankey/tooltip-helper.d.ts +3 -3
- package/types/series/waterfall/waterfall.d.ts +1 -0
- package/types/typings/spec/common.d.ts +6 -3
- package/types/typings/tooltip/position.d.ts +1 -0
- package/types/typings/tooltip/shape.d.ts +0 -1
- package/types/typings/tooltip/tooltip.d.ts +7 -0
- package/types/util/math.d.ts +1 -0
- package/types/util/scale.d.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DataView } from '@visactor/vdataset';
|
|
2
2
|
import type { DataSet, ITransformOptions } from '@visactor/vdataset';
|
|
3
3
|
import type { IRegion } from '../../region/interface';
|
|
4
|
-
import type { IMark } from '../../mark/interface';
|
|
5
|
-
import type { CoordinateType, IInvalidType, IPoint, DataKeyType, Datum, Maybe, ISeriesSpec, IGroup, ILayoutType, ILayoutPoint, ILayoutRect } from '../../typings';
|
|
4
|
+
import type { ICompileMarkConfig, IMark } from '../../mark/interface';
|
|
5
|
+
import type { CoordinateType, IInvalidType, IPoint, DataKeyType, Datum, Maybe, ISeriesSpec, IExtensionMarkSpec, IExtensionGroupMarkSpec, EnableMarkType, IGroup, ILayoutType, ILayoutPoint, ILayoutRect } from '../../typings';
|
|
6
6
|
import { BaseModel } from '../../model/base-model';
|
|
7
7
|
import type { ISeriesOption, ISeries, ISeriesMarkInitOption, ISeriesStackData, ISeriesTooltipHelper, SeriesMarkMap, ISeriesMarkInfo, ISeriesSpecInfo, ISeriesStackDataLeaf, ISeriesStackDataMeta, ISeriesSeriesInfo } from '../interface';
|
|
8
|
-
import type { IModelEvaluateOption, IModelRenderOption } from '../../model/interface';
|
|
8
|
+
import type { IModelEvaluateOption, IModelRenderOption, IUpdateSpecResult } from '../../model/interface';
|
|
9
9
|
import type { AddVChartPropertyContext } from '../../data/transforms/add-property';
|
|
10
10
|
import type { IBaseInteractionSpec } from '../../interaction/interface';
|
|
11
11
|
import type { StatisticOperations } from '../../data/transforms/dimension-statistics';
|
|
@@ -15,6 +15,7 @@ import type { ISeriesMarkAttributeContext } from '../../compile/mark';
|
|
|
15
15
|
import { STATE_VALUE_ENUM } from '../../compile/mark';
|
|
16
16
|
import { BaseSeriesSpecTransformer } from './base-series-transformer';
|
|
17
17
|
import type { EventType } from '@visactor/vgrammar-core';
|
|
18
|
+
import type { ILabelSpec } from '../../component/label/interface';
|
|
18
19
|
export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> implements ISeries {
|
|
19
20
|
readonly specKey: string;
|
|
20
21
|
readonly type: string;
|
|
@@ -169,9 +170,9 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
169
170
|
protected initEvent(): void;
|
|
170
171
|
protected _releaseEvent(): void;
|
|
171
172
|
protected initTooltip(): void;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
_compareExtensionMarksSpec(newMarks: (IExtensionMarkSpec<Exclude<EnableMarkType, 'group'>> | IExtensionGroupMarkSpec)[], prevMarks: (IExtensionMarkSpec<Exclude<EnableMarkType, 'group'>> | IExtensionGroupMarkSpec)[], compareResult: IUpdateSpecResult): void;
|
|
174
|
+
_compareLabelSpec(newLabels: ILabelSpec[], prevLabels: ILabelSpec[], compareResult: IUpdateSpecResult): void;
|
|
175
|
+
_compareSpec(spec: T, prevSpec: T, ignoreCheckKeys?: Record<string, boolean>): {
|
|
175
176
|
change: boolean;
|
|
176
177
|
reMake: boolean;
|
|
177
178
|
reRender: boolean;
|
|
@@ -201,7 +202,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
|
|
|
201
202
|
getMeasureField(): string[];
|
|
202
203
|
protected onMarkPositionUpdate(): void;
|
|
203
204
|
protected onMarkTreePositionUpdate(marks: IMark[]): void;
|
|
204
|
-
protected _createMark<M extends IMark>(markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption): NonNullable<M>;
|
|
205
|
+
protected _createMark<M extends IMark>(markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption, config?: ICompileMarkConfig): NonNullable<M>;
|
|
205
206
|
protected _getDataIdKey(): string | ((datum: Datum) => string);
|
|
206
207
|
protected _getSeriesDataKey(datum: Datum): string;
|
|
207
208
|
addViewDataFilter(option: ITransformOptions): void;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import type { TooltipHandlerParams } from '../../component/tooltip/interface';
|
|
2
|
-
import type { ITooltipPattern, ShapeType, TooltipActiveType } from '../../typings';
|
|
1
|
+
import type { ISeriesTooltipSpec, ITooltipSpec, TooltipHandlerParams } from '../../component/tooltip/interface';
|
|
2
|
+
import type { ITooltipActual, ITooltipLineActual, ITooltipLinePattern, ITooltipPattern, MaybeArray, ShapeType, TooltipActiveType, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../typings';
|
|
3
3
|
import type { ISeries, ISeriesTooltipHelper } from '../interface';
|
|
4
|
-
import { BaseTooltipHelper } from '../../model/tooltip-helper';
|
|
5
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
6
4
|
import type { Datum } from '@visactor/vgrammar-core';
|
|
5
|
+
import type { IMark } from '../../mark/interface/common';
|
|
7
6
|
interface ISeriesCacheInfo {
|
|
8
7
|
seriesFields: string[];
|
|
9
8
|
dimensionFields: string[];
|
|
10
9
|
measureFields: string[];
|
|
11
10
|
type: string;
|
|
12
11
|
}
|
|
13
|
-
export declare class BaseSeriesTooltipHelper
|
|
12
|
+
export declare class BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
14
13
|
series: ISeries;
|
|
14
|
+
spec: ISeriesTooltipSpec | undefined;
|
|
15
|
+
activeType: TooltipActiveType[];
|
|
16
|
+
activeTriggerSet: {
|
|
17
|
+
mark: Set<IMark>;
|
|
18
|
+
group: Set<IMark>;
|
|
19
|
+
};
|
|
20
|
+
ignoreTriggerSet: {
|
|
21
|
+
mark: Set<IMark>;
|
|
22
|
+
};
|
|
15
23
|
protected _seriesCacheInfo: ISeriesCacheInfo;
|
|
16
24
|
constructor(series: ISeries);
|
|
17
25
|
updateTooltipSpec(): void;
|
|
@@ -28,6 +36,22 @@ export declare class BaseSeriesTooltipHelper extends BaseTooltipHelper implement
|
|
|
28
36
|
dimensionTooltipTitleCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
|
29
37
|
groupTooltipTitleCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
|
30
38
|
groupTooltipKeyCallback: (datum: Datum, params?: TooltipHandlerParams) => string | undefined;
|
|
31
|
-
|
|
39
|
+
getHasShape: (isContent: boolean) => boolean;
|
|
40
|
+
protected getShapeAttrs(activeType: TooltipActiveType, isContent: boolean, chartTooltipSpec?: ITooltipSpec): {
|
|
41
|
+
shapeType: TooltipContentProperty<string>;
|
|
42
|
+
shapeFill: TooltipContentProperty<string>;
|
|
43
|
+
shapeStroke: TooltipContentProperty<string>;
|
|
44
|
+
shapeHollow: TooltipContentProperty<boolean>;
|
|
45
|
+
shapeLineWidth: TooltipContentProperty<number>;
|
|
46
|
+
shapeSize: any;
|
|
47
|
+
hasShape: boolean;
|
|
48
|
+
};
|
|
49
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
50
|
+
protected getDefaultContentList(activeType: TooltipActiveType): MaybeArray<TooltipPatternProperty<MaybeArray<ITooltipLinePattern>>>;
|
|
51
|
+
protected getContentList(activeType: TooltipActiveType, spec: ITooltipPattern, shapeAttrs: Record<string, TooltipContentProperty<any>>, data?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams): ITooltipLineActual[];
|
|
52
|
+
protected getTitleResult(activeType: TooltipActiveType, titleSpec: TooltipPatternProperty<ITooltipLinePattern>, shapeAttrs: Record<string, TooltipContentProperty<any>>, data?: TooltipData, params?: TooltipHandlerParams): ITooltipLineActual;
|
|
53
|
+
getTooltipData(activeType: TooltipActiveType, chartTooltipSpec?: ITooltipSpec, data?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams): ITooltipActual | null;
|
|
54
|
+
protected getDefaultTitlePattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
55
|
+
protected getDefaultContentPattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
32
56
|
}
|
|
33
57
|
export {};
|
|
@@ -45,6 +45,7 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
|
|
|
45
45
|
initMarkStyle(): void;
|
|
46
46
|
initBoxPlotMarkStyle(): void;
|
|
47
47
|
initData(): void;
|
|
48
|
+
compileData(): void;
|
|
48
49
|
init(option: IModelInitOption): void;
|
|
49
50
|
private _getMarkWidth;
|
|
50
51
|
onLayoutEnd(ctx: any): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { Datum,
|
|
3
|
+
import type { Datum, ITooltipLinePattern, TooltipActiveType } from '../../typings';
|
|
4
4
|
import { BOX_PLOT_TOOLTIP_KEYS } from '../../constant/box-plot';
|
|
5
5
|
export declare class BoxPlotSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
6
|
+
protected getDefaultContentList(activeType: TooltipActiveType): ITooltipLinePattern[];
|
|
7
7
|
getContentKey: (contentType: BOX_PLOT_TOOLTIP_KEYS) => (datum: any) => string;
|
|
8
8
|
getContentValue: (contentType: BOX_PLOT_TOOLTIP_KEYS) => (datum: any) => any;
|
|
9
9
|
shapeColorCallback: (datum: Datum) => any;
|
|
@@ -31,7 +31,7 @@ export declare abstract class CartesianSeries<T extends ICartesianSeriesSpec = I
|
|
|
31
31
|
protected _specXField: string[];
|
|
32
32
|
protected _specYField: string[];
|
|
33
33
|
protected _direction: DirectionType;
|
|
34
|
-
get direction(): "
|
|
34
|
+
get direction(): "horizontal" | "vertical";
|
|
35
35
|
protected _scaleX: IBaseScale;
|
|
36
36
|
get scaleX(): IBaseScale;
|
|
37
37
|
setScaleX(s: IBaseScale): void;
|
|
@@ -36,6 +36,7 @@ export declare class CorrelationSeries<T extends ICorrelationSeriesSpec = ICorre
|
|
|
36
36
|
protected _viewDataTransform: SeriesData;
|
|
37
37
|
setAttrFromSpec(): void;
|
|
38
38
|
protected initData(): void;
|
|
39
|
+
compileData(): void;
|
|
39
40
|
protected _statisticViewData(): void;
|
|
40
41
|
initMark(): void;
|
|
41
42
|
initMarkStyle(): void;
|
|
@@ -29,7 +29,6 @@ export declare class DotSeries<T extends IDotSeriesSpec = IDotSeriesSpec> extend
|
|
|
29
29
|
protected _gridBackground?: IFillMarkSpec;
|
|
30
30
|
setGridBackground(gridBackground: IFillMarkSpec): void;
|
|
31
31
|
initData(): void;
|
|
32
|
-
setSeriesField(field: string): void;
|
|
33
32
|
getStatisticFields(): {
|
|
34
33
|
key: string;
|
|
35
34
|
operations: Array<'max' | 'min' | 'values'>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Datum, ITooltipActual, ITooltipLinePattern, MaybeArray, TooltipActiveType, TooltipData, TooltipPatternProperty } from '../../typings';
|
|
4
|
+
import type { ITooltipSpec } from '../../component/tooltip/interface/spec';
|
|
5
|
+
import type { TooltipHandlerParams } from '../../component/tooltip/interface/common';
|
|
4
6
|
export declare class DotSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
7
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
8
|
+
protected getDefaultTitlePattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
9
|
+
shapeTypeCallback: () => string;
|
|
10
|
+
protected getDefaultContentList(): MaybeArray<TooltipPatternProperty<MaybeArray<ITooltipLinePattern>>>;
|
|
11
|
+
getTooltipData(activeType: TooltipActiveType, chartTooltipSpec?: ITooltipSpec, data?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams): ITooltipActual | null;
|
|
6
12
|
}
|
|
@@ -40,8 +40,10 @@ export declare class FunnelSeries<T extends IFunnelSeriesSpec = IFunnelSeriesSpe
|
|
|
40
40
|
label?: ITextMark;
|
|
41
41
|
line?: IRuleMark;
|
|
42
42
|
};
|
|
43
|
+
protected _minLabelLineWidth: number;
|
|
43
44
|
setAttrFromSpec(): void;
|
|
44
45
|
initData(): void;
|
|
46
|
+
compileData(): void;
|
|
45
47
|
getStatisticFields(): {
|
|
46
48
|
key: string;
|
|
47
49
|
operations: Array<'max' | 'min' | 'values'>;
|
|
@@ -36,7 +36,9 @@ export interface IFunnelOuterLabelSpec extends IMarkSpec<IComposedTextMarkSpec>
|
|
|
36
36
|
spaceWidth?: number;
|
|
37
37
|
alignLabel?: boolean;
|
|
38
38
|
style?: ITextMarkSpec;
|
|
39
|
-
line?:
|
|
39
|
+
line?: {
|
|
40
|
+
minLength?: number;
|
|
41
|
+
} & IMarkSpec<IRuleMarkSpec>;
|
|
40
42
|
}
|
|
41
43
|
export interface IFunnelSeriesTheme {
|
|
42
44
|
[SeriesMarkNameEnum.funnel]?: Partial<IMarkTheme<IPolygonMarkSpec>>;
|
|
@@ -15,7 +15,7 @@ export interface IGaugePointerSeriesSpec extends IProgressLikeSeriesSpec, IAnima
|
|
|
15
15
|
[SeriesMarkNameEnum.pointer]?: IMarkSpec<IPathMarkSpec | IRectMarkSpec> & PointerMarkSpec;
|
|
16
16
|
}
|
|
17
17
|
export type PointerMarkSpec = {
|
|
18
|
-
type
|
|
18
|
+
type?: 'path' | 'rect';
|
|
19
19
|
width?: number;
|
|
20
20
|
height?: number;
|
|
21
21
|
innerPadding?: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
+
import type { TooltipActiveType } from '../../typings';
|
|
3
4
|
export declare class GaugePointerTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
4
|
-
|
|
5
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
5
6
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TooltipActiveType } from '../../typings';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
4
3
|
export declare class HeatmapSeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
5
|
-
|
|
4
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
6
5
|
}
|
|
@@ -5,12 +5,10 @@ import type { IBaseModelSpecTransformerResult, IModelConstructor, IModelMarkInfo
|
|
|
5
5
|
import type { IRegion } from '../../region/interface';
|
|
6
6
|
import type { RenderMode } from '../../typings/spec/common';
|
|
7
7
|
import type { ISeries } from './series';
|
|
8
|
-
import type { IMarkOption
|
|
8
|
+
import type { IMarkOption } from '../../mark/interface';
|
|
9
9
|
import type { ISeriesSpec, StringOrNumber } from '../../typings';
|
|
10
10
|
import type { TransformedLabelSpec } from '../../component/label';
|
|
11
11
|
import type { SeriesMarkNameEnum, SeriesTypeEnum } from './type';
|
|
12
|
-
import type { ICustomPath2D } from '@visactor/vrender-core';
|
|
13
|
-
import type { MarkClip } from '../../compile/mark';
|
|
14
12
|
export interface ISeriesSeriesInfo {
|
|
15
13
|
key: string;
|
|
16
14
|
originalKey: any;
|
|
@@ -63,17 +61,11 @@ export interface ISeriesMarkInitOption extends Partial<IMarkOption> {
|
|
|
63
61
|
depend?: IGrammarItem | IGrammarItem[];
|
|
64
62
|
key?: string | ((datum: any) => string);
|
|
65
63
|
groupKey?: string;
|
|
66
|
-
morph?: boolean;
|
|
67
|
-
defaultMorphElementKey?: string;
|
|
68
64
|
dataView?: DataView | false;
|
|
69
65
|
dataProductId?: string;
|
|
70
66
|
seriesId?: number;
|
|
71
|
-
progressive?: IMarkProgressiveConfig;
|
|
72
|
-
support3d?: boolean;
|
|
73
|
-
customShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;
|
|
74
67
|
stateSort?: (stateA: string, stateB: string) => number;
|
|
75
68
|
componentType?: string;
|
|
76
|
-
clip?: MarkClip;
|
|
77
69
|
}
|
|
78
70
|
export interface ISeriesMarkInfo extends IModelMarkInfo {
|
|
79
71
|
name: SeriesMarkNameEnum | string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Datum, ITooltipActual, ShapeType, TooltipActiveType, TooltipContentCallback, TooltipData } from '../../typings';
|
|
2
2
|
import type { ISeries } from './series';
|
|
3
|
-
import type { ITooltipHelper } from '../../model/
|
|
4
|
-
import type {
|
|
3
|
+
import type { ITooltipHelper } from '../../model/interface';
|
|
4
|
+
import type { ITooltipSpec } from '../../component/tooltip/interface/spec';
|
|
5
|
+
import type { TooltipHandlerParams } from '../../component/tooltip/interface/common';
|
|
5
6
|
export interface ISeriesTooltipHelper extends ITooltipHelper {
|
|
6
7
|
series: ISeries;
|
|
7
|
-
|
|
8
|
+
getTooltipData: (activeType: TooltipActiveType, chartTooltipSpec?: ITooltipSpec, allData?: TooltipData, datum?: Datum[], params?: TooltipHandlerParams) => ITooltipActual | null;
|
|
8
9
|
markTooltipKeyCallback: TooltipContentCallback<string>;
|
|
9
10
|
markTooltipValueCallback: TooltipContentCallback<string>;
|
|
10
11
|
shapeTypeCallback: TooltipContentCallback<ShapeType>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITooltipLinePattern, TooltipActiveType } from '../../typings';
|
|
4
4
|
export declare class LinkSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
5
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
6
|
+
protected getDefaultTitlePattern(activeType: TooltipActiveType): ITooltipLinePattern;
|
|
7
|
+
shapeTypeCallback: () => string;
|
|
8
|
+
protected getDefaultContentList(): ITooltipLinePattern[];
|
|
6
9
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { Datum
|
|
3
|
+
import type { Datum } from '../../typings';
|
|
4
4
|
export declare class LiquidSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
getLiquidFillColor: (datum: Datum) => any;
|
|
5
|
+
markTooltipKeyCallback: (datum: any) => string;
|
|
6
|
+
markTooltipValueCallback: (datum: any) => any;
|
|
7
|
+
shapeStrokeCallback: (datum: Datum) => any;
|
|
9
8
|
}
|
|
@@ -30,6 +30,7 @@ export declare class MapSeries<T extends IMapSeriesSpec = IMapSeriesSpec> extend
|
|
|
30
30
|
private _labelMark;
|
|
31
31
|
setAttrFromSpec(): void;
|
|
32
32
|
initData(): void;
|
|
33
|
+
compileData(): void;
|
|
33
34
|
initMark(): void;
|
|
34
35
|
initMarkStyle(): void;
|
|
35
36
|
initLabelMarkStyle(labelMark: ILabelMark): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ISeriesOption } from '../interface/common';
|
|
2
2
|
import type { ISeries } from '../interface/series';
|
|
3
|
-
import type { IMark, IMarkProgressiveConfig } from '../../mark/interface';
|
|
3
|
+
import type { ICompileMarkConfig, IMark, IMarkProgressiveConfig } from '../../mark/interface';
|
|
4
4
|
import type { ILineMark } from '../../mark/line';
|
|
5
5
|
import type { ISymbolMark } from '../../mark/symbol';
|
|
6
6
|
import type { ITextMark } from '../../mark/text';
|
|
@@ -39,7 +39,7 @@ export interface LineLikeSeriesMixin extends ISeries {
|
|
|
39
39
|
_fieldX?: string[];
|
|
40
40
|
_fieldY?: string[];
|
|
41
41
|
_fieldZ?: string[];
|
|
42
|
-
_createMark: (markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption) => IMark;
|
|
42
|
+
_createMark: (markInfo: ISeriesMarkInfo, option?: ISeriesMarkInitOption, config?: ICompileMarkConfig) => IMark;
|
|
43
43
|
_getInvalidDefined: () => boolean;
|
|
44
44
|
_getInvalidConnectType: () => IInvalidType;
|
|
45
45
|
getLayoutRect: () => ILayoutRect;
|
|
@@ -6,7 +6,7 @@ import type { IPolarSeriesSpec, IPolarSeriesTheme } from '../polar/interface';
|
|
|
6
6
|
import type { PieAppearPreset } from './animation/animation';
|
|
7
7
|
import type { ILabelSpec, IMultiLabelSpec } from '../../component/label';
|
|
8
8
|
import type { ICustomPath2D, ILineGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
|
|
9
|
-
import type { ILayoutRect } from '../../typings/layout';
|
|
9
|
+
import type { ILayoutRect, IPercent } from '../../typings/layout';
|
|
10
10
|
import type { IPointLike } from '@visactor/vutils';
|
|
11
11
|
export type PieMarks = 'pie' | 'label' | 'labelLine';
|
|
12
12
|
export type IBasePieSeriesSpec = Omit<IPieSeriesSpec, 'type'> & {
|
|
@@ -16,8 +16,8 @@ export interface IPieSeriesSpec extends IPolarSeriesSpec, IAnimationSpec<PieMark
|
|
|
16
16
|
type: 'pie';
|
|
17
17
|
categoryField: string;
|
|
18
18
|
valueField: string;
|
|
19
|
-
centerX?: number;
|
|
20
|
-
centerY?: number;
|
|
19
|
+
centerX?: number | IPercent;
|
|
20
|
+
centerY?: number | IPercent;
|
|
21
21
|
centerOffset?: number;
|
|
22
22
|
radius?: number;
|
|
23
23
|
outerRadius?: number;
|
|
@@ -34,6 +34,7 @@ export declare class BasePieSeries<T extends IBasePieSeriesSpec> extends PolarSe
|
|
|
34
34
|
protected _buildMarkAttributeContext(): void;
|
|
35
35
|
setAttrFromSpec(): void;
|
|
36
36
|
initData(): void;
|
|
37
|
+
compileData(): void;
|
|
37
38
|
initMark(): void;
|
|
38
39
|
private startAngleScale;
|
|
39
40
|
private endAngleScale;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EasingType } from '@visactor/vrender-core';
|
|
2
|
+
import type { IPointLike } from '@visactor/vutils';
|
|
2
3
|
import { ACustomAnimate, TagPointsUpdate } from '@visactor/vrender-core';
|
|
3
|
-
import type { IPolarAxisHelper } from '../../component/axis';
|
|
4
4
|
export declare class PolarPointUpdate extends ACustomAnimate<{
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
@@ -10,18 +10,17 @@ export declare class PolarPointUpdate extends ACustomAnimate<{
|
|
|
10
10
|
private _fromRadius;
|
|
11
11
|
private _toAngle;
|
|
12
12
|
private _toRadius;
|
|
13
|
-
private
|
|
14
|
-
private
|
|
13
|
+
private _center;
|
|
14
|
+
private _prevCenter;
|
|
15
15
|
constructor(from: {
|
|
16
16
|
x: number;
|
|
17
17
|
y: number;
|
|
18
|
+
center: IPointLike;
|
|
18
19
|
}, to: {
|
|
19
20
|
x: number;
|
|
20
21
|
y: number;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
coordToPoint: IPolarAxisHelper['coordToPoint'];
|
|
24
|
-
});
|
|
22
|
+
center: IPointLike;
|
|
23
|
+
}, duration: number, easing: EasingType, params: any);
|
|
25
24
|
getEndProps(): Record<string, any>;
|
|
26
25
|
onBind(): void;
|
|
27
26
|
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
@@ -29,13 +28,12 @@ export declare class PolarPointUpdate extends ACustomAnimate<{
|
|
|
29
28
|
export declare class PolarTagPointsUpdate extends TagPointsUpdate {
|
|
30
29
|
private points;
|
|
31
30
|
private interpolatePoints;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
31
|
+
private _center;
|
|
32
|
+
private _prevCenter;
|
|
34
33
|
constructor(from: any, to: any, duration: number, easing: EasingType, params?: {
|
|
35
34
|
newPointAnimateType?: 'grow' | 'appear';
|
|
36
|
-
pointToCoord: IPolarAxisHelper['pointToCoord'];
|
|
37
|
-
coordToPoint: IPolarAxisHelper['coordToPoint'];
|
|
38
35
|
});
|
|
39
36
|
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
37
|
+
private _interpolationSinglePoint;
|
|
40
38
|
private polarPointInterpolation;
|
|
41
39
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseSeriesTooltipHelper } from '../../base/tooltip-helper';
|
|
2
2
|
import type { ISeriesTooltipHelper } from '../../interface';
|
|
3
|
-
import type {
|
|
4
|
-
import type { IDimensionInfo } from '../../../event/events/dimension/interface';
|
|
3
|
+
import type { TooltipActiveType } from '../../../typings';
|
|
5
4
|
export declare class LinearProgressSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
5
|
+
protected enableByType(activeType: TooltipActiveType): boolean;
|
|
7
6
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { Datum, IAnimationTypeConfig, IElement } from '@visactor/vgrammar-core';
|
|
2
2
|
import type { IPoint, Maybe } from '../../typings';
|
|
3
|
-
import type { IPolarAxisHelper } from '../../component/axis';
|
|
4
3
|
export interface IRadarAnimationParams {
|
|
5
4
|
center: () => Maybe<IPoint>;
|
|
6
5
|
radius: () => number;
|
|
7
6
|
startAngle: number;
|
|
8
|
-
pointToCoord: IPolarAxisHelper['pointToCoord'];
|
|
9
|
-
coordToPoint: IPolarAxisHelper['coordToPoint'];
|
|
10
7
|
}
|
|
11
8
|
export type RadarAppearPreset = 'grow' | 'fadeIn' | 'clipIn';
|
|
12
9
|
export declare const radarFadeAnimation: (animationType: 'in' | 'out') => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { ITooltipPattern, TooltipActiveType } from '../../typings';
|
|
4
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
5
3
|
export declare class RangeAreaSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
4
|
+
protected _getMeasureData: (datum: any) => string;
|
|
7
5
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type { ITooltipPattern, TooltipActiveType } from '../../typings';
|
|
4
3
|
export declare class RangeColumnSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
5
|
-
|
|
4
|
+
protected _getMeasureData: (datum: any) => string;
|
|
6
5
|
}
|
|
@@ -27,7 +27,7 @@ export declare class SankeySeries<T extends ISankeySeriesSpec = ISankeySeriesSpe
|
|
|
27
27
|
private _colorScale;
|
|
28
28
|
private _nodeList;
|
|
29
29
|
private _needClear;
|
|
30
|
-
get direction(): "
|
|
30
|
+
get direction(): "horizontal" | "vertical";
|
|
31
31
|
getCategoryField(): string;
|
|
32
32
|
setCategoryField(f: string): string;
|
|
33
33
|
protected _valueField: string;
|
|
@@ -35,6 +35,7 @@ export declare class SankeySeries<T extends ISankeySeriesSpec = ISankeySeriesSpe
|
|
|
35
35
|
setValueField(f: string): string;
|
|
36
36
|
setAttrFromSpec(): void;
|
|
37
37
|
initData(): void;
|
|
38
|
+
compileData(): void;
|
|
38
39
|
initMark(): void;
|
|
39
40
|
protected _buildMarkAttributeContext(): void;
|
|
40
41
|
valueToNode(value: StringOrNumber | StringOrNumber[]): any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ISeriesTooltipHelper } from '../interface';
|
|
2
2
|
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
|
|
3
|
-
import type {
|
|
4
|
-
import type { IDimensionInfo } from '../../event/events/dimension/interface';
|
|
3
|
+
import type { Datum } from '@visactor/vgrammar-core';
|
|
5
4
|
export declare class SankeySeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
|
|
6
|
-
|
|
5
|
+
protected _getDimensionData: (datum: any) => any;
|
|
6
|
+
markTooltipValueCallback: (datum: Datum) => string | undefined;
|
|
7
7
|
}
|
|
@@ -27,6 +27,7 @@ export declare class WaterfallSeries<T extends IWaterfallSeriesSpec = IWaterfall
|
|
|
27
27
|
setAttrFromSpec(): void;
|
|
28
28
|
getSeriesKeys(): string[];
|
|
29
29
|
protected initData(): void;
|
|
30
|
+
compileData(): void;
|
|
30
31
|
initAnimation(): void;
|
|
31
32
|
viewDataUpdate(d: DataView): void;
|
|
32
33
|
addViewDataFilter(_option: ITransformOptions): void;
|
|
@@ -6,7 +6,7 @@ import type { DataSet, DataView, ISimplifyOptions, IFieldsOptions, IFilterOption
|
|
|
6
6
|
import type { RegionSpec } from '../../region/interface';
|
|
7
7
|
import type { IHoverSpec, ISelectSpec, IInteractionSpec } from '../../interaction/interface';
|
|
8
8
|
import type { IRenderOption } from '../../compile/interface';
|
|
9
|
-
import type { ITooltipSpec } from '../../component/tooltip/interface';
|
|
9
|
+
import type { ISeriesTooltipSpec, ITooltipSpec } from '../../component/tooltip/interface';
|
|
10
10
|
import type { ILayoutSpec } from '../../layout/interface';
|
|
11
11
|
import type { ConvertToMarkStyleSpec, IArc3dMarkSpec, IArcMarkSpec, IAreaMarkSpec, IBoxPlotMarkSpec, ICommonSpec, IGroupMarkSpec, ILineMarkSpec, ILinkPathMarkSpec, IPathMarkSpec, IPolygonMarkSpec, IPyramid3dMarkSpec, IRect3dMarkSpec, IRectMarkSpec, IRuleMarkSpec, ISymbolMarkSpec, IRippleMarkSpec, ITextMarkSpec, IVisualSpecScale } from '../visual';
|
|
12
12
|
import type { StateValue } from '../../compile/mark';
|
|
@@ -42,6 +42,7 @@ export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
|
|
|
42
42
|
onError?: (...args: any[]) => void;
|
|
43
43
|
theme?: string | ITheme;
|
|
44
44
|
disableTriggerEvent?: boolean;
|
|
45
|
+
resizeDelay?: number;
|
|
45
46
|
}
|
|
46
47
|
export declare enum RenderModeEnum {
|
|
47
48
|
'desktop-browser' = "desktop-browser",
|
|
@@ -159,14 +160,15 @@ export interface ISeriesSpec extends IInteractionSpec {
|
|
|
159
160
|
percent?: boolean;
|
|
160
161
|
stackOffsetSilhouette?: boolean;
|
|
161
162
|
invalidType?: IInvalidType;
|
|
162
|
-
tooltip?:
|
|
163
|
+
tooltip?: ISeriesTooltipSpec;
|
|
163
164
|
animation?: boolean;
|
|
164
165
|
animationThreshold?: number;
|
|
165
166
|
support3d?: boolean;
|
|
166
167
|
morph?: IMorphSeriesSpec;
|
|
167
168
|
extensionMark?: (IExtensionMarkSpec<Exclude<EnableMarkType, 'group'>> | IExtensionGroupMarkSpec)[];
|
|
169
|
+
zIndex?: number;
|
|
168
170
|
}
|
|
169
|
-
export type IChartExtendsSeriesSpec<T extends ISeriesSpec> = Omit<T, 'data' | 'morph' | 'stackValue'>;
|
|
171
|
+
export type IChartExtendsSeriesSpec<T extends ISeriesSpec> = Omit<T, 'data' | 'morph' | 'stackValue' | 'tooltip'>;
|
|
170
172
|
export type AdaptiveSpec<T, K extends keyof any> = {
|
|
171
173
|
[key in Exclude<keyof T, K>]: T[key];
|
|
172
174
|
} & {
|
|
@@ -263,6 +265,7 @@ export type IBuildinMarkSpec = {
|
|
|
263
265
|
export type EnableMarkType = keyof IBuildinMarkSpec;
|
|
264
266
|
export interface ICustomMarkSpec<T extends EnableMarkType> extends IModelSpec, IMarkSpec<IBuildinMarkSpec[T]>, IAnimationSpec<string, string> {
|
|
265
267
|
type: T;
|
|
268
|
+
name?: string;
|
|
266
269
|
dataIndex?: number;
|
|
267
270
|
dataKey?: string | ((datum: any) => string);
|
|
268
271
|
dataId?: StringOrNumber;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ITooltipHandlerSpec } from '../../component/tooltip/interface/spec';
|
|
1
2
|
import type { MaybeArray } from '../common';
|
|
2
3
|
import type { TooltipPatternProperty, TooltipUpdateCallback } from './common';
|
|
3
4
|
import type { TooltipActiveType, TooltipData } from './handler';
|
|
@@ -28,4 +29,10 @@ export interface ITooltipActual {
|
|
|
28
29
|
activeType?: TooltipActiveType;
|
|
29
30
|
position?: ITooltipPositionActual;
|
|
30
31
|
data?: TooltipData;
|
|
32
|
+
handler?: Partial<ITooltipHandlerSpec>;
|
|
33
|
+
maxLineCount?: number;
|
|
34
|
+
updateTitle?: TooltipUpdateCallback<ITooltipLineActual>;
|
|
35
|
+
updateContent?: TooltipUpdateCallback<ITooltipLineActual[]>;
|
|
36
|
+
updatePosition?: TooltipUpdateCallback<ITooltipPositionActual>;
|
|
37
|
+
othersLine?: ITooltipLineActual;
|
|
31
38
|
}
|
package/types/util/math.d.ts
CHANGED
|
@@ -24,3 +24,4 @@ export declare function radiusLabelOrientAttribute(angle: number): {
|
|
|
24
24
|
export declare function vectorAngle(v1: IPoint, v2: IPoint): number;
|
|
25
25
|
export declare function distance(p1: IPoint, p2?: IPoint): number;
|
|
26
26
|
export declare function getPercentValue(valueList: number[], precision?: number): number[] | 0;
|
|
27
|
+
export declare function isValidPoint(p: IPoint): boolean;
|
package/types/util/scale.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ export declare function createScaleWithSpec(spec: IVisual<any>, context: {
|
|
|
16
16
|
globalScale: IGlobalScale;
|
|
17
17
|
seriesId: number;
|
|
18
18
|
}): IBaseScale | null;
|
|
19
|
-
export declare function valueInScaleRange(v: number, s?: IBaseScale): number;
|
|
19
|
+
export declare function valueInScaleRange(v: number, s?: IBaseScale, useWholeRange?: boolean): number;
|
|
20
20
|
export declare function isSpecValueWithScale(specValue: any): boolean;
|
|
21
21
|
export {};
|