@visactor/vchart-types 1.8.0-alpha.0 → 1.8.0-beta.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 +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/animation/utils.d.ts +2 -2
- package/types/chart/area/area-transformer.d.ts +6 -0
- package/types/chart/area/area.d.ts +6 -4
- package/types/chart/area/index.d.ts +1 -0
- package/types/chart/bar/3d/bar-3d-transformer.d.ts +6 -0
- package/types/chart/bar/3d/bar-3d.d.ts +14 -0
- package/types/chart/bar/3d/index.d.ts +2 -0
- package/types/chart/bar/bar-transformer.d.ts +6 -0
- package/types/chart/bar/bar.d.ts +7 -4
- package/types/chart/bar/index.d.ts +2 -1
- package/types/chart/base/base-chart-transformer.d.ts +21 -0
- package/types/chart/base/base-chart.d.ts +148 -0
- package/types/chart/base/index.d.ts +2 -0
- package/types/chart/box-plot/box-plot-transformer.d.ts +6 -0
- package/types/chart/box-plot/box-plot.d.ts +6 -4
- package/types/chart/box-plot/index.d.ts +1 -0
- package/types/chart/cartesian/cartesian-transformer.d.ts +8 -0
- package/types/chart/cartesian/index.d.ts +1 -1
- package/types/chart/circle-packing/circle-packing-transformer.d.ts +7 -0
- package/types/chart/circle-packing/circle-packing.d.ts +6 -5
- package/types/chart/circle-packing/index.d.ts +1 -0
- package/types/chart/common/common-transformer.d.ts +7 -0
- package/types/chart/common/common.d.ts +7 -4
- package/types/chart/common/index.d.ts +1 -0
- package/types/chart/correlation/correlation-transformer.d.ts +6 -0
- package/types/chart/correlation/correlation.d.ts +6 -4
- package/types/chart/correlation/index.d.ts +1 -0
- package/types/chart/funnel/3d/funnel-3d.d.ts +14 -0
- package/types/chart/funnel/3d/index.d.ts +1 -0
- package/types/chart/funnel/funnel-transformer.d.ts +8 -0
- package/types/chart/funnel/funnel.d.ts +7 -2
- package/types/chart/funnel/index.d.ts +2 -1
- package/types/chart/funnel/interface.d.ts +1 -1
- package/types/chart/gauge/gauge-transformer.d.ts +9 -0
- package/types/chart/gauge/gauge.d.ts +8 -6
- package/types/chart/gauge/index.d.ts +1 -0
- package/types/chart/gauge/interface.d.ts +2 -2
- package/types/chart/heatmap/heatmap-transformer.d.ts +5 -0
- package/types/chart/heatmap/heatmap.d.ts +7 -3
- package/types/chart/heatmap/index.d.ts +1 -0
- package/types/chart/histogram/3d/histogram-3d.d.ts +14 -0
- package/types/chart/histogram/3d/index.d.ts +1 -0
- package/types/chart/histogram/base/base.d.ts +8 -0
- package/types/chart/histogram/base/histogram-base-transformer.d.ts +6 -0
- package/types/chart/histogram/base/index.d.ts +2 -0
- package/types/chart/histogram/histogram-transformer.d.ts +5 -0
- package/types/chart/histogram/histogram.d.ts +7 -3
- package/types/chart/histogram/index.d.ts +2 -1
- package/types/chart/index.d.ts +2 -4
- package/types/chart/interface/chart.d.ts +20 -7
- package/types/chart/interface/common.d.ts +17 -1
- package/types/chart/line/index.d.ts +1 -0
- package/types/chart/line/interface.d.ts +1 -1
- package/types/chart/line/line-transformer.d.ts +6 -0
- package/types/chart/line/line.d.ts +6 -4
- package/types/chart/map/index.d.ts +1 -0
- package/types/chart/map/map-transformer.d.ts +8 -0
- package/types/chart/map/map.d.ts +6 -6
- package/types/chart/pie/3d/index.d.ts +1 -0
- package/types/chart/pie/3d/pie-3d.d.ts +17 -0
- package/types/chart/pie/base/base.d.ts +8 -0
- package/types/chart/pie/base/index.d.ts +2 -0
- package/types/chart/pie/base/pie-transformer.d.ts +7 -0
- package/types/chart/pie/index.d.ts +2 -1
- package/types/chart/pie/pie.d.ts +7 -2
- package/types/chart/polar/index.d.ts +1 -1
- package/types/chart/polar/polar-transformer.d.ts +9 -0
- package/types/chart/polar/progress-like/index.d.ts +1 -0
- package/types/chart/polar/progress-like/progress-like-transformer.d.ts +8 -0
- package/types/chart/polar/rose-like/index.d.ts +1 -0
- package/types/chart/polar/rose-like/rose-like-transformer.d.ts +7 -0
- package/types/chart/progress/circular/circular-progress-transformer.d.ts +7 -0
- package/types/chart/progress/circular/circular.d.ts +8 -4
- package/types/chart/progress/circular/index.d.ts +1 -0
- package/types/chart/progress/circular/interface.d.ts +1 -1
- package/types/chart/progress/linear/index.d.ts +1 -0
- package/types/chart/progress/linear/interface.d.ts +1 -1
- package/types/chart/progress/linear/linear-progress-transformer.d.ts +7 -0
- package/types/chart/progress/linear/linear.d.ts +6 -5
- package/types/chart/radar/index.d.ts +1 -0
- package/types/chart/radar/radar-transformer.d.ts +6 -0
- package/types/chart/radar/radar.d.ts +8 -4
- package/types/chart/range-area/index.d.ts +1 -0
- package/types/chart/range-area/range-area-transformer.d.ts +6 -0
- package/types/chart/range-area/range-area.d.ts +7 -4
- package/types/chart/range-column/3d/index.d.ts +2 -0
- package/types/chart/range-column/3d/range-column-3d-transformer.d.ts +5 -0
- package/types/chart/range-column/3d/range-column-3d.d.ts +13 -0
- package/types/chart/range-column/index.d.ts +2 -1
- package/types/chart/range-column/range-column-transformer.d.ts +6 -0
- package/types/chart/range-column/range-column.d.ts +7 -4
- package/types/chart/rose/index.d.ts +1 -0
- package/types/chart/rose/rose-transformer.d.ts +6 -0
- package/types/chart/rose/rose.d.ts +8 -4
- package/types/chart/sankey/index.d.ts +1 -0
- package/types/chart/sankey/sankey-transformer.d.ts +6 -0
- package/types/chart/sankey/sankey.d.ts +6 -4
- package/types/chart/scatter/index.d.ts +1 -0
- package/types/chart/scatter/scatter-transformer.d.ts +5 -0
- package/types/chart/scatter/scatter.d.ts +6 -3
- package/types/chart/sequence/index.d.ts +1 -0
- package/types/chart/sequence/sequence-transformer.d.ts +7 -0
- package/types/chart/sequence/sequence.d.ts +9 -7
- package/types/chart/sunburst/index.d.ts +1 -0
- package/types/chart/sunburst/sunburst-transformer.d.ts +7 -0
- package/types/chart/sunburst/sunburst.d.ts +6 -5
- package/types/chart/treemap/index.d.ts +1 -0
- package/types/chart/treemap/treemap-transformer.d.ts +7 -0
- package/types/chart/treemap/treemap.d.ts +7 -4
- package/types/chart/util.d.ts +3 -3
- package/types/chart/waterfall/index.d.ts +1 -0
- package/types/chart/waterfall/waterfall-transformer.d.ts +7 -0
- package/types/chart/waterfall/waterfall.d.ts +6 -3
- package/types/chart/word-cloud/3d/index.d.ts +2 -0
- package/types/chart/word-cloud/3d/word-cloud-3d-transformer.d.ts +6 -0
- package/types/chart/word-cloud/3d/word-cloud-3d.d.ts +15 -0
- package/types/chart/word-cloud/base/base.d.ts +9 -0
- package/types/chart/word-cloud/base/index.d.ts +2 -0
- package/types/chart/word-cloud/base/word-cloud-base-transformer.d.ts +5 -0
- package/types/chart/word-cloud/index.d.ts +2 -1
- package/types/chart/word-cloud/word-cloud-transformer.d.ts +5 -0
- package/types/chart/word-cloud/word-cloud.d.ts +6 -3
- package/types/compile/mark/compilable-mark.d.ts +0 -5
- package/types/compile/mark/interface.d.ts +1 -4
- package/types/component/axis/base-axis.d.ts +3 -4
- package/types/component/axis/cartesian/axis.d.ts +6 -7
- package/types/component/axis/cartesian/band-axis.d.ts +1 -0
- package/types/component/axis/cartesian/linear-axis.d.ts +1 -0
- package/types/component/axis/cartesian/log-axis.d.ts +1 -0
- package/types/component/axis/cartesian/symlog-axis.d.ts +1 -0
- package/types/component/axis/cartesian/time-axis.d.ts +1 -0
- package/types/component/axis/cartesian/util/common.d.ts +4 -0
- package/types/component/axis/interface/common.d.ts +1 -0
- package/types/component/axis/polar/axis.d.ts +7 -7
- package/types/component/axis/polar/band-axis.d.ts +1 -0
- package/types/component/axis/polar/interface/common.d.ts +0 -1
- package/types/component/axis/polar/linear-axis.d.ts +1 -0
- package/types/component/axis/polar/util/common.d.ts +5 -0
- package/types/component/axis/polar/util/index.d.ts +1 -0
- package/types/component/axis/util.d.ts +4 -3
- package/types/component/base/base-component-transformer.d.ts +10 -0
- package/types/component/base/base-component.d.ts +10 -7
- package/types/component/base/index.d.ts +1 -0
- package/types/component/base/util.d.ts +2 -2
- package/types/component/brush/brush.d.ts +7 -5
- package/types/component/crosshair/base.d.ts +5 -4
- package/types/component/crosshair/cartesian.d.ts +3 -2
- package/types/component/crosshair/polar.d.ts +3 -2
- package/types/component/crosshair/util.d.ts +3 -4
- package/types/component/custom-mark/custom-mark.d.ts +7 -5
- package/types/component/data-zoom/data-filter-base-component.d.ts +2 -2
- package/types/component/data-zoom/data-zoom/data-zoom-transformer.d.ts +9 -0
- package/types/component/data-zoom/data-zoom/data-zoom.d.ts +8 -2
- package/types/component/data-zoom/data-zoom/index.d.ts +1 -0
- package/types/component/data-zoom/scroll-bar/scroll-bar.d.ts +5 -1
- package/types/component/data-zoom/util.d.ts +2 -2
- package/types/component/geo/geo-coordinate.d.ts +4 -4
- package/types/component/index.d.ts +1 -1
- package/types/component/indicator/indicator.d.ts +5 -4
- package/types/component/interface/common.d.ts +6 -4
- package/types/component/interface/type.d.ts +8 -0
- package/types/component/label/base-label.d.ts +2 -2
- package/types/component/label/index.d.ts +2 -0
- package/types/component/label/interface.d.ts +2 -2
- package/types/component/label/label-transformer.d.ts +8 -0
- package/types/component/label/label.d.ts +13 -5
- package/types/component/label/total-label.d.ts +28 -0
- package/types/component/label/util.d.ts +1 -0
- package/types/component/legend/base-legend.d.ts +3 -1
- package/types/component/legend/continuous/legend.d.ts +4 -6
- package/types/component/legend/discrete/legend.d.ts +4 -7
- package/types/component/map-label/component.d.ts +5 -2
- package/types/component/marker/mark-area/mark-area.d.ts +6 -4
- package/types/component/marker/mark-line/mark-line.d.ts +6 -4
- package/types/component/marker/mark-point/mark-point.d.ts +6 -4
- package/types/component/player/player.d.ts +4 -4
- package/types/component/title/title.d.ts +9 -6
- package/types/component/tooltip/index.d.ts +1 -0
- package/types/component/tooltip/tooltip-transformer.d.ts +8 -0
- package/types/component/tooltip/tooltip.d.ts +10 -8
- package/types/component/util.d.ts +2 -2
- package/types/constant/event.d.ts +1 -0
- package/types/constant/polar.d.ts +0 -10
- package/types/core/factory.d.ts +12 -3
- package/types/core/index.d.ts +1 -0
- package/types/core/interface.d.ts +17 -11
- package/types/core/vchart.d.ts +30 -7
- package/types/mark/arc-3d.d.ts +1 -0
- package/types/model/base-model-transformer.d.ts +24 -0
- package/types/model/base-model.d.ts +9 -12
- package/types/model/index.d.ts +3 -0
- package/types/model/interface.d.ts +31 -4
- package/types/plugin/base/base-plugin-service.d.ts +13 -0
- package/types/plugin/base/base-plugin.d.ts +9 -0
- package/types/plugin/base/interface.d.ts +22 -0
- package/types/plugin/chart/index.d.ts +2 -0
- package/types/plugin/chart/interface.d.ts +22 -2
- package/types/plugin/chart/media-query/index.d.ts +2 -0
- package/types/plugin/chart/media-query/interface/common.d.ts +28 -0
- package/types/plugin/chart/media-query/interface/index.d.ts +2 -0
- package/types/plugin/chart/media-query/interface/spec.d.ts +25 -0
- package/types/plugin/chart/media-query/media-query.d.ts +28 -0
- package/types/plugin/chart/media-query/util/action.d.ts +3 -0
- package/types/plugin/chart/media-query/util/filter.d.ts +4 -0
- package/types/plugin/chart/media-query/util/index.d.ts +2 -0
- package/types/plugin/chart/media-query/util/query.d.ts +3 -0
- package/types/plugin/chart/plugin-service.d.ts +12 -0
- package/types/plugin/chart/register.d.ts +2 -0
- package/types/plugin/components/axis-sync-plugin/axis-sync.d.ts +5 -3
- package/types/plugin/components/interface.d.ts +15 -25
- package/types/plugin/components/plugin-service.d.ts +2 -10
- package/types/plugin/index.d.ts +1 -0
- package/types/region/index.d.ts +3 -0
- package/types/region/interface.d.ts +10 -2
- package/types/region/region-transformer.d.ts +8 -0
- package/types/region/region.d.ts +7 -4
- package/types/series/area/area-transformer.d.ts +5 -0
- package/types/series/area/area.d.ts +5 -3
- package/types/series/bar/bar-transformer.d.ts +5 -0
- package/types/series/bar/bar.d.ts +5 -3
- package/types/series/base/base-series-transformer.d.ts +18 -0
- package/types/series/base/base-series.d.ts +7 -8
- package/types/series/base/index.d.ts +2 -0
- package/types/series/box-plot/box-plot.d.ts +2 -3
- package/types/series/box-plot/interface.d.ts +1 -2
- package/types/series/cartesian/cartesian.d.ts +1 -1
- package/types/series/circle-packing/interface.d.ts +1 -2
- package/types/series/correlation/correlation-transformer.d.ts +5 -0
- package/types/series/correlation/correlation.d.ts +5 -4
- package/types/series/dot/dot.d.ts +2 -3
- package/types/series/funnel/3d/funnel-3d-transformer.d.ts +6 -0
- package/types/series/funnel/3d/funnel-3d.d.ts +22 -0
- package/types/series/funnel/3d/index.d.ts +2 -0
- package/types/series/funnel/funnel-transformer.d.ts +5 -0
- package/types/series/funnel/funnel.d.ts +5 -3
- package/types/series/gauge/gauge-pointer.d.ts +2 -3
- package/types/series/gauge/gauge-transformer.d.ts +5 -0
- package/types/series/gauge/gauge.d.ts +4 -3
- package/types/series/geo/interface.d.ts +1 -1
- package/types/series/heatmap/heatmap-transformer.d.ts +5 -0
- package/types/series/heatmap/heatmap.d.ts +4 -3
- package/types/series/index.d.ts +3 -3
- package/types/series/interface/common.d.ts +11 -6
- package/types/series/interface/series.d.ts +2 -3
- package/types/series/line/line.d.ts +5 -3
- package/types/series/link/link.d.ts +2 -3
- package/types/series/map/map-transformer.d.ts +5 -0
- package/types/series/map/map.d.ts +5 -3
- package/types/series/mixin/line-mixin-transformer.d.ts +5 -0
- package/types/series/mixin/line-mixin.d.ts +1 -2
- package/types/series/pie/3d/index.d.ts +2 -0
- package/types/series/pie/3d/pie-3d-transformer.d.ts +5 -0
- package/types/series/pie/3d/pie-3d.d.ts +20 -0
- package/types/series/pie/interface.d.ts +3 -0
- package/types/series/pie/pie-transformer.d.ts +9 -0
- package/types/series/pie/pie.d.ts +6 -13
- package/types/series/polar/index.d.ts +3 -0
- package/types/series/polar/polar.d.ts +0 -2
- package/types/series/progress/circular/circular.d.ts +2 -3
- package/types/series/progress/linear/linear.d.ts +1 -3
- package/types/series/radar/radar.d.ts +5 -3
- package/types/series/range-column/3d/index.d.ts +2 -0
- package/types/series/range-column/3d/range-column-3d-transformer.d.ts +5 -0
- package/types/series/range-column/3d/range-column-3d.d.ts +15 -0
- package/types/series/range-column/range-column-transformer.d.ts +5 -0
- package/types/series/range-column/range-column.d.ts +2 -0
- package/types/series/rose/rose-transformer.d.ts +5 -0
- package/types/series/rose/rose.d.ts +4 -3
- package/types/series/scatter/scatter-transformer.d.ts +5 -0
- package/types/series/scatter/scatter.d.ts +5 -3
- package/types/series/sunburst/sunburst.d.ts +1 -1
- package/types/series/waterfall/waterfall-transformer.d.ts +5 -0
- package/types/series/waterfall/waterfall.d.ts +4 -3
- package/types/typings/spec/common.d.ts +2 -0
- package/types/util/color.d.ts +1 -3
|
@@ -14,10 +14,13 @@ import type { StateValueType } from '../typings/spec';
|
|
|
14
14
|
import type { ICompilable, ICompilableInitOption } from '../compile/interface';
|
|
15
15
|
import type { ICompilableData } from '../compile/data';
|
|
16
16
|
import type { IGlobalScale } from '../scale/interface';
|
|
17
|
-
import type { IChart } from '../chart/interface';
|
|
17
|
+
import type { IChart, IChartSpecInfo } from '../chart/interface';
|
|
18
18
|
import type { IThemeColorScheme } from '../theme/color-scheme/interface';
|
|
19
19
|
import type { ILayoutItem, ILayoutItemSpec } from '../layout/interface';
|
|
20
20
|
import type { ILayoutPoint, ILayoutRect } from '../typings/layout';
|
|
21
|
+
import type { ComponentTypeEnum } from '../component/interface';
|
|
22
|
+
import type { SeriesMarkNameEnum, SeriesTypeEnum } from '../series';
|
|
23
|
+
import type { TransformedLabelSpec } from '../component/label';
|
|
21
24
|
export interface IModelInitOption {
|
|
22
25
|
}
|
|
23
26
|
export interface IModelLayoutOption {
|
|
@@ -49,6 +52,7 @@ export interface IModel extends ICompilable {
|
|
|
49
52
|
readonly modelType: string;
|
|
50
53
|
readonly type: string;
|
|
51
54
|
readonly specKey: string;
|
|
55
|
+
readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;
|
|
52
56
|
readonly id: number;
|
|
53
57
|
readonly userId?: StringOrNumber;
|
|
54
58
|
readonly event: IEvent;
|
|
@@ -64,7 +68,7 @@ export interface IModel extends ICompilable {
|
|
|
64
68
|
getChart: () => IChart;
|
|
65
69
|
created: () => void;
|
|
66
70
|
init: (option: IModelInitOption) => void;
|
|
67
|
-
reInit: (
|
|
71
|
+
reInit: (spec?: any) => void;
|
|
68
72
|
beforeRelease: () => void;
|
|
69
73
|
onEvaluateEnd: (ctx: IModelEvaluateOption) => void;
|
|
70
74
|
onRender: (ctx: IModelRenderOption) => void;
|
|
@@ -72,12 +76,13 @@ export interface IModel extends ICompilable {
|
|
|
72
76
|
updateSpec: (spec: any, totalSpec?: any) => IUpdateSpecResult;
|
|
73
77
|
getSpec?: () => any;
|
|
74
78
|
getSpecIndex: () => number;
|
|
79
|
+
getSpecPath: () => Array<string | number>;
|
|
75
80
|
onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect, ctx: IModelLayoutOption) => void;
|
|
76
81
|
onLayoutEnd: (ctx: IModelLayoutOption) => void;
|
|
77
|
-
setCurrentTheme: () => void;
|
|
78
82
|
getColorScheme: () => IThemeColorScheme | undefined;
|
|
79
83
|
setMarkStyle: <T extends ICommonSpec>(mark?: IMarkRaw<T>, style?: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>, state?: StateValueType, level?: number) => void;
|
|
80
84
|
initMarkStyleWithSpec: (mark?: IMark, spec?: any, key?: string) => void;
|
|
85
|
+
getSpecInfo: () => IModelSpecInfo;
|
|
81
86
|
}
|
|
82
87
|
export interface ILayoutModel extends IModel {
|
|
83
88
|
getLayoutStartPoint: () => IPoint;
|
|
@@ -97,7 +102,9 @@ export interface IModelOption extends ICompilableInitOption {
|
|
|
97
102
|
globalInstance: VChart;
|
|
98
103
|
specIndex?: number;
|
|
99
104
|
specKey?: string;
|
|
105
|
+
specPath?: Array<string | number>;
|
|
100
106
|
getTheme?: () => ITheme;
|
|
107
|
+
getSpecInfo?: () => IChartSpecInfo;
|
|
101
108
|
getChartLayoutRect: () => IRect;
|
|
102
109
|
getChartViewRect: () => ILayoutRect;
|
|
103
110
|
getChart: () => IChart;
|
|
@@ -106,8 +113,15 @@ export interface IModelOption extends ICompilableInitOption {
|
|
|
106
113
|
animation: boolean;
|
|
107
114
|
onError: (...args: any[]) => void;
|
|
108
115
|
}
|
|
116
|
+
export interface IModelSpecInfo<T extends Record<string, unknown> = any> {
|
|
117
|
+
type: string | ComponentTypeEnum | SeriesTypeEnum;
|
|
118
|
+
spec: T;
|
|
119
|
+
specPath?: Array<string | number>;
|
|
120
|
+
specIndex?: number;
|
|
121
|
+
theme?: any;
|
|
122
|
+
}
|
|
109
123
|
export interface IModelConstructor {
|
|
110
|
-
new (
|
|
124
|
+
readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;
|
|
111
125
|
}
|
|
112
126
|
export type ILayoutModelState = {
|
|
113
127
|
layoutUpdateRank: number;
|
|
@@ -120,3 +134,16 @@ export interface IModelMarkInfo {
|
|
|
120
134
|
type: MarkTypeEnum | string | (MarkTypeEnum | string)[];
|
|
121
135
|
name: string;
|
|
122
136
|
}
|
|
137
|
+
export interface IBaseModelSpecTransformerOption {
|
|
138
|
+
type: string;
|
|
139
|
+
getTheme: () => ITheme;
|
|
140
|
+
}
|
|
141
|
+
export interface IBaseModelSpecTransformerResult<T, K> {
|
|
142
|
+
spec: T;
|
|
143
|
+
theme: K;
|
|
144
|
+
markLabelSpec?: Partial<Record<SeriesMarkNameEnum, TransformedLabelSpec[]>>;
|
|
145
|
+
}
|
|
146
|
+
export interface IBaseModelSpecTransformer {
|
|
147
|
+
getTheme: (spec: any, chartSpec: any) => any;
|
|
148
|
+
transformSpec: (spec: any, chartSpec: any, chartSpecInfo?: IChartSpecInfo) => IBaseModelSpecTransformerResult<any, any>;
|
|
149
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IBasePlugin, IBasePluginService } from './interface';
|
|
2
|
+
export declare class BasePluginService<T extends IBasePlugin = IBasePlugin> implements IBasePluginService<T> {
|
|
3
|
+
protected _plugins: T[];
|
|
4
|
+
readonly id: number;
|
|
5
|
+
constructor();
|
|
6
|
+
add(plugins: T[]): T[] | null;
|
|
7
|
+
load(plugins: T[]): void;
|
|
8
|
+
activate(plugins: T[]): void;
|
|
9
|
+
get(id: number): T | undefined;
|
|
10
|
+
getAll(): T[];
|
|
11
|
+
dispose(pluginsId: number): void;
|
|
12
|
+
disposeAll(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IBasePlugin, IBasePluginService } from './interface';
|
|
2
|
+
export declare class BasePlugin<T extends IBasePluginService = IBasePluginService> implements IBasePlugin<T> {
|
|
3
|
+
readonly id: number;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly type: string;
|
|
6
|
+
protected service?: T;
|
|
7
|
+
constructor(type: string);
|
|
8
|
+
onAdd(service: T): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IBasePlugin<T = any> {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
id: UniqueId;
|
|
4
|
+
name: string;
|
|
5
|
+
onAdd: (service: T) => void;
|
|
6
|
+
init?: () => void;
|
|
7
|
+
dispose?: (service: T) => void;
|
|
8
|
+
onInit?: (service: T, ...params: any) => MaybePromise<void>;
|
|
9
|
+
onDidCompile?: (service: T, ...params: any) => MaybePromise<void>;
|
|
10
|
+
}
|
|
11
|
+
export interface IBasePluginService<T = any> {
|
|
12
|
+
id: UniqueId;
|
|
13
|
+
load: (plugins: T[]) => void;
|
|
14
|
+
add: (plugins: T[]) => T[] | null;
|
|
15
|
+
activate: (plugins: T[]) => void;
|
|
16
|
+
get: (id: UniqueId) => T | undefined;
|
|
17
|
+
getAll: () => T[];
|
|
18
|
+
dispose: (pluginsId: UniqueId) => void;
|
|
19
|
+
disposeAll: () => void;
|
|
20
|
+
}
|
|
21
|
+
export type UniqueId = number;
|
|
22
|
+
export type MaybePromise<T> = T | PromiseLike<T>;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import type { IChartSpecInfo } from '../../chart/interface';
|
|
2
|
+
import type { IVChart } from '../../core';
|
|
3
|
+
import type { VChartRenderActionSource } from '../../core/interface';
|
|
4
|
+
import type { IBasePlugin, IBasePluginService, MaybePromise } from '../base/interface';
|
|
5
|
+
export interface IChartPlugin<T extends IChartPluginService = any> extends IBasePlugin<T> {
|
|
6
|
+
specKey?: string;
|
|
7
|
+
onInit?: (service: T, chartSpec: any) => MaybePromise<void>;
|
|
8
|
+
onBeforeResize?: (service: T, width: number, height: number) => MaybePromise<void>;
|
|
9
|
+
onAfterChartSpecTransform?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
10
|
+
onAfterModelSpecTransform?: (service: T, chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
11
|
+
onBeforeInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
2
12
|
}
|
|
3
13
|
export interface IChartPluginConstructor {
|
|
4
|
-
readonly
|
|
14
|
+
readonly pluginType: 'chart';
|
|
15
|
+
readonly specKey?: string;
|
|
16
|
+
readonly type: string;
|
|
5
17
|
new (): IChartPlugin;
|
|
6
18
|
}
|
|
19
|
+
export interface IChartPluginService<T extends IChartPlugin = any> extends IBasePluginService<T> {
|
|
20
|
+
globalInstance: IVChart;
|
|
21
|
+
onInit?: (chartSpec: any) => MaybePromise<void>;
|
|
22
|
+
onBeforeResize?: (width: number, height: number) => MaybePromise<void>;
|
|
23
|
+
onAfterChartSpecTransform?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
24
|
+
onAfterModelSpecTransform?: (chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
25
|
+
onBeforeInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentTypeEnum } from '../../../../component/interface';
|
|
2
|
+
import type { IVChart } from '../../../../core';
|
|
3
|
+
import type { IModelSpecInfo } from '../../../../model/interface';
|
|
4
|
+
import type { SeriesTypeEnum } from '../../../../series';
|
|
5
|
+
import type { IChartSpec } from '../../../../typings';
|
|
6
|
+
export interface IMediaInfo {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
export interface IMediaQueryActionFilterResult<T extends Record<string, unknown> = any> {
|
|
11
|
+
isChart?: boolean;
|
|
12
|
+
modelType?: 'series' | 'region' | 'component';
|
|
13
|
+
type?: SeriesTypeEnum | ComponentTypeEnum;
|
|
14
|
+
specKey?: keyof IChartSpec;
|
|
15
|
+
modelInfo: IModelSpecInfo<T>[];
|
|
16
|
+
}
|
|
17
|
+
export interface IMediaQueryOption {
|
|
18
|
+
globalInstance: IVChart;
|
|
19
|
+
updateSpec: (spec: any, compile?: boolean, render?: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface IMediaQueryCheckResult {
|
|
22
|
+
isActive: boolean;
|
|
23
|
+
hasChanged: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface IMediaQueryActionResult {
|
|
26
|
+
chartSpec: any;
|
|
27
|
+
hasChanged: boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComponentTypeEnum, SimplifiedComponentTypeEnum } from '../../../../component/interface';
|
|
2
|
+
import type { IVChart } from '../../../../core';
|
|
3
|
+
import type { IModelSpecInfo } from '../../../../model/interface';
|
|
4
|
+
import type { SeriesTypeEnum } from '../../../../series';
|
|
5
|
+
import type { IMediaInfo } from './common';
|
|
6
|
+
export type IMediaQuerySpec = IMediaQueryItem[];
|
|
7
|
+
export interface IMediaQueryItem {
|
|
8
|
+
query: IMediaQueryCondition;
|
|
9
|
+
action: IMediaQueryAction | IMediaQueryAction[];
|
|
10
|
+
}
|
|
11
|
+
export interface IMediaQueryCondition {
|
|
12
|
+
minWidth?: number;
|
|
13
|
+
maxWidth?: number;
|
|
14
|
+
minHeight?: number;
|
|
15
|
+
maxHeight?: number;
|
|
16
|
+
onResize?: (info: IMediaInfo, vchart: IVChart) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IMediaQueryAction<T extends Record<string, unknown> = any> {
|
|
19
|
+
spec: Partial<T> | ((filteredModelInfo: IModelSpecInfo<T>[], action: IMediaQueryAction<T>, query: IMediaQueryCondition) => Partial<T>);
|
|
20
|
+
filterType?: MediaQueryActionFilterType;
|
|
21
|
+
filter?: MediaQueryActionFilter<T>;
|
|
22
|
+
forceAppend?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type MediaQueryActionFilterType = 'region' | 'series' | 'chart' | `${SeriesTypeEnum}` | `${ComponentTypeEnum}` | `${SimplifiedComponentTypeEnum}`;
|
|
25
|
+
export type MediaQueryActionFilter<T extends Record<string, unknown> = any> = Partial<T> | ((modelInfo: IModelSpecInfo<T>, action: IMediaQueryAction<T>, query: IMediaQueryCondition) => boolean);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IMediaInfo, IMediaQueryCheckResult, IMediaQuerySpec, IMediaQueryOption, IMediaQueryItem, IMediaQueryActionResult } from './interface';
|
|
2
|
+
import type { IChartPlugin, IChartPluginService } from '../interface';
|
|
3
|
+
import type { VChartRenderActionSource } from '../../../core/interface';
|
|
4
|
+
import { BasePlugin } from '../../base/base-plugin';
|
|
5
|
+
export declare class MediaQuery extends BasePlugin implements IChartPlugin {
|
|
6
|
+
static readonly pluginType: 'chart';
|
|
7
|
+
static readonly specKey = "media";
|
|
8
|
+
static readonly type: string;
|
|
9
|
+
readonly type: string;
|
|
10
|
+
protected _spec: IMediaQuerySpec;
|
|
11
|
+
protected _option: IMediaQueryOption;
|
|
12
|
+
protected _baseChartSpec: any;
|
|
13
|
+
protected _currentMediaInfo: Partial<IMediaInfo>;
|
|
14
|
+
readonly currentActiveItems: Set<IMediaQueryItem>;
|
|
15
|
+
protected _initialized: boolean;
|
|
16
|
+
constructor();
|
|
17
|
+
onInit(service: IChartPluginService, chartSpec: any): void;
|
|
18
|
+
onBeforeResize(service: IChartPluginService, width: number, height: number): void;
|
|
19
|
+
onAfterChartSpecTransform(service: IChartPluginService, chartSpec: any, actionSource: VChartRenderActionSource): void;
|
|
20
|
+
onBeforeInitChart(service: IChartPluginService, chartSpec: any, actionSource: VChartRenderActionSource): void;
|
|
21
|
+
changeSize(width: number, height: number, compile?: boolean, render?: boolean): boolean;
|
|
22
|
+
protected _applyQueries(compile?: boolean, render?: boolean): boolean;
|
|
23
|
+
check(item: IMediaQueryItem): IMediaQueryCheckResult;
|
|
24
|
+
apply(item: IMediaQueryItem, chartSpec: any): IMediaQueryActionResult;
|
|
25
|
+
reInit(compile?: boolean, render?: boolean): void;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare const registerMediaQuery: () => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IVChart } from '../../../../core';
|
|
2
|
+
import type { IMediaQueryAction, IMediaQueryCondition, IMediaQueryActionResult } from '../interface';
|
|
3
|
+
export declare const executeMediaQueryAction: <T extends Record<string, unknown>>(action: IMediaQueryAction<T>, query: IMediaQueryCondition, chartSpec: any, globalInstance: IVChart) => IMediaQueryActionResult;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IVChart } from '../../../../core';
|
|
2
|
+
import type { IMediaQueryAction, IMediaQueryActionFilterResult, IMediaQueryCondition, MediaQueryActionFilter, MediaQueryActionFilterType } from '../interface';
|
|
3
|
+
export declare const executeMediaQueryActionFilter: <T extends Record<string, unknown>>(filterType: MediaQueryActionFilterType, filter: MediaQueryActionFilter<T>, action: IMediaQueryAction<T>, query: IMediaQueryCondition, chartSpec: any, globalInstance: IVChart) => IMediaQueryActionFilterResult;
|
|
4
|
+
export declare const executeMediaQueryActionFilterType: <T extends Record<string, unknown>>(filterType: MediaQueryActionFilterType, chartSpec: any, globalInstance: IVChart) => IMediaQueryActionFilterResult<T>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IChartPlugin, IChartPluginService } from './interface';
|
|
2
|
+
import type { IVChart } from '../../core';
|
|
3
|
+
import { BasePluginService } from '../base/base-plugin-service';
|
|
4
|
+
import type { VChartRenderActionSource } from '../../core/interface';
|
|
5
|
+
export declare class ChartPluginService<T extends IChartPlugin = IChartPlugin> extends BasePluginService<T> implements IChartPluginService<T> {
|
|
6
|
+
globalInstance: IVChart;
|
|
7
|
+
constructor(globalInstance: IVChart);
|
|
8
|
+
onInit(chartSpec: any): void;
|
|
9
|
+
onBeforeResize(width: number, height: number): void;
|
|
10
|
+
onAfterChartSpecTransform(chartSpec: any, actionSource: VChartRenderActionSource): void;
|
|
11
|
+
onBeforeInitChart(chartSpec: any, actionSource: VChartRenderActionSource): void;
|
|
12
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { BasicComponentPlugin } from '../basic-plugin';
|
|
2
1
|
import type { IComponentPlugin, IComponentPluginService } from '../interface';
|
|
3
2
|
import type { CartesianAxis, ILinearAxisSync } from '../../../component/axis/cartesian';
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
6
8
|
constructor();
|
|
7
9
|
protected _checkEnableSync(axis: CartesianAxis): ILinearAxisSync | false;
|
|
8
10
|
private _getTargetAxis;
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
import type { IComponent } from '../../component/interface';
|
|
2
|
-
type
|
|
3
|
-
type MaybePromise<T> = T | PromiseLike<T>;
|
|
2
|
+
import type { IBasePlugin, IBasePluginService, MaybePromise } from '../base/interface';
|
|
4
3
|
interface IContext {
|
|
5
4
|
skipLayout: boolean;
|
|
6
5
|
}
|
|
7
|
-
export interface IComponentPlugin {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onDidCompile?: (service: IComponentPluginService, ...params: any) => MaybePromise<void>;
|
|
15
|
-
onWillLayout?: (service: IComponentPluginService, ...params: any) => MaybePromise<void>;
|
|
16
|
-
onDidLayout?: (service: IComponentPluginService, ...params: any) => MaybePromise<void>;
|
|
17
|
-
onWillLayoutVertical?: (service: IComponentPluginService, context: IContext, ...params: any) => MaybePromise<void>;
|
|
18
|
-
onWillLayoutHorizontal?: (service: IComponentPluginService, context: IContext, ...params: any) => MaybePromise<void>;
|
|
19
|
-
onDidLayoutVertical?: (service: IComponentPluginService, ...params: any) => MaybePromise<void>;
|
|
20
|
-
onDidLayoutHorizontal?: (service: IComponentPluginService, ...params: any) => MaybePromise<void>;
|
|
6
|
+
export interface IComponentPlugin<T extends IComponentPluginService = any> extends IBasePlugin<T> {
|
|
7
|
+
onWillLayout?: (service: T, ...params: any) => MaybePromise<void>;
|
|
8
|
+
onDidLayout?: (service: T, ...params: any) => MaybePromise<void>;
|
|
9
|
+
onWillLayoutVertical?: (service: T, context: IContext, ...params: any) => MaybePromise<void>;
|
|
10
|
+
onWillLayoutHorizontal?: (service: T, context: IContext, ...params: any) => MaybePromise<void>;
|
|
11
|
+
onDidLayoutVertical?: (service: T, ...params: any) => MaybePromise<void>;
|
|
12
|
+
onDidLayoutHorizontal?: (service: T, ...params: any) => MaybePromise<void>;
|
|
21
13
|
}
|
|
22
|
-
export interface
|
|
23
|
-
|
|
14
|
+
export interface IComponentPluginConstructor {
|
|
15
|
+
readonly pluginType: 'component';
|
|
16
|
+
readonly specKey?: string;
|
|
17
|
+
readonly type: string;
|
|
18
|
+
new (): IComponentPlugin;
|
|
19
|
+
}
|
|
20
|
+
export interface IComponentPluginService<T extends IComponentPlugin = any> extends IBasePluginService<T> {
|
|
24
21
|
component: IComponent;
|
|
25
|
-
load: (plugins: IComponentPlugin[]) => void;
|
|
26
|
-
add: (plugins: IComponentPlugin[]) => IComponentPlugin[] | null;
|
|
27
|
-
activate: (plugins: IComponentPlugin[]) => void;
|
|
28
|
-
get: (id: UniqueId) => IComponentPlugin | undefined;
|
|
29
|
-
getAll: () => IComponentPlugin[];
|
|
30
|
-
dispose: (pluginsId: UniqueId) => void;
|
|
31
|
-
disposeAll: () => void;
|
|
32
22
|
}
|
|
33
23
|
export {};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import type { IComponentPlugin, IComponentPluginService } from './interface';
|
|
2
2
|
import type { IComponent } from '../../component/interface';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly id: number;
|
|
3
|
+
import { BasePluginService } from '../base/base-plugin-service';
|
|
4
|
+
export declare class ComponentPluginService<T extends IComponentPlugin = IComponentPlugin> extends BasePluginService<T> implements IComponentPluginService<T> {
|
|
6
5
|
component: IComponent;
|
|
7
6
|
constructor(component: IComponent);
|
|
8
|
-
add(plugins: IComponentPlugin[]): IComponentPlugin[] | null;
|
|
9
|
-
load(plugins: IComponentPlugin[]): void;
|
|
10
|
-
activate(plugins: IComponentPlugin[]): void;
|
|
11
|
-
get(id: number): IComponentPlugin | undefined;
|
|
12
|
-
getAll(): IComponentPlugin[];
|
|
13
|
-
dispose(pluginsId: number): void;
|
|
14
|
-
disposeAll(): void;
|
|
15
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './chart';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IMark } from '../mark/interface';
|
|
2
|
-
import type { ILayoutModel, IModelOption } from '../model/interface';
|
|
2
|
+
import type { ILayoutModel, IModelConstructor, IModelOption, IModelSpecInfo } from '../model/interface';
|
|
3
3
|
import type { ISeries, SeriesType } from '../series/interface';
|
|
4
4
|
import type { CoordinateType } from '../typings/coordinate';
|
|
5
5
|
import type { IInteraction } from '../interaction/interface';
|
|
@@ -29,6 +29,7 @@ export interface IRegion extends ILayoutModel {
|
|
|
29
29
|
getMarks: () => IMark[];
|
|
30
30
|
getGroupMark: () => IGroupMark;
|
|
31
31
|
getInteractionMark: () => IGroupMark;
|
|
32
|
+
getSpecInfo: () => IRegionSpecInfo;
|
|
32
33
|
}
|
|
33
34
|
export type ISeriesFilter = {
|
|
34
35
|
name?: string;
|
|
@@ -39,7 +40,7 @@ export type ISeriesFilter = {
|
|
|
39
40
|
coordinateType?: CoordinateType;
|
|
40
41
|
dataName?: string;
|
|
41
42
|
};
|
|
42
|
-
export interface IRegionConstructor {
|
|
43
|
+
export interface IRegionConstructor extends IModelConstructor {
|
|
43
44
|
new (spec: IRegionSpec, ctx: IModelOption): IRegion;
|
|
44
45
|
}
|
|
45
46
|
export interface IRegionSpec extends ILayoutItemSpec {
|
|
@@ -59,3 +60,10 @@ export interface IGeoRegionSpec extends IRegionSpec {
|
|
|
59
60
|
max?: number;
|
|
60
61
|
};
|
|
61
62
|
}
|
|
63
|
+
export interface IRegionSpecInfo<T extends IRegionSpec = IRegionSpec> extends IModelSpecInfo {
|
|
64
|
+
type: 'region';
|
|
65
|
+
spec: T;
|
|
66
|
+
seriesIndexes?: number[];
|
|
67
|
+
markLabel?: IModelSpecInfo;
|
|
68
|
+
geoCoordinate?: IModelSpecInfo;
|
|
69
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseModelSpecTransformer } from '../model/base-model-transformer';
|
|
2
|
+
import type { IRegionSpec } from './interface';
|
|
3
|
+
export declare class RegionSpecTransformer<T extends IRegionSpec = IRegionSpec, K extends Partial<IRegionSpec> = Partial<IRegionSpec>> extends BaseModelSpecTransformer<T, K> {
|
|
4
|
+
protected _initTheme(spec: T, chartSpec: any): {
|
|
5
|
+
spec: T;
|
|
6
|
+
theme: K;
|
|
7
|
+
};
|
|
8
|
+
}
|
package/types/region/region.d.ts
CHANGED
|
@@ -2,15 +2,18 @@ import type { IGroupMark as IVGrammarGroupMark } from '@visactor/vgrammar-core';
|
|
|
2
2
|
import type { ISeries } from '../series/interface';
|
|
3
3
|
import type { IModelOption } from '../model/interface';
|
|
4
4
|
import type { CoordinateType } from '../typings/coordinate';
|
|
5
|
-
import type { IRegion, IRegionSpec } from './interface';
|
|
5
|
+
import type { IRegion, IRegionSpec, IRegionSpecInfo } from './interface';
|
|
6
6
|
import type { IGroupMark } from '../mark/group';
|
|
7
7
|
import type { IInteraction, ITrigger } from '../interaction/interface';
|
|
8
8
|
import type { IRectMark } from '../mark/rect';
|
|
9
9
|
import type { IAnimate } from '../animation/interface';
|
|
10
10
|
import type { ILayoutType, StringOrNumber } from '../typings';
|
|
11
11
|
import { LayoutModel } from '../model/layout-model';
|
|
12
|
+
import { RegionSpecTransformer } from './region-transformer';
|
|
12
13
|
export declare class Region<T extends IRegionSpec = IRegionSpec> extends LayoutModel<T> implements IRegion {
|
|
13
14
|
static type: string;
|
|
15
|
+
static readonly transformerConstructor: typeof RegionSpecTransformer;
|
|
16
|
+
readonly transformerConstructor: any;
|
|
14
17
|
readonly modelType: string;
|
|
15
18
|
type: string;
|
|
16
19
|
protected _series: ISeries[];
|
|
@@ -18,6 +21,7 @@ export declare class Region<T extends IRegionSpec = IRegionSpec> extends LayoutM
|
|
|
18
21
|
layoutZIndex: number;
|
|
19
22
|
animate?: IAnimate;
|
|
20
23
|
interaction: IInteraction;
|
|
24
|
+
getSpecInfo: () => IRegionSpecInfo;
|
|
21
25
|
getMaxWidth(): number;
|
|
22
26
|
setMaxWidth(value: number): void;
|
|
23
27
|
getMaxHeight(): number;
|
|
@@ -32,21 +36,20 @@ export declare class Region<T extends IRegionSpec = IRegionSpec> extends LayoutM
|
|
|
32
36
|
protected _trigger: ITrigger;
|
|
33
37
|
constructor(spec: T, ctx: IModelOption);
|
|
34
38
|
protected _getClipDefaultValue(): boolean;
|
|
35
|
-
_initTheme(): void;
|
|
36
39
|
created(): void;
|
|
37
40
|
private _createGroupMark;
|
|
38
41
|
init(option: any): void;
|
|
39
42
|
initMark(): void;
|
|
40
43
|
protected _initBackgroundMarkStyle(): void;
|
|
41
44
|
protected _initForegroundMarkStyle(): void;
|
|
42
|
-
_compareSpec(): {
|
|
45
|
+
_compareSpec(spec: T, prevSpec: T): {
|
|
43
46
|
change: boolean;
|
|
44
47
|
reMake: boolean;
|
|
45
48
|
reRender: boolean;
|
|
46
49
|
reSize: boolean;
|
|
47
50
|
reCompile: boolean;
|
|
48
51
|
};
|
|
49
|
-
reInit(
|
|
52
|
+
reInit(spec?: T): void;
|
|
50
53
|
addSeries(s: ISeries): void;
|
|
51
54
|
removeSeries(s: ISeries): void;
|
|
52
55
|
getSeries(opt?: {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LineLikeSeriesSpecTransformer } from '../mixin/line-mixin-transformer';
|
|
2
|
+
import type { IAreaSeriesSpec, IAreaSeriesTheme } from './interface';
|
|
3
|
+
export declare class AreaSeriesSpecTransformer<T extends IAreaSeriesSpec = IAreaSeriesSpec, K extends IAreaSeriesTheme = IAreaSeriesTheme> extends LineLikeSeriesSpecTransformer<T, K> {
|
|
4
|
+
protected _transformLabelSpec(spec: T): void;
|
|
5
|
+
}
|
|
@@ -2,18 +2,20 @@ import type { DataView } from '@visactor/vdataset';
|
|
|
2
2
|
import { LineLikeSeriesMixin } from '../mixin/line-mixin';
|
|
3
3
|
import type { IAreaMark } from '../../mark/area';
|
|
4
4
|
import { CartesianSeries } from '../cartesian/cartesian';
|
|
5
|
-
import type {
|
|
5
|
+
import type { Datum } from '../../typings';
|
|
6
6
|
import type { SeriesMarkMap } from '../interface';
|
|
7
7
|
import { SeriesTypeEnum } from '../interface/type';
|
|
8
|
-
import type { IAreaSeriesSpec
|
|
8
|
+
import type { IAreaSeriesSpec } from './interface';
|
|
9
9
|
import type { IMark } from '../../mark/interface';
|
|
10
|
+
import { AreaSeriesSpecTransformer } from './area-transformer';
|
|
10
11
|
export interface AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> extends Pick<LineLikeSeriesMixin, 'initLineMark' | 'initSymbolMark' | 'initLabelMarkStyle' | 'initLineMarkStyle' | 'initSymbolMarkStyle' | 'encodeDefined' | '_lineMark' | '_symbolMark' | 'addSamplingCompile' | 'addOverlapCompile' | 'reCompileSampling' | 'initLineLabelMarkStyle'>, CartesianSeries<T> {
|
|
11
12
|
}
|
|
12
13
|
export declare class AreaSeries<T extends IAreaSeriesSpec = IAreaSeriesSpec> extends CartesianSeries<T> {
|
|
13
14
|
static readonly type: string;
|
|
14
15
|
type: SeriesTypeEnum;
|
|
15
16
|
static readonly mark: SeriesMarkMap;
|
|
16
|
-
|
|
17
|
+
static readonly transformerConstructor: any;
|
|
18
|
+
readonly transformerConstructor: typeof AreaSeriesSpecTransformer;
|
|
17
19
|
protected _areaMark: IAreaMark;
|
|
18
20
|
protected _supportStack: boolean;
|
|
19
21
|
protected _sortDataByAxis: boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseSeriesSpecTransformer } from '../base';
|
|
2
|
+
import type { IBarSeriesSpec, IBarSeriesTheme } from './interface';
|
|
3
|
+
export declare class BarSeriesSpecTransformer<T extends IBarSeriesSpec = IBarSeriesSpec, K extends IBarSeriesTheme = IBarSeriesTheme> extends BaseSeriesSpecTransformer<T, K> {
|
|
4
|
+
protected _transformLabelSpec(spec: T): void;
|
|
5
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CartesianSeries } from '../cartesian/cartesian';
|
|
2
2
|
import type { IMark, IMarkProgressiveConfig } from '../../mark/interface';
|
|
3
3
|
import { MarkTypeEnum } from '../../mark/interface/type';
|
|
4
|
-
import type {
|
|
5
|
-
import type { IBarSeriesSpec
|
|
4
|
+
import type { Datum, DirectionType } from '../../typings';
|
|
5
|
+
import type { IBarSeriesSpec } from './interface';
|
|
6
6
|
import type { IAxisHelper } from '../../component/axis/cartesian/interface';
|
|
7
7
|
import type { IRectMark } from '../../mark/rect';
|
|
8
8
|
import type { IModelInitOption } from '../../model/interface';
|
|
@@ -11,6 +11,7 @@ import type { SeriesMarkMap } from '../interface';
|
|
|
11
11
|
import { SeriesMarkNameEnum, SeriesTypeEnum } from '../interface/type';
|
|
12
12
|
import { SeriesData } from '../base/series-data';
|
|
13
13
|
import { DataView } from '@visactor/vdataset';
|
|
14
|
+
import { BarSeriesSpecTransformer } from './bar-transformer';
|
|
14
15
|
export declare const DefaultBandWidth = 6;
|
|
15
16
|
export declare class BarSeries<T extends IBarSeriesSpec = IBarSeriesSpec> extends CartesianSeries<T> {
|
|
16
17
|
static readonly type: string;
|
|
@@ -18,7 +19,8 @@ export declare class BarSeries<T extends IBarSeriesSpec = IBarSeriesSpec> extend
|
|
|
18
19
|
protected _barMarkName: SeriesMarkNameEnum;
|
|
19
20
|
protected _barMarkType: MarkTypeEnum;
|
|
20
21
|
static readonly mark: SeriesMarkMap;
|
|
21
|
-
|
|
22
|
+
static readonly transformerConstructor: any;
|
|
23
|
+
readonly transformerConstructor: typeof BarSeriesSpecTransformer;
|
|
22
24
|
protected _supportStack: boolean;
|
|
23
25
|
protected _bandPosition: number;
|
|
24
26
|
protected _barMark: IRectMark;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IChartSpecInfo } from '../../chart/interface';
|
|
2
|
+
import type { TransformedLabelSpec } from '../../component/label';
|
|
3
|
+
import type { IBaseModelSpecTransformerResult } from '../../model/interface';
|
|
4
|
+
import { BaseModelSpecTransformer } from '../../model/base-model-transformer';
|
|
5
|
+
import type { ISeriesSpec } from '../../typings';
|
|
6
|
+
import type { SeriesMarkNameEnum } from '../interface';
|
|
7
|
+
import type { ISeries } from '../interface';
|
|
8
|
+
export declare class BaseSeriesSpecTransformer<T extends ISeriesSpec, K> extends BaseModelSpecTransformer<T, K> {
|
|
9
|
+
markLabelSpec: Partial<Record<SeriesMarkNameEnum, TransformedLabelSpec[]>>;
|
|
10
|
+
getLabelSpec(markName: string): any;
|
|
11
|
+
setLabelSpec(markName: string, label: TransformedLabelSpec | TransformedLabelSpec[]): void;
|
|
12
|
+
addLabelSpec(markName: string, label: TransformedLabelSpec, head?: boolean): void;
|
|
13
|
+
getTheme(spec: T, chartSpec: any): K;
|
|
14
|
+
transformSpec(spec: T, chartSpec: any, chartSpecInfo?: IChartSpecInfo): IBaseModelSpecTransformerResult<T, K>;
|
|
15
|
+
protected _transformLabelSpec(spec: T): void;
|
|
16
|
+
protected _addMarkLabelSpec<V extends ISeries = ISeries>(spec: T, markName: SeriesMarkNameEnum, labelSpecKey?: keyof T, styleHandlerName?: keyof V, hasAnimation?: boolean, head?: boolean): void;
|
|
17
|
+
protected _getDefaultSpecFromChart(chartSpec: any): any;
|
|
18
|
+
}
|