@visactor/vchart-types 0.10.0-alpha.3 → 0.11.6-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/types/animation/config.d.ts +1 -0
- package/types/animation/utils.d.ts +4 -4
- package/types/chart/area/area.d.ts +0 -1
- package/types/chart/bar/3d/bar-3d.d.ts +0 -1
- package/types/chart/bar/bar-transformer.d.ts +1 -0
- package/types/chart/bar/bar.d.ts +0 -1
- package/types/chart/bar/interface.d.ts +3 -0
- package/types/chart/base/base-chart-transformer.d.ts +9 -1
- package/types/chart/base/base-chart.d.ts +9 -4
- package/types/chart/base/util.d.ts +2 -2
- package/types/chart/box-plot/box-plot.d.ts +0 -1
- package/types/chart/cartesian/cartesian-transformer.d.ts +1 -0
- package/types/chart/circle-packing/circle-packing.d.ts +0 -1
- package/types/chart/common/common-transformer.d.ts +1 -0
- package/types/chart/common/common.d.ts +0 -1
- package/types/chart/common/interface.d.ts +5 -2
- package/types/chart/correlation/correlation.d.ts +0 -1
- package/types/chart/funnel/3d/funnel-3d.d.ts +0 -1
- package/types/chart/funnel/funnel.d.ts +0 -1
- package/types/chart/gauge/gauge.d.ts +0 -1
- package/types/chart/heatmap/heatmap.d.ts +0 -1
- package/types/chart/histogram/3d/histogram-3d.d.ts +0 -1
- package/types/chart/histogram/histogram.d.ts +0 -1
- package/types/chart/index.d.ts +6 -4
- package/types/chart/interface/chart.d.ts +10 -3
- package/types/chart/interface/common.d.ts +1 -5
- package/types/chart/interface/type.d.ts +2 -1
- package/types/chart/line/line.d.ts +0 -1
- package/types/chart/liquid/liquid.d.ts +0 -1
- package/types/chart/map/map.d.ts +0 -1
- package/types/chart/pie/3d/pie-3d.d.ts +0 -1
- package/types/chart/pie/pie.d.ts +0 -1
- package/types/chart/polar/interface.d.ts +2 -1
- package/types/chart/progress/circular/circular.d.ts +0 -1
- package/types/chart/progress/linear/linear.d.ts +0 -1
- package/types/chart/radar/radar.d.ts +0 -1
- package/types/chart/range-area/range-area.d.ts +0 -1
- package/types/chart/range-column/3d/range-column-3d.d.ts +0 -1
- package/types/chart/range-column/range-column.d.ts +0 -1
- package/types/chart/rose/rose.d.ts +0 -1
- package/types/chart/sankey/sankey.d.ts +5 -1
- package/types/chart/scatter/scatter.d.ts +0 -1
- package/types/chart/sequence/interface.d.ts +2 -2
- package/types/chart/sequence/sequence.d.ts +0 -1
- package/types/chart/sunburst/sunburst.d.ts +0 -1
- package/types/chart/treemap/treemap.d.ts +0 -1
- package/types/chart/venn/index.d.ts +3 -0
- package/types/chart/venn/interface.d.ts +6 -0
- package/types/chart/venn/venn-transformer.d.ts +7 -0
- package/types/chart/venn/venn.d.ts +13 -0
- package/types/chart/waterfall/waterfall.d.ts +0 -1
- package/types/chart/word-cloud/3d/word-cloud-3d.d.ts +0 -1
- package/types/chart/word-cloud/word-cloud.d.ts +0 -1
- package/types/compile/compiler.d.ts +5 -3
- package/types/compile/interface/compiler.d.ts +1 -0
- package/types/compile/mark/compilable-mark.d.ts +6 -2
- package/types/compile/mark/interface.d.ts +8 -2
- package/types/component/axis/base-axis.d.ts +13 -60
- package/types/component/axis/cartesian/axis.d.ts +3 -8
- package/types/component/axis/cartesian/band-axis.d.ts +7 -2
- package/types/component/axis/cartesian/interface/common.d.ts +1 -0
- package/types/component/axis/cartesian/interface/spec.d.ts +5 -0
- package/types/component/axis/cartesian/time-axis.d.ts +1 -1
- package/types/component/axis/cartesian/util/index.d.ts +0 -1
- package/types/component/axis/interface/common.d.ts +2 -1
- package/types/component/axis/interface/spec.d.ts +9 -6
- package/types/component/axis/mixin/linear-axis-mixin.d.ts +12 -3
- package/types/component/axis/polar/axis.d.ts +13 -10
- package/types/component/axis/polar/band-axis.d.ts +2 -1
- package/types/component/axis/polar/interface/common.d.ts +2 -0
- package/types/component/axis/polar/interface/spec.d.ts +6 -2
- package/types/component/axis/polar/linear-axis.d.ts +5 -1
- package/types/component/axis/polar/util/common.d.ts +1 -0
- package/types/component/base/base-component.d.ts +2 -1
- package/types/component/base/util.d.ts +5 -0
- package/types/component/brush/brush.d.ts +8 -3
- package/types/component/brush/interface.d.ts +4 -3
- package/types/component/crosshair/base.d.ts +14 -5
- package/types/component/crosshair/cartesian.d.ts +3 -9
- package/types/component/crosshair/interface/cartesian.d.ts +33 -0
- package/types/component/crosshair/interface/common.d.ts +7 -0
- package/types/component/crosshair/interface/index.d.ts +3 -0
- package/types/component/crosshair/interface/polar.d.ts +25 -0
- package/types/component/crosshair/interface/spec.d.ts +3 -0
- package/types/component/crosshair/polar.d.ts +4 -3
- package/types/component/crosshair/utils/cartesian.d.ts +34 -0
- package/types/component/crosshair/utils/common.d.ts +9 -0
- package/types/component/crosshair/utils/index.d.ts +1 -0
- package/types/component/crosshair/utils/polar.d.ts +37 -0
- package/types/component/custom-mark/custom-mark.d.ts +16 -5
- package/types/component/data-zoom/data-filter-base-component.d.ts +7 -9
- package/types/component/data-zoom/data-zoom/data-zoom.d.ts +4 -1
- package/types/component/data-zoom/data-zoom/interface.d.ts +6 -8
- package/types/component/data-zoom/index.d.ts +1 -0
- package/types/component/data-zoom/interface.d.ts +3 -0
- package/types/component/data-zoom/scroll-bar/interface.d.ts +3 -5
- package/types/component/data-zoom/util.d.ts +0 -4
- package/types/component/index.d.ts +8 -7
- package/types/component/indicator/interface.d.ts +5 -5
- package/types/component/interface/theme.d.ts +12 -0
- package/types/component/interface/type.d.ts +4 -0
- package/types/component/label/base-label.d.ts +6 -5
- package/types/component/label/interface.d.ts +9 -10
- package/types/component/label/label.d.ts +1 -2
- package/types/component/label/total-label.d.ts +1 -0
- package/types/component/label/util.d.ts +10 -2
- package/types/component/legend/continuous/interface.d.ts +7 -12
- package/types/component/legend/discrete/interface.d.ts +21 -6
- package/types/component/legend/discrete/legend.d.ts +5 -1
- package/types/component/legend/util.d.ts +14 -5
- package/types/component/marker/base-marker.d.ts +37 -44
- package/types/component/marker/interface.d.ts +45 -18
- package/types/component/marker/mark-area/base-mark-area.d.ts +18 -0
- package/types/component/marker/mark-area/cartesian-mark-area.d.ts +19 -0
- package/types/component/marker/mark-area/index.d.ts +2 -1
- package/types/component/marker/mark-area/interface/spec.d.ts +16 -1
- package/types/component/marker/mark-area/interface/theme.d.ts +5 -7
- package/types/component/marker/mark-area/polar-mark-area.d.ts +25 -0
- package/types/component/marker/mark-line/base-mark-line.d.ts +19 -0
- package/types/component/marker/mark-line/cartesian-mark-line.d.ts +20 -0
- package/types/component/marker/mark-line/index.d.ts +2 -1
- package/types/component/marker/mark-line/interface/spec.d.ts +26 -2
- package/types/component/marker/mark-line/interface/theme.d.ts +5 -7
- package/types/component/marker/mark-line/polar-mark-line.d.ts +23 -0
- package/types/component/marker/mark-point/base-mark-point.d.ts +17 -0
- package/types/component/marker/mark-point/cartesian-mark-point.d.ts +16 -0
- package/types/component/marker/mark-point/geo-mark-point.d.ts +14 -0
- package/types/component/marker/mark-point/index.d.ts +3 -1
- package/types/component/marker/mark-point/interface/spec.d.ts +9 -1
- package/types/component/marker/mark-point/interface/theme.d.ts +19 -18
- package/types/component/marker/mark-point/polar-mark-point.d.ts +18 -0
- package/types/component/marker/utils.d.ts +40 -5
- package/types/component/player/interface/theme.d.ts +1 -1
- package/types/component/player/player.d.ts +2 -1
- package/types/component/poptip/interface.d.ts +5 -2
- package/types/component/title/interface/spec.d.ts +18 -7
- package/types/component/title/interface/theme.d.ts +2 -1
- package/types/component/tooltip/constant.d.ts +8 -0
- package/types/component/tooltip/index.d.ts +1 -0
- package/types/component/tooltip/interface/common.d.ts +13 -8
- package/types/component/tooltip/interface/event.d.ts +1 -2
- package/types/component/tooltip/interface/index.d.ts +1 -0
- package/types/component/tooltip/interface/spec.d.ts +6 -5
- package/types/component/tooltip/interface/theme.d.ts +7 -5
- package/types/component/tooltip/processor/base.d.ts +10 -5
- package/types/component/tooltip/processor/group-tooltip.d.ts +11 -0
- package/types/component/tooltip/processor/index.d.ts +1 -0
- package/types/component/tooltip/processor/interface.d.ts +4 -3
- package/types/component/tooltip/processor/mark-tooltip.d.ts +2 -2
- package/types/component/tooltip/processor/util.d.ts +1 -1
- package/types/component/tooltip/tooltip-transformer.d.ts +2 -0
- package/types/component/tooltip/tooltip.d.ts +7 -11
- package/types/component/tooltip/utils/compose.d.ts +4 -0
- package/types/component/tooltip/utils/get-spec.d.ts +5 -0
- package/types/component/tooltip/utils/get-value.d.ts +6 -0
- package/types/component/tooltip/utils/index.d.ts +4 -0
- package/types/component/tooltip/utils/pattern.d.ts +4 -0
- package/types/component/tooltip/utils/show-tooltip.d.ts +21 -3
- package/types/component/util.d.ts +8 -0
- package/types/constant/index.d.ts +1 -0
- package/types/core/factory.d.ts +3 -0
- package/types/core/index.d.ts +1 -0
- package/types/core/interface.d.ts +10 -3
- package/types/core/vchart.d.ts +12 -5
- package/types/data/transforms/aggregation.d.ts +12 -7
- package/types/data/transforms/dimension-statistics.d.ts +2 -0
- package/types/data/transforms/funnel.d.ts +1 -1
- package/types/data/transforms/invalid-travel.d.ts +1 -1
- package/types/data/transforms/legend-data/continuous/interface.d.ts +1 -0
- package/types/data/transforms/legend-data/discrete/interface.d.ts +2 -0
- package/types/env/env.d.ts +2 -0
- package/types/event/event-dispatcher.d.ts +3 -0
- package/types/event/events/dimension/interface.d.ts +4 -2
- package/types/event/interface.d.ts +14 -2
- package/types/index.d.ts +2 -0
- package/types/interaction/dimension-trigger.d.ts +1 -6
- package/types/interaction/index.d.ts +1 -0
- package/types/interaction/interaction.d.ts +5 -0
- package/types/interaction/interface.d.ts +12 -9
- package/types/layout/grid-layout/grid-layout.d.ts +1 -1
- package/types/mark/base/base-mark.d.ts +3 -3
- package/types/mark/index.d.ts +20 -21
- package/types/mark/interface/type.d.ts +0 -1
- package/types/mark/label.d.ts +2 -2
- package/types/mark/text.d.ts +16 -7
- package/types/model/interface.d.ts +4 -8
- package/types/model/tooltip-helper.d.ts +4 -2
- package/types/plugin/base/base-plugin-service.d.ts +4 -2
- package/types/plugin/base/base-plugin.d.ts +1 -0
- package/types/plugin/base/interface.d.ts +6 -3
- package/types/plugin/chart/formatter/formatter.d.ts +28 -0
- package/types/plugin/chart/formatter/index.d.ts +1 -0
- package/types/plugin/chart/index.d.ts +1 -0
- package/types/plugin/chart/media-query/media-query.d.ts +1 -1
- package/types/plugin/chart/plugin-service.d.ts +1 -0
- package/types/plugin/components/index.d.ts +2 -5
- package/types/plugin/components/plugin-service.d.ts +1 -0
- package/types/plugin/components/tooltip-handler/base.d.ts +8 -13
- package/types/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.d.ts +1 -2
- package/types/plugin/components/tooltip-handler/constants.d.ts +0 -8
- package/types/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +8 -4
- package/types/plugin/components/tooltip-handler/dom/interface.d.ts +1 -0
- package/types/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/dom/model/content-model.d.ts +1 -3
- package/types/plugin/components/tooltip-handler/dom/model/interface.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/interface/style.d.ts +1 -0
- package/types/plugin/components/tooltip-handler/utils/attribute.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/utils/common.d.ts +1 -7
- package/types/plugin/components/tooltip-handler/utils/compose.d.ts +2 -2
- package/types/plugin/components/tooltip-handler/utils/index.d.ts +0 -3
- package/types/plugin/components/tooltip-handler/utils/position.d.ts +19 -3
- package/types/plugin/index.d.ts +1 -0
- package/types/region/interface.d.ts +4 -1
- package/types/region/region.d.ts +1 -0
- package/types/series/area/animation.d.ts +1 -1
- package/types/series/area/area-transformer.d.ts +1 -0
- package/types/series/area/area.d.ts +1 -1
- package/types/series/area/interface.d.ts +7 -1
- package/types/series/bar/bar-transformer.d.ts +1 -0
- package/types/series/bar/bar.d.ts +11 -3
- package/types/series/bar/interface.d.ts +4 -3
- package/types/series/base/base-series-transformer.d.ts +9 -3
- package/types/series/base/base-series.d.ts +16 -23
- package/types/series/base/tooltip-helper.d.ts +12 -8
- package/types/series/box-plot/tooltip-helper.d.ts +1 -1
- package/types/series/cartesian/cartesian.d.ts +3 -4
- package/types/series/circle-packing/tooltip-helper.d.ts +1 -1
- package/types/series/correlation/interface.d.ts +3 -3
- package/types/series/dot/interface.d.ts +2 -2
- package/types/series/funnel/funnel.d.ts +1 -1
- package/types/series/funnel/interface.d.ts +6 -4
- package/types/series/funnel/tooltip-helper.d.ts +3 -3
- package/types/series/gauge/gauge-pointer-transformer.d.ts +5 -0
- package/types/series/gauge/gauge-pointer.d.ts +3 -1
- package/types/series/gauge/gauge-transformer.d.ts +1 -0
- package/types/series/gauge/gauge.d.ts +0 -1
- package/types/series/gauge/interface.d.ts +3 -3
- package/types/series/geo/geo.d.ts +2 -1
- package/types/series/index.d.ts +7 -3
- package/types/series/interface/common.d.ts +12 -5
- package/types/series/interface/series.d.ts +12 -3
- package/types/series/interface/theme.d.ts +19 -1
- package/types/series/interface/tooltip-helper.d.ts +8 -5
- package/types/series/interface/type.d.ts +6 -2
- package/types/series/line/interface.d.ts +3 -2
- package/types/series/map/geo-source.d.ts +4 -2
- package/types/series/map/interface.d.ts +3 -5
- package/types/series/map/tooltip-helper.d.ts +1 -1
- package/types/series/mixin/line-mixin.d.ts +1 -0
- package/types/series/pie/3d/pie-3d.d.ts +1 -1
- package/types/series/pie/interface.d.ts +5 -4
- package/types/series/pie/pie-transformer.d.ts +1 -0
- package/types/series/pie/pie.d.ts +2 -4
- package/types/series/polar/interface.d.ts +2 -2
- package/types/series/polar/polar.d.ts +3 -3
- package/types/series/polar/progress-like/progress-like.d.ts +0 -1
- package/types/series/progress/circular/circular-transformer.d.ts +5 -0
- package/types/series/progress/circular/circular.d.ts +3 -0
- package/types/series/progress/circular/interface.d.ts +5 -5
- package/types/series/radar/interface.d.ts +2 -1
- package/types/series/range-area/range-area.d.ts +2 -2
- package/types/series/range-column/interface.d.ts +5 -5
- package/types/series/range-column/range-column-transformer.d.ts +1 -0
- package/types/series/range-column/range-column.d.ts +0 -1
- package/types/series/rose/interface.d.ts +2 -1
- package/types/series/rose/rose-transformer.d.ts +1 -0
- package/types/series/rose/rose.d.ts +0 -1
- package/types/series/sankey/interface.d.ts +7 -2
- package/types/series/sankey/sankey.d.ts +13 -4
- package/types/series/scatter/interface.d.ts +2 -1
- package/types/series/sunburst/sunburst.d.ts +1 -1
- package/types/series/sunburst/tooltip-helper.d.ts +1 -1
- package/types/series/treemap/interface.d.ts +3 -2
- package/types/series/treemap/tooltip-helper.d.ts +1 -1
- package/types/series/treemap/treemap.d.ts +3 -0
- package/types/series/venn/animation.d.ts +6 -0
- package/types/series/venn/constant.d.ts +2 -0
- package/types/series/venn/interface.d.ts +21 -0
- package/types/series/venn/tooltip-helper.d.ts +5 -0
- package/types/series/venn/util.d.ts +1 -0
- package/types/series/venn/venn-transform.d.ts +6 -0
- package/types/series/venn/venn.d.ts +63 -0
- package/types/series/waterfall/interface.d.ts +6 -1
- package/types/series/waterfall/waterfall-transformer.d.ts +1 -0
- package/types/series/waterfall/waterfall.d.ts +9 -1
- package/types/series/word-cloud/base.d.ts +2 -0
- package/types/series/word-cloud/interface.d.ts +2 -6
- package/types/theme/builtin/common/series/venn.d.ts +2 -0
- package/types/theme/index.d.ts +1 -0
- package/types/theme/interface.d.ts +3 -19
- package/types/theme/theme-manager.d.ts +1 -1
- package/types/theme/token/builtin/default.d.ts +2 -0
- package/types/theme/token/builtin/index.d.ts +2 -0
- package/types/theme/token/builtin/interface.d.ts +17 -0
- package/types/theme/token/index.d.ts +3 -0
- package/types/theme/token/interface.d.ts +6 -0
- package/types/theme/token/util.d.ts +3 -0
- package/types/typings/spec/chart.d.ts +2 -0
- package/types/typings/spec/common.d.ts +41 -26
- package/types/typings/spec/index.d.ts +1 -1
- package/types/typings/tooltip/handler.d.ts +1 -1
- package/types/typings/tooltip/line.d.ts +9 -2
- package/types/typings/tooltip/position.d.ts +18 -24
- package/types/typings/tooltip/shape.d.ts +2 -2
- package/types/typings/tooltip/tooltip.d.ts +13 -8
- package/types/typings/visual.d.ts +15 -11
- package/types/util/data.d.ts +22 -4
- package/types/util/hierarchy.d.ts +2 -0
- package/types/util/index.d.ts +2 -2
- package/types/util/math.d.ts +4 -5
- package/types/util/space.d.ts +1 -1
- package/types/util/spec/common.d.ts +0 -2
- package/types/util/spec/index.d.ts +0 -5
- package/types/util/theme/common.d.ts +2 -0
- package/types/util/theme/index.d.ts +3 -0
- package/types/util/theme/merge-theme.d.ts +6 -0
- package/types/util/theme/preprocess.d.ts +4 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { PopTipAttributes } from '@visactor/vrender-components';
|
|
2
2
|
import type { IColorKey } from '../../theme/color-scheme/interface';
|
|
3
|
+
import type { ITokenKey } from '../../theme/token';
|
|
3
4
|
export interface IPoptipTheme extends Omit<PopTipAttributes, 'titleStyle' | 'contentStyle' | 'panel'> {
|
|
4
|
-
titleStyle?: Partial<Omit<PopTipAttributes['titleStyle'], 'fill'>> & {
|
|
5
|
+
titleStyle?: Partial<Omit<PopTipAttributes['titleStyle'], 'fill' | 'fontSize'>> & {
|
|
5
6
|
fill?: PopTipAttributes['titleStyle']['fill'] | IColorKey;
|
|
7
|
+
fontSize?: PopTipAttributes['titleStyle']['fontSize'] | ITokenKey;
|
|
6
8
|
};
|
|
7
|
-
contentStyle?: Partial<Omit<PopTipAttributes['contentStyle'], 'fill'>> & {
|
|
9
|
+
contentStyle?: Partial<Omit<PopTipAttributes['contentStyle'], 'fill' | 'fontSize'>> & {
|
|
8
10
|
fill?: PopTipAttributes['contentStyle']['fill'] | IColorKey;
|
|
11
|
+
fontSize?: PopTipAttributes['contentStyle']['fontSize'] | ITokenKey;
|
|
9
12
|
};
|
|
10
13
|
panel?: Partial<Omit<PopTipAttributes['panel'], 'fill' | 'stroke' | 'shadowColor'>> & {
|
|
11
14
|
fill?: PopTipAttributes['panel']['fill'] | IColorKey;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import type { IComponent } from '../../interface';
|
|
2
2
|
import type { ITextGraphicAttribute, IRichTextCharacter, RichTextWordBreak } from '@visactor/vrender-core';
|
|
3
|
-
import type { IOrientType, IPadding
|
|
3
|
+
import type { IOrientType, IPadding } from '../../../typings';
|
|
4
4
|
import type { IComponentSpec } from '../../base/interface';
|
|
5
|
-
|
|
5
|
+
interface ITitleSpecWithoutText extends Omit<IComponentSpec, 'orient'> {
|
|
6
6
|
visible?: boolean;
|
|
7
7
|
orient?: IOrientType;
|
|
8
|
-
text?: string | number | string[] | number[] | IRichTextCharacter[];
|
|
9
|
-
textType?: string;
|
|
10
|
-
subtext?: string | number | string[] | number[] | IRichTextCharacter[];
|
|
11
|
-
subtextType?: string;
|
|
12
8
|
x?: number;
|
|
13
9
|
y?: number;
|
|
14
10
|
width?: number;
|
|
@@ -43,5 +39,20 @@ export interface ITitleSpec extends Omit<IComponentSpec, 'orient'> {
|
|
|
43
39
|
character?: IRichTextCharacter[];
|
|
44
40
|
} & Partial<ITextGraphicAttribute>;
|
|
45
41
|
}
|
|
46
|
-
export type
|
|
42
|
+
export type ITitleTextSpec = {
|
|
43
|
+
textType?: 'text';
|
|
44
|
+
text: string | number | string[] | number[];
|
|
45
|
+
} | {
|
|
46
|
+
textType: 'rich';
|
|
47
|
+
text: IRichTextCharacter[];
|
|
48
|
+
};
|
|
49
|
+
export type ISubTitleTextSpec = {
|
|
50
|
+
subtextType?: 'text';
|
|
51
|
+
subtext?: string | number | string[] | number[];
|
|
52
|
+
} | {
|
|
53
|
+
subtextType?: 'rich';
|
|
54
|
+
subtext?: IRichTextCharacter[];
|
|
55
|
+
};
|
|
56
|
+
export type ITitleSpec = ITitleSpecWithoutText & ITitleTextSpec & ISubTitleTextSpec;
|
|
47
57
|
export type ITitle = IComponent;
|
|
58
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ILayoutItemSpec } from '../../../layout/interface';
|
|
2
2
|
import type { IColorKey } from '../../../theme/color-scheme/interface';
|
|
3
|
+
import type { ITokenKey } from '../../../theme/token';
|
|
3
4
|
import type { StringOrNumber } from '../../../typings';
|
|
4
5
|
import type { TextAlign, TextBaseLine } from '../../../typings/visual';
|
|
5
6
|
export interface ITitleTextTheme {
|
|
6
7
|
width?: number;
|
|
7
8
|
height?: number;
|
|
8
9
|
fontFamily?: string;
|
|
9
|
-
fontSize?: number;
|
|
10
|
+
fontSize?: number | ITokenKey;
|
|
10
11
|
fill?: string | IColorKey;
|
|
11
12
|
fontWeight?: StringOrNumber;
|
|
12
13
|
textAlign?: TextAlign;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ITooltipLineActual } from '../../typings';
|
|
2
|
+
export declare class TooltipHandlerType {
|
|
3
|
+
static dom: string;
|
|
4
|
+
static canvas: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TOOLTIP_EL_CLASS_NAME = "vchart-tooltip-element";
|
|
7
|
+
export declare const TOOLTIP_MAX_LINE_COUNT = 20;
|
|
8
|
+
export declare const TOOLTIP_OTHERS_LINE: ITooltipLineActual;
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import type { DimensionEventParams } from '../../../event/events/dimension/interface';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { Datum, IShowTooltipOption } from '../../../typings';
|
|
2
|
+
import type { DimensionTooltipInfo, GroupTooltipInfo, MarkTooltipInfo } from '../processor/interface';
|
|
3
|
+
import type { Datum, IShowTooltipOption, ITooltipActual } from '../../../typings';
|
|
5
4
|
import type { IComponent } from '../../interface';
|
|
6
|
-
|
|
5
|
+
import type { ITooltipSpec } from './spec';
|
|
6
|
+
export type TooltipHandlerParams = DimensionEventParams & {
|
|
7
7
|
changePositionOnly?: boolean;
|
|
8
|
+
tooltip: ITooltip;
|
|
9
|
+
tooltipSpec?: ITooltipSpec;
|
|
10
|
+
tooltipActual?: ITooltipActual;
|
|
11
|
+
groupDatum?: Datum[];
|
|
8
12
|
};
|
|
9
|
-
export interface ITooltipActiveTypeAsKeys<T, K> {
|
|
13
|
+
export interface ITooltipActiveTypeAsKeys<T, K, U> {
|
|
10
14
|
mark: T;
|
|
11
15
|
dimension: K;
|
|
16
|
+
group: U;
|
|
12
17
|
}
|
|
13
18
|
export type TotalMouseEventData = {
|
|
14
|
-
tooltipInfo: Partial<ITooltipActiveTypeAsKeys<MarkTooltipInfo, DimensionTooltipInfo>>;
|
|
15
|
-
ignore: Partial<ITooltipActiveTypeAsKeys<boolean, boolean>>;
|
|
19
|
+
tooltipInfo: Partial<ITooltipActiveTypeAsKeys<MarkTooltipInfo, DimensionTooltipInfo, GroupTooltipInfo>>;
|
|
20
|
+
ignore: Partial<ITooltipActiveTypeAsKeys<boolean, boolean, boolean>>;
|
|
16
21
|
};
|
|
17
|
-
export declare enum TooltipResult {
|
|
22
|
+
export declare const enum TooltipResult {
|
|
18
23
|
success = 0,
|
|
19
24
|
failed = 1
|
|
20
25
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { TooltipActiveType, TooltipData } from '../../../typings';
|
|
2
|
-
import type { IComponent } from '../../interface/common';
|
|
3
2
|
import type { TooltipHandlerParams } from './common';
|
|
4
3
|
export type TooltipEventParams = TooltipHandlerParams & {
|
|
5
4
|
activeType?: TooltipActiveType;
|
|
6
5
|
tooltipData?: TooltipData;
|
|
7
|
-
|
|
6
|
+
isEmptyTooltip?: boolean;
|
|
8
7
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IGroupTooltipPattern, ITooltipActual, ITooltipPattern, Maybe, MaybeArray, TooltipActiveType, TooltipData } from '../../../typings';
|
|
2
2
|
import type { ITooltipActiveTypeAsKeys, TooltipHandlerParams, TooltipResult } from './common';
|
|
3
3
|
import type { ITooltipTheme } from './theme';
|
|
4
|
-
export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipPattern, ITooltipPattern>> {
|
|
4
|
+
export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipPattern, ITooltipPattern, IGroupTooltipPattern>> {
|
|
5
5
|
visible?: boolean;
|
|
6
6
|
activeType?: TooltipActiveType | TooltipActiveType[];
|
|
7
|
-
trigger?: 'hover' | 'click' | 'none';
|
|
8
|
-
triggerOff?: 'hover' | 'click' | 'none';
|
|
7
|
+
trigger?: MaybeArray<'hover' | 'click'> | 'none';
|
|
8
|
+
triggerOff?: MaybeArray<'hover' | 'click'> | 'none';
|
|
9
|
+
lockAfterClick?: boolean;
|
|
9
10
|
style?: Omit<ITooltipTheme<string>, 'offset'>;
|
|
10
11
|
handler?: Partial<ITooltipHandlerSpec>;
|
|
11
12
|
renderMode?: 'html' | 'canvas';
|
|
@@ -15,7 +16,7 @@ export interface ITooltipSpec extends Partial<ITooltipActiveTypeAsKeys<ITooltipP
|
|
|
15
16
|
enterable?: boolean;
|
|
16
17
|
transitionDuration?: number;
|
|
17
18
|
throttleInterval?: number;
|
|
18
|
-
updateElement?: (tooltipElement: HTMLElement, actualTooltip:
|
|
19
|
+
updateElement?: (tooltipElement: HTMLElement, actualTooltip: ITooltipActual, params: TooltipHandlerParams) => void;
|
|
19
20
|
offset?: {
|
|
20
21
|
x?: number;
|
|
21
22
|
y?: number;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { RichTextWordBreak } from '@visactor/vrender-core';
|
|
2
|
-
import type { StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';
|
|
3
|
-
import type { Padding } from '@visactor/vrender-components
|
|
2
|
+
import type { ITooltipShapeActual, StringOrNumber, TextAlign, TextBaseLine } from '../../../typings';
|
|
3
|
+
import type { Padding } from '@visactor/vrender-components';
|
|
4
|
+
import type { ITokenKey } from '../../../theme/token';
|
|
4
5
|
export interface ITooltipTextTheme<ColorType = string> {
|
|
5
6
|
fontFamily?: string;
|
|
6
|
-
fontSize?: number;
|
|
7
|
+
fontSize?: number | ITokenKey;
|
|
7
8
|
fill?: ColorType;
|
|
8
9
|
fontColor?: ColorType;
|
|
9
10
|
fontWeight?: StringOrNumber;
|
|
10
11
|
textAlign?: TextAlign;
|
|
11
12
|
textBaseline?: TextBaseLine;
|
|
12
|
-
lineHeight?: number | string;
|
|
13
|
+
lineHeight?: number | string | ITokenKey;
|
|
13
14
|
spacing?: number;
|
|
14
15
|
multiLine?: boolean;
|
|
15
16
|
maxWidth?: number;
|
|
@@ -36,7 +37,7 @@ export interface ITooltipTheme<ColorType = string> {
|
|
|
36
37
|
shape?: {
|
|
37
38
|
size?: number;
|
|
38
39
|
spacing?: number;
|
|
39
|
-
};
|
|
40
|
+
} & ITooltipShapeActual;
|
|
40
41
|
titleLabel?: ITooltipTextTheme<ColorType>;
|
|
41
42
|
keyLabel?: Omit<ITooltipTextTheme<ColorType>, 'autoWidth'>;
|
|
42
43
|
valueLabel?: ITooltipTextTheme<ColorType>;
|
|
@@ -46,4 +47,5 @@ export interface ITooltipTheme<ColorType = string> {
|
|
|
46
47
|
x?: number;
|
|
47
48
|
y?: number;
|
|
48
49
|
};
|
|
50
|
+
align?: 'left' | 'right';
|
|
49
51
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import type { BaseEventParams } from '../../../event/interface';
|
|
2
|
-
import type { TooltipActiveType, TooltipData } from '../../../typings';
|
|
3
|
-
import type { TooltipHandlerParams } from '../interface';
|
|
2
|
+
import type { ITooltipActual, TooltipActiveType, TooltipData } from '../../../typings';
|
|
3
|
+
import type { ITooltipSpec, TooltipHandlerParams } from '../interface';
|
|
4
4
|
import { TooltipResult } from '../interface/common';
|
|
5
5
|
import type { Tooltip } from '../tooltip';
|
|
6
|
-
import type { MouseEventData, TooltipInfo } from './interface';
|
|
6
|
+
import type { DimensionTooltipInfo, MouseEventData, TooltipInfo } from './interface';
|
|
7
7
|
import type { IDimensionInfo } from '../../../event/events/dimension';
|
|
8
8
|
export declare abstract class BaseTooltipProcessor {
|
|
9
9
|
readonly component: Tooltip;
|
|
10
|
-
activeType: TooltipActiveType;
|
|
10
|
+
abstract activeType: TooltipActiveType;
|
|
11
|
+
protected _cacheViewSpec: ITooltipSpec | undefined;
|
|
12
|
+
protected _cacheActualTooltip: ITooltipActual | undefined;
|
|
11
13
|
constructor(component: Tooltip);
|
|
12
14
|
abstract showTooltip(info: TooltipInfo, params: BaseEventParams, changePositionOnly: boolean): TooltipResult;
|
|
13
15
|
abstract shouldHandleTooltip(params: BaseEventParams, mouseEventData: Partial<MouseEventData>): boolean;
|
|
14
|
-
abstract getMouseEventData(params: BaseEventParams): MouseEventData;
|
|
16
|
+
abstract getMouseEventData(params: BaseEventParams, dimensionInfo?: DimensionTooltipInfo): MouseEventData;
|
|
15
17
|
protected _showTooltipByHandler: (data: TooltipData | undefined, params: TooltipHandlerParams) => TooltipResult;
|
|
16
18
|
protected _preprocessDimensionInfo(dimensionInfo?: IDimensionInfo[]): IDimensionInfo[] | undefined;
|
|
17
19
|
protected _getDimensionInfo(params: BaseEventParams): IDimensionInfo[];
|
|
20
|
+
protected _updateViewSpec(params: TooltipHandlerParams): void;
|
|
21
|
+
protected _updateActualTooltip(data: TooltipData, params: TooltipHandlerParams): void;
|
|
22
|
+
clearCache(): void;
|
|
18
23
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BaseEventParams } from '../../../event/interface';
|
|
2
|
+
import type { TooltipActiveType } from '../../../typings';
|
|
3
|
+
import type { DimensionTooltipInfo, GroupTooltipInfo, MouseEventData } from './interface';
|
|
4
|
+
import { BaseTooltipProcessor } from './base';
|
|
5
|
+
export declare class GroupTooltipProcessor extends BaseTooltipProcessor {
|
|
6
|
+
activeType: TooltipActiveType;
|
|
7
|
+
showTooltip(info: GroupTooltipInfo, params: BaseEventParams, changePositionOnly: boolean): import("../interface").TooltipResult;
|
|
8
|
+
shouldHandleTooltip(params: BaseEventParams, mouseEventData: Partial<MouseEventData>): boolean;
|
|
9
|
+
getMouseEventData(params: BaseEventParams, dimensionInfo?: DimensionTooltipInfo): MouseEventData;
|
|
10
|
+
protected _getGroupDatum(params: BaseEventParams): any;
|
|
11
|
+
}
|
|
@@ -3,13 +3,14 @@ import type { IMark } from '../../../mark/interface';
|
|
|
3
3
|
import type { ISeries } from '../../../series/interface';
|
|
4
4
|
import type { IDimensionInfo } from '../../../event/events/dimension/interface';
|
|
5
5
|
export type DimensionTooltipInfo = IDimensionInfo[];
|
|
6
|
-
export type MarkTooltipInfo = {
|
|
7
|
-
datum:
|
|
6
|
+
export type MarkTooltipInfo<T = Datum> = {
|
|
7
|
+
datum: T;
|
|
8
8
|
mark: IMark;
|
|
9
9
|
series: ISeries;
|
|
10
10
|
dimensionInfo: DimensionTooltipInfo;
|
|
11
11
|
};
|
|
12
|
-
export type
|
|
12
|
+
export type GroupTooltipInfo = MarkTooltipInfo<Datum | Datum[]>;
|
|
13
|
+
export type TooltipInfo = DimensionTooltipInfo | MarkTooltipInfo | GroupTooltipInfo;
|
|
13
14
|
export type MouseEventData = {
|
|
14
15
|
tooltipInfo: TooltipInfo;
|
|
15
16
|
ignore: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BaseEventParams } from '../../../event/interface';
|
|
2
2
|
import type { TooltipActiveType } from '../../../typings';
|
|
3
|
-
import type { MarkTooltipInfo, MouseEventData } from './interface';
|
|
3
|
+
import type { DimensionTooltipInfo, MarkTooltipInfo, MouseEventData } from './interface';
|
|
4
4
|
import { BaseTooltipProcessor } from './base';
|
|
5
5
|
export declare class MarkTooltipProcessor extends BaseTooltipProcessor {
|
|
6
6
|
activeType: TooltipActiveType;
|
|
7
7
|
showTooltip(info: MarkTooltipInfo, params: BaseEventParams, changePositionOnly: boolean): import("../interface").TooltipResult;
|
|
8
8
|
shouldHandleTooltip(params: BaseEventParams, mouseEventData: Partial<MouseEventData>): boolean;
|
|
9
|
-
getMouseEventData(params: BaseEventParams): MouseEventData;
|
|
9
|
+
getMouseEventData(params: BaseEventParams, dimensionInfo?: DimensionTooltipInfo): MouseEventData;
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Maybe } from '@visactor/vutils';
|
|
2
2
|
import type { DimensionTooltipInfo, MarkTooltipInfo, TooltipInfo } from './interface';
|
|
3
|
-
export declare const isMarkInfo: (info: Maybe<TooltipInfo>) => info is MarkTooltipInfo
|
|
3
|
+
export declare const isMarkInfo: (info: Maybe<TooltipInfo>) => info is MarkTooltipInfo<any>;
|
|
4
4
|
export declare const isDimensionInfo: (info: Maybe<TooltipInfo>) => info is DimensionTooltipInfo;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IChartSpecInfo } from '../../chart/interface';
|
|
1
2
|
import { BaseComponentSpecTransformer } from '../base';
|
|
2
3
|
export declare class TooltipSpecTransformer extends BaseComponentSpecTransformer<any> {
|
|
3
4
|
protected _shouldMergeThemeToSpec(): boolean;
|
|
@@ -5,4 +6,5 @@ export declare class TooltipSpecTransformer extends BaseComponentSpecTransformer
|
|
|
5
6
|
spec: any;
|
|
6
7
|
theme: any;
|
|
7
8
|
};
|
|
9
|
+
protected _transformSpecAfterMergingTheme(spec: any, chartSpec: any, chartSpecInfo?: IChartSpecInfo): void;
|
|
8
10
|
}
|
|
@@ -3,19 +3,14 @@ import type { IModelLayoutOption, IModelRenderOption, IModelSpecInfo } from '../
|
|
|
3
3
|
import type { IRegion } from '../../region/interface';
|
|
4
4
|
import { BaseComponent } from '../base/base-component';
|
|
5
5
|
import type { BaseEventParams, EventCallback, EventQuery, EventType } from '../../event/interface';
|
|
6
|
-
import type { ITooltipHandler,
|
|
6
|
+
import type { ITooltipHandler, TooltipActiveType } from '../../typings/tooltip';
|
|
7
7
|
import type { Datum, IShowTooltipOption } from '../../typings';
|
|
8
8
|
import type { ITooltip, ITooltipActiveTypeAsKeys, ITooltipSpec, TooltipHandlerParams, TotalMouseEventData } from './interface';
|
|
9
9
|
import { TooltipResult } from './interface/common';
|
|
10
|
-
import { DimensionTooltipProcessor } from './processor
|
|
11
|
-
import { MarkTooltipProcessor } from './processor/mark-tooltip';
|
|
10
|
+
import { GroupTooltipProcessor, DimensionTooltipProcessor, MarkTooltipProcessor } from './processor';
|
|
12
11
|
import type { Maybe } from '@visactor/vutils';
|
|
13
12
|
import type { IGraphic } from '@visactor/vrender-core';
|
|
14
13
|
import { TooltipSpecTransformer } from './tooltip-transformer';
|
|
15
|
-
export type TooltipActualTitleContent = {
|
|
16
|
-
title?: IToolTipLineActual;
|
|
17
|
-
content?: IToolTipLineActual[];
|
|
18
|
-
};
|
|
19
14
|
export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
20
15
|
protected layoutZIndex: number;
|
|
21
16
|
static type: ComponentTypeEnum;
|
|
@@ -29,12 +24,14 @@ export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
|
29
24
|
protected _spec: ITooltipSpec;
|
|
30
25
|
static getSpecInfo(chartSpec: any): Maybe<IModelSpecInfo[]>;
|
|
31
26
|
tooltipHandler?: ITooltipHandler;
|
|
27
|
+
processor: ITooltipActiveTypeAsKeys<MarkTooltipProcessor, DimensionTooltipProcessor, GroupTooltipProcessor>;
|
|
32
28
|
private _alwaysShow;
|
|
33
29
|
private _cacheInfo;
|
|
34
30
|
private _cacheParams;
|
|
31
|
+
private _cacheActiveType;
|
|
35
32
|
private _eventList;
|
|
36
|
-
protected _processor: ITooltipActiveTypeAsKeys<MarkTooltipProcessor, DimensionTooltipProcessor>;
|
|
37
33
|
protected _isTooltipShown: boolean;
|
|
34
|
+
protected _clickLock: boolean;
|
|
38
35
|
isTooltipShown(): boolean;
|
|
39
36
|
changeRegions(regions: IRegion[]): void;
|
|
40
37
|
protected _getNeedClearVRenderComponents(): IGraphic[];
|
|
@@ -52,12 +49,11 @@ export declare class Tooltip extends BaseComponent<any> implements ITooltip {
|
|
|
52
49
|
protected _mountEvent: (eType: EventType, query: EventQuery, callback: EventCallback<any>) => void;
|
|
53
50
|
protected _getMouseOutHandler: (needPointerDetection?: boolean) => (params: BaseEventParams) => void;
|
|
54
51
|
protected _handleChartMouseOut: (params: BaseEventParams) => void;
|
|
55
|
-
protected
|
|
56
|
-
protected _showTooltipByMouseEvent: (activeType: TooltipActiveType, mouseEventData: TotalMouseEventData, params: BaseEventParams, useCache?: boolean) => boolean;
|
|
52
|
+
protected _getMouseMoveHandler: (isClick: boolean) => (params: BaseEventParams) => void;
|
|
53
|
+
protected _showTooltipByMouseEvent: (activeType: TooltipActiveType, mouseEventData: TotalMouseEventData, params: BaseEventParams, isClick: boolean, useCache?: boolean) => boolean;
|
|
57
54
|
protected _getMouseEventData: (params: BaseEventParams) => TotalMouseEventData;
|
|
58
55
|
protected _hideTooltipByHandler: (params: TooltipHandlerParams) => TooltipResult;
|
|
59
56
|
reInit(spec?: any): void;
|
|
60
|
-
setAttrFromSpec(): void;
|
|
61
57
|
showTooltip(datum: Datum, options: IShowTooltipOption): false | "none" | TooltipActiveType;
|
|
62
58
|
hideTooltip(): boolean;
|
|
63
59
|
private _isSameAsCache;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ITooltipLinePattern, ITooltipPattern, TooltipData, ITooltipLineActual, TooltipActualTitleContent } from '../../../typings/tooltip';
|
|
2
|
+
import type { TooltipHandlerParams } from '../interface/common';
|
|
3
|
+
export declare const getShowContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => TooltipActualTitleContent | null;
|
|
4
|
+
export declare const getOneLineData: (datum: any, config: ITooltipLinePattern, params: TooltipHandlerParams) => ITooltipLineActual;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TooltipActiveType } from '../../../typings';
|
|
2
|
+
import type { ISeries } from '../../../series/interface';
|
|
3
|
+
import type { IDimensionInfo } from '../../../event/events/dimension/interface';
|
|
4
|
+
import type { ITooltipSpec } from '..';
|
|
5
|
+
export declare const getTooltipSpecForShow: (activeType: TooltipActiveType, globalSpec: ITooltipSpec, series?: ISeries, dimensionInfo?: IDimensionInfo[]) => ITooltipSpec;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Datum, ITooltipLinePattern, ITooltipPattern, TooltipContentProperty, TooltipData, TooltipPatternProperty } from '../../../typings';
|
|
2
|
+
import type { TooltipHandlerParams } from '../interface';
|
|
3
|
+
export declare const getTooltipContentValue: <T>(field?: TooltipContentProperty<T>, datum?: any, params?: TooltipHandlerParams, formatter?: string) => T;
|
|
4
|
+
export declare const getTooltipPatternValue: <T>(field?: TooltipPatternProperty<T>, data?: TooltipData, params?: TooltipHandlerParams) => T;
|
|
5
|
+
export declare const getTooltipContentPattern: (field?: ITooltipPattern['content'], data?: TooltipData, params?: TooltipHandlerParams) => Array<ITooltipLinePattern> | undefined;
|
|
6
|
+
export declare function getFirstDatumFromTooltipData(data: TooltipData): Datum;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IDimensionInfo } from '../../../event/events/dimension/interface';
|
|
2
|
+
import type { ISeries } from '../../../series/interface';
|
|
3
|
+
import type { ITooltipPattern, TooltipActiveType } from '../../../typings';
|
|
4
|
+
export declare const makeDefaultPattern: (series: ISeries, activeType: TooltipActiveType, dimensionInfo?: IDimensionInfo[]) => ITooltipPattern | null;
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import { type Datum, type IPoint, type IShowTooltipOption, type TooltipActiveType } from '../../../typings';
|
|
2
|
+
import type { ISeries } from '../../../series/interface';
|
|
3
|
+
import type { IRegion } from '../../../region';
|
|
4
|
+
import type { Tooltip } from '../tooltip';
|
|
5
|
+
type MarkInfo = {
|
|
6
|
+
pos: IPoint;
|
|
7
|
+
data: {
|
|
8
|
+
dimensionFields: string[];
|
|
9
|
+
measureFields: string[];
|
|
10
|
+
dimensionData?: any[];
|
|
11
|
+
measureData?: any[];
|
|
12
|
+
hasMeasureData?: boolean;
|
|
13
|
+
groupField?: string;
|
|
14
|
+
groupData?: any;
|
|
15
|
+
};
|
|
16
|
+
series: ISeries;
|
|
17
|
+
dimType?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function showTooltip(datum: Datum, options: IShowTooltipOption, component: Tooltip): TooltipActiveType | 'none';
|
|
20
|
+
export declare const getMarkInfoList: (datum: Datum, region: IRegion) => MarkInfo[];
|
|
21
|
+
export {};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import type { ITheme } from '../theme';
|
|
2
|
+
import type { Datum } from '../typings';
|
|
2
3
|
export declare function getComponentThemeFromOption(type: string, chartTheme: ITheme): any;
|
|
4
|
+
export declare function getFormatFunction(formatMethod?: any, formatter?: string | string[], text?: string | number, datum?: Datum): {
|
|
5
|
+
formatFunc: any;
|
|
6
|
+
args: (string | number | Datum)[];
|
|
7
|
+
} | {
|
|
8
|
+
formatFunc?: undefined;
|
|
9
|
+
args?: undefined;
|
|
10
|
+
};
|
|
@@ -15,6 +15,7 @@ export declare enum AttributeLevel {
|
|
|
15
15
|
User_Mark = 8,
|
|
16
16
|
Built_In = 99
|
|
17
17
|
}
|
|
18
|
+
export declare const STACK_FIELD_KEY: string;
|
|
18
19
|
export declare const STACK_FIELD_START: string;
|
|
19
20
|
export declare const STACK_FIELD_END: string;
|
|
20
21
|
export declare const STACK_FIELD_START_PERCENT: string;
|
package/types/core/factory.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare class Factory {
|
|
|
19
19
|
private static _implements;
|
|
20
20
|
private static _chartPlugin;
|
|
21
21
|
private static _componentPlugin;
|
|
22
|
+
private static _formatter;
|
|
22
23
|
static transforms: {
|
|
23
24
|
[key: string]: Transform;
|
|
24
25
|
};
|
|
@@ -62,4 +63,6 @@ export declare class Factory {
|
|
|
62
63
|
static getChartPlugins(): IChartPluginConstructor[];
|
|
63
64
|
static getComponentPlugins(): IComponentPluginConstructor[];
|
|
64
65
|
static getComponentPluginInType(type: string): IComponentPluginConstructor;
|
|
66
|
+
static registerFormatter(func: typeof Factory['_formatter']): void;
|
|
67
|
+
static getFormatter(): (text: string | number | number[] | string[], datum: any, formatter: string | string[]) => any;
|
|
65
68
|
}
|
package/types/core/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from '../theme/interface';
|
|
|
10
10
|
export * from '../constant';
|
|
11
11
|
export * from './interface';
|
|
12
12
|
export * from '../typings/spec/index';
|
|
13
|
+
export * from '../typings/tooltip';
|
|
13
14
|
export * from '../theme/index';
|
|
14
15
|
export { vglobal } from '@visactor/vrender-core';
|
|
15
16
|
export * from '../plugin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DataSet } from '@visactor/vdataset';
|
|
2
|
-
import type { IParserOptions } from '@visactor/vdataset
|
|
3
|
-
import type { Datum, IInitOption, IMarkStateSpec, IPoint, IRegionQuerier, IShowTooltipOption, ISpec, ITooltipHandler, Maybe, MaybeArray, StringOrNumber } from '../typings';
|
|
2
|
+
import type { IParserOptions } from '@visactor/vdataset';
|
|
3
|
+
import type { Datum, IDataValues, IInitOption, IMarkStateSpec, IPoint, IRegionQuerier, IShowTooltipOption, ISpec, ITooltipHandler, Maybe, MaybeArray, StringOrNumber } from '../typings';
|
|
4
4
|
import type { IMorphConfig } from '../animation/spec';
|
|
5
5
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
6
6
|
import type { EventCallback, EventParams, EventQuery, EventType } from '../event/interface';
|
|
@@ -13,6 +13,7 @@ import type { Compiler } from '../compile/compiler';
|
|
|
13
13
|
import type { IChart, IChartSpecInfo } from '../chart/interface';
|
|
14
14
|
import type { Stage } from '@visactor/vrender-core';
|
|
15
15
|
import type { IContainerSize } from '@visactor/vrender-components';
|
|
16
|
+
import type { IBaseScale } from '@visactor/vscale';
|
|
16
17
|
export type DataLinkSeries = {
|
|
17
18
|
seriesId?: StringOrNumber;
|
|
18
19
|
seriesIndex?: number;
|
|
@@ -23,6 +24,7 @@ export type DataLinkAxis = {
|
|
|
23
24
|
};
|
|
24
25
|
export interface IVChartConstructor {
|
|
25
26
|
new (spec: ISpec, options: IInitOption): IVChart;
|
|
27
|
+
useRegisters: (comps: (() => void)[]) => any;
|
|
26
28
|
}
|
|
27
29
|
export interface IVChart {
|
|
28
30
|
readonly id: number;
|
|
@@ -35,6 +37,7 @@ export interface IVChart {
|
|
|
35
37
|
options?: IParserOptions;
|
|
36
38
|
}[]) => Promise<IVChart>;
|
|
37
39
|
updateDataSync: (id: StringOrNumber, data: Datum[], options?: IParserOptions) => IVChart;
|
|
40
|
+
updateFullDataSync: (data: IDataValues | IDataValues[], reRender?: boolean) => IVChart;
|
|
38
41
|
updateSpec: (spec: ISpec, forceMerge?: boolean, morphConfig?: IMorphConfig, resetMediaQuery?: boolean) => Promise<IVChart>;
|
|
39
42
|
updateSpecSync: (spec: ISpec, forceMerge?: boolean, morphConfig?: IMorphConfig, resetMediaQuery?: boolean) => void;
|
|
40
43
|
updateModelSpecSync: (filter: string | {
|
|
@@ -54,6 +57,9 @@ export interface IVChart {
|
|
|
54
57
|
updateState: (state: Record<string, Omit<IMarkStateSpec<unknown>, 'style'>>, filter?: (series: ISeries, mark: IMark, stateKey: string) => boolean) => void;
|
|
55
58
|
setSelected: (datum: MaybeArray<any> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier) => void;
|
|
56
59
|
setHovered: (datum: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier) => void;
|
|
60
|
+
clearState: (state: string) => void;
|
|
61
|
+
clearSelected: () => void;
|
|
62
|
+
clearHovered: () => void;
|
|
57
63
|
getCurrentTheme: () => ITheme;
|
|
58
64
|
getCurrentThemeName: () => string;
|
|
59
65
|
setCurrentTheme: (name: string) => Promise<IVChart>;
|
|
@@ -81,7 +87,8 @@ export interface IVChart {
|
|
|
81
87
|
getContainer: () => Maybe<HTMLElement>;
|
|
82
88
|
getComponents: () => IComponent[];
|
|
83
89
|
getDataSet: () => Maybe<DataSet>;
|
|
84
|
-
|
|
90
|
+
getScale: (scaleId: string) => IBaseScale | null;
|
|
91
|
+
convertDatumToPosition: (datum: Datum, dataLinkInfo?: DataLinkSeries, isRelativeToCanvas?: boolean, checkInViewData?: boolean) => IPoint | null;
|
|
85
92
|
convertValueToPosition: ((value: StringOrNumber, dataLinkInfo: DataLinkAxis, isRelativeToCanvas?: boolean) => number | null) & ((value: [StringOrNumber, StringOrNumber], dataLinkInfo: DataLinkSeries, isRelativeToCanvas?: boolean) => IPoint | null);
|
|
86
93
|
stopAnimation: () => void;
|
|
87
94
|
pauseAnimation: () => void;
|
package/types/core/vchart.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ISeries } from '../series/interface/series';
|
|
2
2
|
import type { ILayoutConstructor, LayoutCallBack } from '../layout/interface';
|
|
3
3
|
import type { IDataValues, IMarkStateSpec, IInitOption } from '../typings/spec/common';
|
|
4
|
+
import { RenderModeEnum } from '../typings/spec/common';
|
|
4
5
|
import type { ISeriesConstructor } from '../series/interface';
|
|
5
|
-
import type { DimensionIndexOption, IChart, IChartConstructor, IChartSpecInfo } from '../chart/interface';
|
|
6
|
+
import type { DimensionIndexOption, IChart, IChartConstructor, IChartOption, IChartSpecInfo } from '../chart/interface';
|
|
6
7
|
import type { IComponentConstructor } from '../component/interface';
|
|
7
8
|
import type { EventCallback, EventParams, EventQuery, EventType } from '../event/interface';
|
|
8
|
-
import type { IParserOptions } from '@visactor/vdataset
|
|
9
|
-
import
|
|
10
|
-
import { DataSet } from '@visactor/vdataset';
|
|
9
|
+
import type { IParserOptions, Transform } from '@visactor/vdataset';
|
|
10
|
+
import { DataSet, DataView } from '@visactor/vdataset';
|
|
11
11
|
import type { Stage } from '@visactor/vrender-core';
|
|
12
12
|
import type { GeoSourceType } from '../typings/geo';
|
|
13
13
|
import type { GeoSourceOption } from '../series/map/geo-source';
|
|
@@ -46,6 +46,7 @@ export declare class VChart implements IVChart {
|
|
|
46
46
|
static readonly Utils: {
|
|
47
47
|
measureText: (text: string, textSpec?: Partial<import("@visactor/vrender-core").ITextGraphicAttribute>, option?: Partial<import("@visactor/vutils").ITextMeasureOption>, useNaiveCanvas?: boolean) => import("@visactor/vutils").ITextSize;
|
|
48
48
|
};
|
|
49
|
+
static readonly vglobal: import("@visactor/vrender-core").IGlobal;
|
|
49
50
|
protected _originalSpec: any;
|
|
50
51
|
protected _spec: any;
|
|
51
52
|
getSpec(): any;
|
|
@@ -135,6 +136,9 @@ export declare class VChart implements IVChart {
|
|
|
135
136
|
updateState(state: Record<string, Omit<IMarkStateSpec<unknown>, 'style'>>, filter?: (series: ISeries, mark: IMark, stateKey: string) => boolean): void;
|
|
136
137
|
setSelected(datum: MaybeArray<any> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
137
138
|
setHovered(datum: MaybeArray<Datum> | null, filter?: (series: ISeries, mark: IMark) => boolean, region?: IRegionQuerier): void;
|
|
139
|
+
clearState(state: string): void;
|
|
140
|
+
clearSelected(): void;
|
|
141
|
+
clearHovered(): void;
|
|
138
142
|
private _updateCurrentTheme;
|
|
139
143
|
private _shouldChartResize;
|
|
140
144
|
private _getBackground;
|
|
@@ -167,11 +171,12 @@ export declare class VChart implements IVChart {
|
|
|
167
171
|
getCanvas(): HTMLCanvasElement | undefined;
|
|
168
172
|
getContainer(): Maybe<HTMLElement>;
|
|
169
173
|
getComponents(): import("../component/interface").IComponent[];
|
|
174
|
+
getScale(scaleId: string): import("@visactor/vscale").IBaseScale;
|
|
170
175
|
setDimensionIndex(value: StringOrNumber, opt?: DimensionIndexOption): void;
|
|
171
176
|
stopAnimation(): void;
|
|
172
177
|
pauseAnimation(): void;
|
|
173
178
|
resumeAnimation(): void;
|
|
174
|
-
convertDatumToPosition(datum: Datum, dataLinkInfo?: DataLinkSeries, isRelativeToCanvas?: boolean): IPoint | null;
|
|
179
|
+
convertDatumToPosition(datum: Datum, dataLinkInfo?: DataLinkSeries, isRelativeToCanvas?: boolean, checkInViewData?: boolean): IPoint | null;
|
|
175
180
|
convertValueToPosition(value: StringOrNumber, dataLinkInfo: DataLinkAxis, isRelativeToCanvas?: boolean): number | null;
|
|
176
181
|
convertValueToPosition(value: [StringOrNumber, StringOrNumber], dataLinkInfo: DataLinkSeries, isRelativeToCanvas?: boolean): IPoint | null;
|
|
177
182
|
getFunction(key: string): Function | null;
|
|
@@ -181,5 +186,7 @@ export declare class VChart implements IVChart {
|
|
|
181
186
|
setRuntimeSpec(spec: any): void;
|
|
182
187
|
private _initChartPlugin;
|
|
183
188
|
private _chartPluginApply;
|
|
189
|
+
protected _getMode(): (typeof RenderModeEnum)["desktop-browser"] | "desktop-browser" | "mobile-browser" | "node" | "worker" | "miniApp" | "wx" | "tt" | "harmony" | "desktop-miniApp" | "lynx";
|
|
190
|
+
protected _getChartOption(type: string): IChartOption;
|
|
184
191
|
}
|
|
185
192
|
export declare const registerVChartCore: () => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DataView } from '@visactor/vdataset';
|
|
2
|
-
import type { IAggrType } from '../../component/marker/interface';
|
|
3
|
-
import type { ICartesianSeries } from '../../series/interface';
|
|
2
|
+
import type { IAggrType, IMarkerSupportSeries } from '../../component/marker/interface';
|
|
4
3
|
import type { StringOrNumber } from '../../typings';
|
|
5
4
|
export type IOption = {
|
|
6
5
|
field: string;
|
|
@@ -11,15 +10,18 @@ export type IOptionAggrField = {
|
|
|
11
10
|
};
|
|
12
11
|
export type IOptionPos = IOptionAggrField | string | number | StringOrNumber[];
|
|
13
12
|
export type IOptionSeries = {
|
|
14
|
-
getRelativeSeries: () =>
|
|
15
|
-
getStartRelativeSeries: () =>
|
|
16
|
-
getEndRelativeSeries: () =>
|
|
13
|
+
getRelativeSeries: () => IMarkerSupportSeries;
|
|
14
|
+
getStartRelativeSeries: () => IMarkerSupportSeries;
|
|
15
|
+
getEndRelativeSeries: () => IMarkerSupportSeries;
|
|
17
16
|
};
|
|
18
|
-
export type IOptionCallback = (relativeSeriesData: any, startRelativeSeriesData: any, endRelativeSeriesData: any, relativeSeries:
|
|
17
|
+
export type IOptionCallback = (relativeSeriesData: any, startRelativeSeriesData: any, endRelativeSeriesData: any, relativeSeries: IMarkerSupportSeries, startRelative: IMarkerSupportSeries, endRelative: IMarkerSupportSeries) => IOptionPos;
|
|
19
18
|
export type IOptionAggr = {
|
|
20
19
|
x?: IOptionPos | IOptionCallback;
|
|
21
20
|
y?: IOptionPos | IOptionCallback;
|
|
22
|
-
|
|
21
|
+
angle?: IOptionPos | IOptionCallback;
|
|
22
|
+
radius?: IOptionPos | IOptionCallback;
|
|
23
|
+
areaName?: string | IOptionCallback;
|
|
24
|
+
getRefRelativeSeries?: () => IMarkerSupportSeries;
|
|
23
25
|
} & IOptionSeries;
|
|
24
26
|
export declare const markerMin: (_data: Array<DataView>, opt: IOption) => number;
|
|
25
27
|
export declare const markerMax: (_data: Array<DataView>, opt: IOption) => number;
|
|
@@ -31,4 +33,7 @@ export declare function markerMedian(_data: Array<DataView>, opt: IOption): numb
|
|
|
31
33
|
export declare function markerAggregation(_data: Array<DataView>, options: IOptionAggr[]): {
|
|
32
34
|
x: StringOrNumber[] | StringOrNumber | IOptionCallback | null;
|
|
33
35
|
y: StringOrNumber[] | StringOrNumber | IOptionCallback | null;
|
|
36
|
+
angle: StringOrNumber[] | StringOrNumber | IOptionCallback | null;
|
|
37
|
+
radius: StringOrNumber[] | StringOrNumber | IOptionCallback | null;
|
|
38
|
+
areaName: string | IOptionCallback | null;
|
|
34
39
|
}[];
|