vccs 0.2.0 → 0.4.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/README.md +151 -0
- package/dist/animation/Animate.d.ts +1 -1
- package/dist/cartesian/area/type.d.ts +3 -3
- package/dist/cartesian/axis/XAxis.d.ts +3 -3
- package/dist/cartesian/bar/type.d.ts +1 -13
- package/dist/cartesian/brush/components/Slide.d.ts +1 -1
- package/dist/cartesian/brush/components/TravellerLayer.d.ts +1 -1
- package/dist/cartesian/brush/type.d.ts +2 -1
- package/dist/cartesian/cartesian-axis/CartesianAxis.d.ts +7 -6
- package/dist/cartesian/funnel/type.d.ts +4 -5
- package/dist/cartesian/index.d.ts +1 -0
- package/dist/cartesian/line/Line.d.ts +7 -13
- package/dist/cartesian/line/type.d.ts +4 -17
- package/dist/cartesian/reference-area/ReferenceArea.d.ts +16 -16
- package/dist/cartesian/reference-dot/ReferenceDot.d.ts +143 -0
- package/dist/cartesian/reference-dot/index.d.ts +2 -0
- package/dist/cartesian/reference-line/ReferenceLine.d.ts +8 -8
- package/dist/cartesian/scatter/Scatter.d.ts +1 -1
- package/dist/chart/RechartsWrapper.d.ts +7 -3
- package/dist/chart/Surface.d.ts +2 -1
- package/dist/chart/Treemap.d.ts +237 -0
- package/dist/chart/generateCategoricalChart.d.ts +2 -1
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/treemapUtils.d.ts +22 -0
- package/dist/components/Customized.d.ts +23 -0
- package/dist/components/Text.d.ts +20 -5
- package/dist/components/Tooltip.d.ts +47 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/label/Label.d.ts +3 -3
- package/dist/components/label/types.d.ts +1 -1
- package/dist/container/Surface.d.ts +3 -2
- package/dist/es/cartesian/area/type.mjs +2 -4
- package/dist/es/cartesian/axis/XAxis.mjs +2 -2
- package/dist/es/cartesian/axis/YAxis.mjs +1 -1
- package/dist/es/cartesian/bar/Bar.mjs +2 -17
- package/dist/es/cartesian/bar/type.mjs +2 -16
- package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +2 -3
- package/dist/es/cartesian/cartesian-grid/const.mjs +7 -1
- package/dist/es/cartesian/funnel/Funnel.mjs +3 -18
- package/dist/es/cartesian/funnel/type.mjs +3 -5
- package/dist/es/cartesian/line/type.mjs +2 -7
- package/dist/es/cartesian/reference-area/ReferenceArea.mjs +6 -22
- package/dist/es/cartesian/reference-dot/ReferenceDot.mjs +134 -0
- package/dist/es/cartesian/reference-line/ReferenceLine.mjs +6 -19
- package/dist/es/chart/RechartsWrapper.mjs +2 -1
- package/dist/es/chart/Treemap.mjs +379 -0
- package/dist/es/chart/generateCategoricalChart.mjs +3 -2
- package/dist/es/chart/treemapUtils.mjs +32 -0
- package/dist/es/components/Customized.mjs +43 -0
- package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/es/components/Tooltip.mjs +14 -7
- package/dist/es/components/label/types.mjs +2 -1
- package/dist/es/components/legend/Legend.mjs +1 -1
- package/dist/es/components/legend/hooks/useLegend.mjs +8 -3
- package/dist/es/container/Surface.mjs +2 -4
- package/dist/es/hooks/publicHooks.mjs +207 -0
- package/dist/es/index.mjs +9 -1
- package/dist/es/polar/pie/Pie.mjs +1 -1
- package/dist/es/polar/pie/type.mjs +2 -4
- package/dist/es/shape/Curve.mjs +2 -1
- package/dist/es/shape/Polygon.mjs +19 -0
- package/dist/es/shape/Rectangle.mjs +0 -4
- package/dist/es/shape/Sector.mjs +4 -6
- package/dist/es/shape/Symbols.mjs +1 -1
- package/dist/es/shape/Trapezoid.mjs +5 -7
- package/dist/es/state/ReportChartProps.mjs +2 -4
- package/dist/es/state/hooks.mjs +21 -1
- package/dist/es/state/referenceElementsSlice.mjs +1 -1
- package/dist/es/state/selectors/axisSelectors.mjs +30 -1
- package/dist/es/state/selectors/tooltipSelectors.mjs +2 -2
- package/dist/es/types/common.mjs +12 -0
- package/dist/es/utils/VueUtils.mjs +1 -1
- package/dist/es/utils/cell.mjs +28 -0
- package/dist/es/utils/createCategoricalInverse.mjs +46 -0
- package/dist/es/utils/scale.mjs +46 -0
- package/dist/hooks/publicHooks.d.ts +143 -0
- package/dist/index.d.ts +1 -0
- package/dist/polar/pie/type.d.ts +2 -2
- package/dist/polar/radar/Radar.d.ts +4 -4
- package/dist/shape/Curve.d.ts +2 -1
- package/dist/shape/Polygon.d.ts +9 -0
- package/dist/shape/Rectangle.d.ts +0 -4
- package/dist/shape/Sector.d.ts +2 -2
- package/dist/shape/Symbols.d.ts +2 -1
- package/dist/shape/Trapezoid.d.ts +9 -10
- package/dist/shape/index.d.ts +1 -0
- package/dist/shape/types.d.ts +4 -5
- package/dist/state/ReportChartProps.d.ts +3 -3
- package/dist/state/rootPropsSlice.d.ts +2 -2
- package/dist/state/selectors/axisSelectors.d.ts +5 -0
- package/dist/types/axis.d.ts +2 -2
- package/dist/types/bar.d.ts +2 -6
- package/dist/types/categorical.d.ts +2 -2
- package/dist/types/common.d.ts +7 -1
- package/dist/types/tooltip.d.ts +2 -2
- package/dist/utils/cell.d.ts +11 -0
- package/dist/utils/createCategoricalInverse.d.ts +16 -0
- package/dist/utils/scale.d.ts +23 -0
- package/package.json +2 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { PropType, SVGAttributes, SlotsType } from 'vue';
|
|
2
|
+
import { AxisId } from '../../state/cartesianAxisSlice';
|
|
3
|
+
import { IfOverflow } from '../../types';
|
|
4
|
+
export interface ReferenceDotShapeProps extends SVGAttributes {
|
|
5
|
+
cx: number;
|
|
6
|
+
cy: number;
|
|
7
|
+
r: number;
|
|
8
|
+
fill?: string;
|
|
9
|
+
stroke?: string;
|
|
10
|
+
clipPath?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ReferenceDotSlots {
|
|
13
|
+
shape?: (props: ReferenceDotShapeProps) => any;
|
|
14
|
+
}
|
|
15
|
+
export declare const ReferenceDotVueProps: {
|
|
16
|
+
x: {
|
|
17
|
+
type: PropType<number | string>;
|
|
18
|
+
default: any;
|
|
19
|
+
};
|
|
20
|
+
y: {
|
|
21
|
+
type: PropType<number | string>;
|
|
22
|
+
default: any;
|
|
23
|
+
};
|
|
24
|
+
r: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
xAxisId: {
|
|
29
|
+
type: PropType<AxisId>;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
yAxisId: {
|
|
33
|
+
type: PropType<AxisId>;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
fill: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
stroke: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
label: {
|
|
45
|
+
type: PropType<string | number | boolean | Record<string, any>>;
|
|
46
|
+
default: any;
|
|
47
|
+
};
|
|
48
|
+
ifOverflow: {
|
|
49
|
+
type: PropType<IfOverflow>;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
declare const _ReferenceDot: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
54
|
+
x: {
|
|
55
|
+
type: PropType<number | string>;
|
|
56
|
+
default: any;
|
|
57
|
+
};
|
|
58
|
+
y: {
|
|
59
|
+
type: PropType<number | string>;
|
|
60
|
+
default: any;
|
|
61
|
+
};
|
|
62
|
+
r: {
|
|
63
|
+
type: NumberConstructor;
|
|
64
|
+
default: number;
|
|
65
|
+
};
|
|
66
|
+
xAxisId: {
|
|
67
|
+
type: PropType<AxisId>;
|
|
68
|
+
default: number;
|
|
69
|
+
};
|
|
70
|
+
yAxisId: {
|
|
71
|
+
type: PropType<AxisId>;
|
|
72
|
+
default: number;
|
|
73
|
+
};
|
|
74
|
+
fill: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
stroke: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
label: {
|
|
83
|
+
type: PropType<string | number | boolean | Record<string, any>>;
|
|
84
|
+
default: any;
|
|
85
|
+
};
|
|
86
|
+
ifOverflow: {
|
|
87
|
+
type: PropType<IfOverflow>;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
90
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
91
|
+
x: {
|
|
92
|
+
type: PropType<number | string>;
|
|
93
|
+
default: any;
|
|
94
|
+
};
|
|
95
|
+
y: {
|
|
96
|
+
type: PropType<number | string>;
|
|
97
|
+
default: any;
|
|
98
|
+
};
|
|
99
|
+
r: {
|
|
100
|
+
type: NumberConstructor;
|
|
101
|
+
default: number;
|
|
102
|
+
};
|
|
103
|
+
xAxisId: {
|
|
104
|
+
type: PropType<AxisId>;
|
|
105
|
+
default: number;
|
|
106
|
+
};
|
|
107
|
+
yAxisId: {
|
|
108
|
+
type: PropType<AxisId>;
|
|
109
|
+
default: number;
|
|
110
|
+
};
|
|
111
|
+
fill: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
115
|
+
stroke: {
|
|
116
|
+
type: StringConstructor;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
label: {
|
|
120
|
+
type: PropType<string | number | boolean | Record<string, any>>;
|
|
121
|
+
default: any;
|
|
122
|
+
};
|
|
123
|
+
ifOverflow: {
|
|
124
|
+
type: PropType<IfOverflow>;
|
|
125
|
+
default: string;
|
|
126
|
+
};
|
|
127
|
+
}>> & Readonly<{}>, {
|
|
128
|
+
fill: string;
|
|
129
|
+
x: string | number;
|
|
130
|
+
y: string | number;
|
|
131
|
+
yAxisId: AxisId;
|
|
132
|
+
xAxisId: AxisId;
|
|
133
|
+
ifOverflow: IfOverflow;
|
|
134
|
+
r: number;
|
|
135
|
+
stroke: string;
|
|
136
|
+
label: string | number | boolean | Record<string, any>;
|
|
137
|
+
}, SlotsType<ReferenceDotSlots>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
138
|
+
export declare const ReferenceDot: typeof _ReferenceDot & {
|
|
139
|
+
new (): {
|
|
140
|
+
$slots: ReferenceDotSlots;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
export {};
|
|
@@ -38,8 +38,8 @@ export declare const ReferenceLineVueProps: {
|
|
|
38
38
|
type: PropType<IfOverflow>;
|
|
39
39
|
default: string;
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
type:
|
|
41
|
+
class: {
|
|
42
|
+
type: PropType<import('../../types').VueClassValue>;
|
|
43
43
|
default: any;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
@@ -80,8 +80,8 @@ export declare const ReferenceLine: import('vue').DefineComponent<import('vue').
|
|
|
80
80
|
type: PropType<IfOverflow>;
|
|
81
81
|
default: string;
|
|
82
82
|
};
|
|
83
|
-
|
|
84
|
-
type:
|
|
83
|
+
class: {
|
|
84
|
+
type: PropType<import('../../types').VueClassValue>;
|
|
85
85
|
default: any;
|
|
86
86
|
};
|
|
87
87
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -121,8 +121,8 @@ export declare const ReferenceLine: import('vue').DefineComponent<import('vue').
|
|
|
121
121
|
type: PropType<IfOverflow>;
|
|
122
122
|
default: string;
|
|
123
123
|
};
|
|
124
|
-
|
|
125
|
-
type:
|
|
124
|
+
class: {
|
|
125
|
+
type: PropType<import('../../types').VueClassValue>;
|
|
126
126
|
default: any;
|
|
127
127
|
};
|
|
128
128
|
}>> & Readonly<{}>, {
|
|
@@ -132,8 +132,8 @@ export declare const ReferenceLine: import('vue').DefineComponent<import('vue').
|
|
|
132
132
|
yAxisId: AxisId;
|
|
133
133
|
xAxisId: AxisId;
|
|
134
134
|
ifOverflow: IfOverflow;
|
|
135
|
+
class: import('../../types').VueClassValue;
|
|
135
136
|
stroke: string;
|
|
136
|
-
label: string | number | boolean | Record<string, any>;
|
|
137
|
-
className: string;
|
|
138
137
|
strokeWidth: string | number;
|
|
138
|
+
label: string | number | boolean | Record<string, any>;
|
|
139
139
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -148,11 +148,11 @@ export declare const Scatter: import('vue').DefineComponent<import('vue').Extrac
|
|
|
148
148
|
xAxisId: string | number;
|
|
149
149
|
line: boolean | Record<string, any>;
|
|
150
150
|
dataKey: DataKey<any>;
|
|
151
|
+
transition: AnimationOptions;
|
|
151
152
|
name: string | number;
|
|
152
153
|
data: readonly Record<string, any>[];
|
|
153
154
|
label: boolean | Record<string, any>;
|
|
154
155
|
hide: boolean;
|
|
155
|
-
transition: AnimationOptions;
|
|
156
156
|
tooltipType: "none";
|
|
157
157
|
legendType: string;
|
|
158
158
|
isAnimationActive: boolean;
|
|
@@ -2,7 +2,8 @@ import { CSSProperties, PropType } from 'vue';
|
|
|
2
2
|
import { CategoricalChartFunc } from '../types';
|
|
3
3
|
export declare const RechartsWrapper: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
class: {
|
|
5
|
-
type:
|
|
5
|
+
type: PropType<import('../types').VueClassValue>;
|
|
6
|
+
default: any;
|
|
6
7
|
};
|
|
7
8
|
height: {
|
|
8
9
|
type: NumberConstructor;
|
|
@@ -50,7 +51,8 @@ export declare const RechartsWrapper: import('vue').DefineComponent<import('vue'
|
|
|
50
51
|
};
|
|
51
52
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
52
53
|
class: {
|
|
53
|
-
type:
|
|
54
|
+
type: PropType<import('../types').VueClassValue>;
|
|
55
|
+
default: any;
|
|
54
56
|
};
|
|
55
57
|
height: {
|
|
56
58
|
type: NumberConstructor;
|
|
@@ -96,4 +98,6 @@ export declare const RechartsWrapper: import('vue').DefineComponent<import('vue'
|
|
|
96
98
|
type: NumberConstructor;
|
|
97
99
|
required: true;
|
|
98
100
|
};
|
|
99
|
-
}>> & Readonly<{}>, {
|
|
101
|
+
}>> & Readonly<{}>, {
|
|
102
|
+
class: import('../types').VueClassValue;
|
|
103
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/chart/Surface.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'vue';
|
|
2
|
+
import { VueClassValue } from '../types';
|
|
2
3
|
interface SurfaceProps {
|
|
3
4
|
width: number;
|
|
4
5
|
height: number;
|
|
@@ -8,7 +9,7 @@ interface SurfaceProps {
|
|
|
8
9
|
width?: number;
|
|
9
10
|
height?: number;
|
|
10
11
|
};
|
|
11
|
-
class?:
|
|
12
|
+
class?: VueClassValue;
|
|
12
13
|
style?: CSSProperties;
|
|
13
14
|
title?: string;
|
|
14
15
|
desc?: string;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { PropType, SlotsType } from 'vue';
|
|
2
|
+
import { AnimationOptions } from 'motion-v';
|
|
3
|
+
import { TooltipPayloadSearcher } from '../state/tooltipSlice';
|
|
4
|
+
import { TreemapLayoutNode } from './treemapUtils';
|
|
5
|
+
export interface TreemapContentSlotProps extends TreemapLayoutNode {
|
|
6
|
+
index: number;
|
|
7
|
+
fill: string;
|
|
8
|
+
stroke: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TreemapSlots {
|
|
11
|
+
content?: (props: TreemapContentSlotProps) => any;
|
|
12
|
+
default?: () => any;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Tooltip payload searcher for Treemap — navigates nested node structure
|
|
16
|
+
* using a path string like 'children[0].children[1]'.
|
|
17
|
+
*/
|
|
18
|
+
export declare const treemapPayloadSearcher: TooltipPayloadSearcher;
|
|
19
|
+
export declare const TreemapVueProps: {
|
|
20
|
+
data: {
|
|
21
|
+
type: PropType<Record<string, any>[]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
dataKey: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
nameKey: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
width: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
height: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
aspectRatio: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
fill: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
stroke: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
type: {
|
|
53
|
+
type: PropType<"flat" | "nest">;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
colorPanel: {
|
|
57
|
+
type: PropType<string[]>;
|
|
58
|
+
default: any;
|
|
59
|
+
};
|
|
60
|
+
isAnimationActive: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
transition: {
|
|
65
|
+
type: PropType<AnimationOptions>;
|
|
66
|
+
default: () => {
|
|
67
|
+
duration: number;
|
|
68
|
+
ease: "easeOut";
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
onClick: {
|
|
72
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
73
|
+
default: any;
|
|
74
|
+
};
|
|
75
|
+
onMouseEnter: {
|
|
76
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
77
|
+
default: any;
|
|
78
|
+
};
|
|
79
|
+
onMouseLeave: {
|
|
80
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
81
|
+
default: any;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Treemap chart — hierarchical data visualization using nested rectangles.
|
|
86
|
+
*
|
|
87
|
+
* Supports `<Tooltip>` as a child component (same pattern as BarChart, LineChart, etc.).
|
|
88
|
+
*
|
|
89
|
+
* Usage:
|
|
90
|
+
* ```vue
|
|
91
|
+
* <Treemap :data="data" data-key="value" :width="600" :height="400">
|
|
92
|
+
* <Tooltip />
|
|
93
|
+
* </Treemap>
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare const Treemap: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
97
|
+
data: {
|
|
98
|
+
type: PropType<Record<string, any>[]>;
|
|
99
|
+
required: true;
|
|
100
|
+
};
|
|
101
|
+
dataKey: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
nameKey: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
width: {
|
|
110
|
+
type: NumberConstructor;
|
|
111
|
+
required: true;
|
|
112
|
+
};
|
|
113
|
+
height: {
|
|
114
|
+
type: NumberConstructor;
|
|
115
|
+
required: true;
|
|
116
|
+
};
|
|
117
|
+
aspectRatio: {
|
|
118
|
+
type: NumberConstructor;
|
|
119
|
+
default: number;
|
|
120
|
+
};
|
|
121
|
+
fill: {
|
|
122
|
+
type: StringConstructor;
|
|
123
|
+
default: string;
|
|
124
|
+
};
|
|
125
|
+
stroke: {
|
|
126
|
+
type: StringConstructor;
|
|
127
|
+
default: string;
|
|
128
|
+
};
|
|
129
|
+
type: {
|
|
130
|
+
type: PropType<"flat" | "nest">;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
colorPanel: {
|
|
134
|
+
type: PropType<string[]>;
|
|
135
|
+
default: any;
|
|
136
|
+
};
|
|
137
|
+
isAnimationActive: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: boolean;
|
|
140
|
+
};
|
|
141
|
+
transition: {
|
|
142
|
+
type: PropType<AnimationOptions>;
|
|
143
|
+
default: () => {
|
|
144
|
+
duration: number;
|
|
145
|
+
ease: "easeOut";
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
onClick: {
|
|
149
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
150
|
+
default: any;
|
|
151
|
+
};
|
|
152
|
+
onMouseEnter: {
|
|
153
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
154
|
+
default: any;
|
|
155
|
+
};
|
|
156
|
+
onMouseLeave: {
|
|
157
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
158
|
+
default: any;
|
|
159
|
+
};
|
|
160
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
161
|
+
data: {
|
|
162
|
+
type: PropType<Record<string, any>[]>;
|
|
163
|
+
required: true;
|
|
164
|
+
};
|
|
165
|
+
dataKey: {
|
|
166
|
+
type: StringConstructor;
|
|
167
|
+
default: string;
|
|
168
|
+
};
|
|
169
|
+
nameKey: {
|
|
170
|
+
type: StringConstructor;
|
|
171
|
+
default: string;
|
|
172
|
+
};
|
|
173
|
+
width: {
|
|
174
|
+
type: NumberConstructor;
|
|
175
|
+
required: true;
|
|
176
|
+
};
|
|
177
|
+
height: {
|
|
178
|
+
type: NumberConstructor;
|
|
179
|
+
required: true;
|
|
180
|
+
};
|
|
181
|
+
aspectRatio: {
|
|
182
|
+
type: NumberConstructor;
|
|
183
|
+
default: number;
|
|
184
|
+
};
|
|
185
|
+
fill: {
|
|
186
|
+
type: StringConstructor;
|
|
187
|
+
default: string;
|
|
188
|
+
};
|
|
189
|
+
stroke: {
|
|
190
|
+
type: StringConstructor;
|
|
191
|
+
default: string;
|
|
192
|
+
};
|
|
193
|
+
type: {
|
|
194
|
+
type: PropType<"flat" | "nest">;
|
|
195
|
+
default: string;
|
|
196
|
+
};
|
|
197
|
+
colorPanel: {
|
|
198
|
+
type: PropType<string[]>;
|
|
199
|
+
default: any;
|
|
200
|
+
};
|
|
201
|
+
isAnimationActive: {
|
|
202
|
+
type: BooleanConstructor;
|
|
203
|
+
default: boolean;
|
|
204
|
+
};
|
|
205
|
+
transition: {
|
|
206
|
+
type: PropType<AnimationOptions>;
|
|
207
|
+
default: () => {
|
|
208
|
+
duration: number;
|
|
209
|
+
ease: "easeOut";
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
onClick: {
|
|
213
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
214
|
+
default: any;
|
|
215
|
+
};
|
|
216
|
+
onMouseEnter: {
|
|
217
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
218
|
+
default: any;
|
|
219
|
+
};
|
|
220
|
+
onMouseLeave: {
|
|
221
|
+
type: PropType<(node: any, e: MouseEvent) => void>;
|
|
222
|
+
default: any;
|
|
223
|
+
};
|
|
224
|
+
}>> & Readonly<{}>, {
|
|
225
|
+
fill: string;
|
|
226
|
+
type: "flat" | "nest";
|
|
227
|
+
dataKey: string;
|
|
228
|
+
aspectRatio: number;
|
|
229
|
+
stroke: string;
|
|
230
|
+
transition: AnimationOptions;
|
|
231
|
+
onClick: (node: any, e: MouseEvent) => void;
|
|
232
|
+
nameKey: string;
|
|
233
|
+
isAnimationActive: boolean;
|
|
234
|
+
onMouseEnter: (node: any, e: MouseEvent) => void;
|
|
235
|
+
onMouseLeave: (node: any, e: MouseEvent) => void;
|
|
236
|
+
colorPanel: string[];
|
|
237
|
+
}, SlotsType<TreemapSlots>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/chart/index.d.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TreemapLayoutNode {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
depth: number;
|
|
7
|
+
name: string;
|
|
8
|
+
value: number;
|
|
9
|
+
payload: Record<string, any>;
|
|
10
|
+
color?: string;
|
|
11
|
+
root: number;
|
|
12
|
+
}
|
|
13
|
+
export interface TreemapLayoutOptions {
|
|
14
|
+
data: Record<string, any>[];
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
dataKey: string;
|
|
18
|
+
aspectRatio?: number;
|
|
19
|
+
nameKey?: string;
|
|
20
|
+
colorPanel?: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function computeTreemapLayout(options: TreemapLayoutOptions): TreemapLayoutNode[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SlotsType } from 'vue';
|
|
2
|
+
import { CartesianGraphicalItemSettings, PolarGraphicalItemSettings } from '../state/graphicalItemsSlice';
|
|
3
|
+
import { DataKey } from '../types';
|
|
4
|
+
export interface FormattedGraphicalItem {
|
|
5
|
+
type: string;
|
|
6
|
+
dataKey: DataKey<any> | undefined;
|
|
7
|
+
props: CartesianGraphicalItemSettings | PolarGraphicalItemSettings;
|
|
8
|
+
}
|
|
9
|
+
export interface CustomizedSlotProps {
|
|
10
|
+
formattedGraphicalItems: FormattedGraphicalItem[];
|
|
11
|
+
chartWidth: number;
|
|
12
|
+
chartHeight: number;
|
|
13
|
+
offset: {
|
|
14
|
+
top: number;
|
|
15
|
+
right: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
left: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface CustomizedSlots {
|
|
21
|
+
default?: (props: CustomizedSlotProps) => any;
|
|
22
|
+
}
|
|
23
|
+
export declare const Customized: import('vue').DefineComponent<{}, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<CustomizedSlots>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: SVGTextElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
11
|
x: {
|
|
3
12
|
type: (NumberConstructor | StringConstructor)[];
|
|
4
13
|
default: number;
|
|
@@ -134,16 +143,22 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
134
143
|
x: string | number;
|
|
135
144
|
y: string | number;
|
|
136
145
|
value: string | number;
|
|
137
|
-
style: Record<string, any>;
|
|
138
|
-
dx: number;
|
|
139
|
-
dy: number;
|
|
140
|
-
angle: number;
|
|
141
146
|
lineHeight: string | number;
|
|
142
147
|
textAnchor: string;
|
|
143
148
|
capHeight: string | number;
|
|
149
|
+
dx: number;
|
|
150
|
+
dy: number;
|
|
151
|
+
style: Record<string, any>;
|
|
152
|
+
angle: number;
|
|
144
153
|
scaleToFit: boolean;
|
|
145
154
|
verticalAnchor: string;
|
|
146
155
|
breakAll: boolean;
|
|
147
156
|
maxLines: number;
|
|
148
157
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGTextElement>;
|
|
158
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
149
159
|
export default _default;
|
|
160
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
161
|
+
new (): {
|
|
162
|
+
$slots: S;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { PropType, SlotsType } from 'vue';
|
|
2
2
|
import { TooltipIndex, TooltipPayload, TooltipPayloadEntry } from '../state/tooltipSlice';
|
|
3
3
|
import { AxisId } from '../state/cartesianAxisSlice';
|
|
4
|
-
import { ChartCoordinate, Coordinate } from '../types';
|
|
4
|
+
import { ChartCoordinate, Coordinate, LayoutType } from '../types';
|
|
5
5
|
import { TooltipTrigger } from '../types/tooltip';
|
|
6
|
+
import { Point } from '../shape';
|
|
6
7
|
export type ContentType = any | ((props: TooltipContentProps) => any);
|
|
7
8
|
export type TooltipContentProps = {
|
|
8
9
|
label?: string | number;
|
|
@@ -16,6 +17,49 @@ type AllowInDimension = {
|
|
|
16
17
|
x: boolean;
|
|
17
18
|
y: boolean;
|
|
18
19
|
};
|
|
20
|
+
type CursorSlotCommon = {
|
|
21
|
+
class: string | string[];
|
|
22
|
+
style: {
|
|
23
|
+
pointerEvents: 'none';
|
|
24
|
+
};
|
|
25
|
+
/** Chart area offset — same fields spread by Recharts: left, top, width, height */
|
|
26
|
+
left: number;
|
|
27
|
+
top: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
payload: TooltipPayload;
|
|
31
|
+
/** Active tooltip index — named payloadIndex to match Recharts */
|
|
32
|
+
payloadIndex: string | undefined;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
export type CrossCursorSlotProps = CursorSlotCommon & {
|
|
36
|
+
stroke: string;
|
|
37
|
+
fill: string;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
};
|
|
41
|
+
export type RectangleCursorSlotProps = CursorSlotCommon & {
|
|
42
|
+
stroke: string;
|
|
43
|
+
fill: string;
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
export type SectorCursorSlotProps = CursorSlotCommon & {
|
|
48
|
+
stroke: string;
|
|
49
|
+
fill: string;
|
|
50
|
+
cx: number;
|
|
51
|
+
cy: number;
|
|
52
|
+
startAngle: number;
|
|
53
|
+
endAngle: number;
|
|
54
|
+
innerRadius: number;
|
|
55
|
+
outerRadius: number;
|
|
56
|
+
};
|
|
57
|
+
export type CurveCursorSlotProps = CursorSlotCommon & {
|
|
58
|
+
stroke: string;
|
|
59
|
+
layout: LayoutType;
|
|
60
|
+
points: ReadonlyArray<Point>;
|
|
61
|
+
};
|
|
62
|
+
export type CursorSlotProps = CrossCursorSlotProps | RectangleCursorSlotProps | SectorCursorSlotProps | CurveCursorSlotProps;
|
|
19
63
|
type UniqueFunc<T> = (entry: T) => unknown;
|
|
20
64
|
export type UniqueOption<T> = boolean | UniqueFunc<T>;
|
|
21
65
|
export declare function getUniqPayload<T>(payload: ReadonlyArray<T>, option: UniqueOption<T>, defaultUniqBy: UniqueFunc<T>): ReadonlyArray<T>;
|
|
@@ -224,9 +268,9 @@ export declare const Tooltip: import('vue').DefineComponent<import('vue').Extrac
|
|
|
224
268
|
readonly default: " : ";
|
|
225
269
|
};
|
|
226
270
|
}>> & Readonly<{}>, {
|
|
227
|
-
readonly style: Record<string, any>;
|
|
228
271
|
readonly cursor: boolean | object;
|
|
229
272
|
readonly offset: number;
|
|
273
|
+
readonly style: Record<string, any>;
|
|
230
274
|
readonly isAnimationActive: boolean;
|
|
231
275
|
readonly includeHidden: boolean;
|
|
232
276
|
readonly active: boolean;
|
|
@@ -244,7 +288,7 @@ export declare const Tooltip: import('vue').DefineComponent<import('vue').Extrac
|
|
|
244
288
|
readonly filterNull: boolean;
|
|
245
289
|
}, SlotsType<{
|
|
246
290
|
content?: (props: TooltipContentProps) => any;
|
|
247
|
-
cursor?: (props:
|
|
291
|
+
cursor?: (props: CursorSlotProps) => any;
|
|
248
292
|
default?: () => any;
|
|
249
293
|
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
250
294
|
export default Tooltip;
|