x-next 1.6.0 → 1.8.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/AI_USAGE.md +182 -4
- package/CHANGELOG.md +74 -0
- package/dist/_hooks/use-chart-size.d.ts +25 -0
- package/dist/_utils/chart/index.d.ts +6 -0
- package/dist/_utils/chart/padding.d.ts +15 -0
- package/dist/_utils/chart/path.d.ts +34 -0
- package/dist/_utils/chart/scale.d.ts +55 -0
- package/dist/components/_components/chart/ChartAxis.d.ts +85 -0
- package/dist/components/_components/chart/ChartLegend.d.ts +26 -0
- package/dist/components/_components/chart/ChartTooltip.d.ts +76 -0
- package/dist/components/_components/chart/colors.d.ts +10 -0
- package/dist/components/_components/chart/interface.d.ts +38 -0
- package/dist/components/bar-chart/BarChart.d.ts +278 -0
- package/dist/components/bar-chart/helpers/layout.d.ts +55 -0
- package/dist/components/bar-chart/index.d.ts +600 -0
- package/dist/components/bar-chart/interface.d.ts +74 -0
- package/dist/components/bar-chart/props.d.ts +145 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/draggable/Draggable.d.ts +1 -1
- package/dist/components/draggable/index.d.ts +2 -2
- package/dist/components/drawer/index.d.ts +6 -6
- package/dist/components/drawer/src/Drawer.vue.d.ts +3 -3
- package/dist/components/dropdown/Dropdown.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +5 -5
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +29 -29
- package/dist/components/form/FormItem.vue.d.ts +12 -12
- package/dist/components/form/form-item-label.vue.d.ts +3 -3
- package/dist/components/form/index.d.ts +24 -24
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +3 -3
- package/dist/components/form-slider/index.d.ts +6 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
- package/dist/components/grid/Row.vue.d.ts +3 -3
- package/dist/components/grid/index.d.ts +9 -9
- package/dist/components/heatmap/Heatmap.d.ts +10 -0
- package/dist/components/heatmap/index.d.ts +30 -0
- package/dist/components/image/Image.vue.d.ts +125 -17
- package/dist/components/image/ImagePreview.vue.d.ts +97 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +100 -7
- package/dist/components/image/hooks/use-image-drag.d.ts +2 -2
- package/dist/components/image/index.d.ts +712 -124
- package/dist/components/image/interface.d.ts +9 -1
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/index.d.ts +4 -0
- package/dist/components/line-chart/LineChart.d.ts +295 -0
- package/dist/components/line-chart/helpers/layout.d.ts +74 -0
- package/dist/components/line-chart/index.d.ts +614 -0
- package/dist/components/line-chart/interface.d.ts +76 -0
- package/dist/components/line-chart/props.d.ts +173 -0
- package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/pie-chart/PieChart.d.ts +219 -0
- package/dist/components/pie-chart/index.d.ts +470 -0
- package/dist/components/pie-chart/interface.d.ts +58 -0
- package/dist/components/pie-chart/props.d.ts +107 -0
- package/dist/components/popconfirm/src/popup.vue.d.ts +3 -3
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/space/Space.d.ts +1 -1
- package/dist/components/space/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
- package/dist/components/time-picker/index.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trend-chart/components/TrendChart.d.ts +19 -96
- package/dist/components/trend-chart/index.d.ts +33 -187
- package/dist/components/trend-chart/props.d.ts +9 -78
- package/dist/components/trend-chart/themes.d.ts +0 -1
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/components/upload/Upload.d.ts +372 -0
- package/dist/components/upload/context.d.ts +28 -0
- package/dist/components/upload/index.d.ts +656 -0
- package/dist/components/upload/interface.d.ts +110 -0
- package/dist/components/upload/props.d.ts +321 -0
- package/dist/components/upload/upload-list-item.d.ts +15 -0
- package/dist/components/upload/upload-list.d.ts +11 -0
- package/dist/components/upload/upload-picture-item.d.ts +20 -0
- package/dist/components/upload/upload-trigger.d.ts +8 -0
- package/dist/components/upload/utils.d.ts +48 -0
- package/dist/es/_hooks/use-chart-size.js +25 -0
- package/dist/es/_styles/palette-aliases.js +7 -4
- package/dist/es/_utils/chart/padding.js +22 -0
- package/dist/es/_utils/chart/path.js +69 -0
- package/dist/es/_utils/chart/scale.js +77 -0
- package/dist/es/components/_components/chart/ChartAxis.js +79 -0
- package/dist/es/components/_components/chart/ChartLegend.js +53 -0
- package/dist/es/components/_components/chart/ChartTooltip.js +64 -0
- package/dist/es/components/_components/chart/colors.js +12 -0
- package/dist/es/components/bar-chart/BarChart.js +470 -0
- package/dist/es/components/bar-chart/helpers/layout.js +53 -0
- package/dist/es/components/bar-chart/index.js +8 -0
- package/dist/es/components/bar-chart/props.js +148 -0
- package/dist/es/components/heatmap/Heatmap.js +244 -169
- package/dist/es/components/image/Image.vue.js +55 -45
- package/dist/es/components/image/Image.vue2.js +113 -92
- package/dist/es/components/image/ImagePreview.vue.js +66 -53
- package/dist/es/components/image/ImagePreview.vue2.js +219 -171
- package/dist/es/components/image/ImagePreviewAction.js +12 -15
- package/dist/es/components/image/ImagePreviewGroup.vue.js +21 -20
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +45 -39
- package/dist/es/components/image/hooks/use-image-drag.js +16 -14
- package/dist/es/components/index.js +136 -128
- package/dist/es/components/line-chart/LineChart.js +532 -0
- package/dist/es/components/line-chart/helpers/layout.js +80 -0
- package/dist/es/components/line-chart/index.js +8 -0
- package/dist/es/components/line-chart/props.js +178 -0
- package/dist/es/components/pie-chart/PieChart.js +397 -0
- package/dist/es/components/pie-chart/index.js +8 -0
- package/dist/es/components/pie-chart/props.js +104 -0
- package/dist/es/components/trend-chart/components/TrendChart.js +143 -183
- package/dist/es/components/trend-chart/components/trend-chart-curve.js +85 -81
- package/dist/es/components/trend-chart/props.js +28 -74
- package/dist/es/components/trend-chart/themes.js +30 -31
- package/dist/es/components/upload/Upload.js +420 -0
- package/dist/es/components/upload/context.js +4 -0
- package/dist/es/components/upload/index.js +8 -0
- package/dist/es/components/upload/props.js +321 -0
- package/dist/es/components/upload/upload-list-item.js +138 -0
- package/dist/es/components/upload/upload-list.js +48 -0
- package/dist/es/components/upload/upload-picture-item.js +109 -0
- package/dist/es/components/upload/upload-trigger.js +89 -0
- package/dist/es/components/upload/utils.js +195 -0
- package/dist/es/icons/_self/upload-icons.js +103 -0
- package/dist/es/index.js +197 -189
- package/dist/es/locale/en-US.js +30 -1
- package/dist/es/locale/zh-CN.js +30 -1
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/upload-icons.d.ts +523 -0
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +45 -0
- package/dist/style/bar-chart.css +1 -0
- package/dist/style/bar-chart.js +2 -0
- package/dist/style/base.css +1 -1
- package/dist/style/heatmap.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/line-chart.css +1 -0
- package/dist/style/line-chart.js +2 -0
- package/dist/style/pie-chart.css +1 -0
- package/dist/style/pie-chart.js +2 -0
- package/dist/style/upload.css +1 -0
- package/dist/style/upload.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
- package/volar.d.ts +4 -0
- package/dist/components/trend-chart/components/trend-chart-grid.d.ts +0 -55
- package/dist/components/trend-chart/components/trend-chart-labels.d.ts +0 -26
- package/dist/components/trend-chart/helpers/genPath.d.ts +0 -8
- package/dist/components/trend-chart/helpers/getPadding.d.ts +0 -8
- package/dist/components/trend-chart/helpers/validatePadding.d.ts +0 -2
- package/dist/es/_hooks/use-popup-overflow-hidden.js +0 -29
- package/dist/es/components/trend-chart/components/trend-chart-grid.js +0 -62
- package/dist/es/components/trend-chart/components/trend-chart-labels.js +0 -75
- package/dist/es/components/trend-chart/helpers/genPath.js +0 -22
- package/dist/es/components/trend-chart/helpers/getPadding.js +0 -21
- package/dist/es/components/trend-chart/helpers/validatePadding.js +0 -7
|
@@ -8,7 +8,7 @@ export interface ImageProps {
|
|
|
8
8
|
description?: string;
|
|
9
9
|
fit?: '' | 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
10
10
|
alt?: string;
|
|
11
|
-
hideFooter: boolean;
|
|
11
|
+
hideFooter: boolean | 'never';
|
|
12
12
|
footerPosition: 'inner' | 'outer';
|
|
13
13
|
showLoader: boolean;
|
|
14
14
|
preview: boolean;
|
|
@@ -19,6 +19,11 @@ export interface ImageProps {
|
|
|
19
19
|
error?: Slot;
|
|
20
20
|
loader?: Slot;
|
|
21
21
|
onPreviewVisibleChange?: (visible: boolean) => void;
|
|
22
|
+
onLoad?: (event: Event) => void;
|
|
23
|
+
onError?: (event: Event) => void;
|
|
24
|
+
renderToBody?: boolean;
|
|
25
|
+
footerClass?: string | unknown[] | Record<string, boolean>;
|
|
26
|
+
'onUpdate:previewVisible'?: (visible: boolean) => void;
|
|
22
27
|
}
|
|
23
28
|
export interface ImagePreviewProps {
|
|
24
29
|
src?: string;
|
|
@@ -33,6 +38,8 @@ export interface ImagePreviewProps {
|
|
|
33
38
|
wheelZoom?: boolean;
|
|
34
39
|
defaultScale?: number;
|
|
35
40
|
zoomRate?: number;
|
|
41
|
+
renderToBody?: boolean;
|
|
42
|
+
'onUpdate:visible'?: (visible: boolean) => void;
|
|
36
43
|
groupArrowProps?: Record<string, any>;
|
|
37
44
|
onClose?: () => void;
|
|
38
45
|
}
|
|
@@ -43,6 +50,7 @@ export interface ImagePreviewGroupProps extends Omit<ImagePreviewProps, 'src' |
|
|
|
43
50
|
infinite: boolean;
|
|
44
51
|
onChange?: (index: number) => void;
|
|
45
52
|
onVisibleChange?: (visible: boolean) => void;
|
|
53
|
+
'onUpdate:current'?: (index: number) => void;
|
|
46
54
|
}
|
|
47
55
|
export interface ActionType {
|
|
48
56
|
key: string;
|
|
@@ -222,8 +222,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
222
222
|
}, import('vue').PublicProps, {
|
|
223
223
|
mini: boolean;
|
|
224
224
|
disabled: boolean;
|
|
225
|
-
position: "top" | "tl" | "tr" | "bottom" | "bl" | "br" | "left" | "lt" | "lb" | "right" | "rt" | "rb";
|
|
226
225
|
trigger: "hover" | "click" | "focus" | "contextMenu" | ("hover" | "click" | "focus" | "contextMenu")[];
|
|
226
|
+
position: "top" | "tl" | "tr" | "bottom" | "bl" | "br" | "left" | "lt" | "lb" | "right" | "rt" | "rb";
|
|
227
227
|
animationName: string;
|
|
228
228
|
autoFitPosition: boolean;
|
|
229
229
|
popupVisible: boolean;
|
|
@@ -408,8 +408,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
408
408
|
}>, () => VNode, {}, {}, {}, {
|
|
409
409
|
mini: boolean;
|
|
410
410
|
disabled: boolean;
|
|
411
|
-
position: "top" | "tl" | "tr" | "bottom" | "bl" | "br" | "left" | "lt" | "lb" | "right" | "rt" | "rb";
|
|
412
411
|
trigger: "hover" | "click" | "focus" | "contextMenu" | ("hover" | "click" | "focus" | "contextMenu")[];
|
|
412
|
+
position: "top" | "tl" | "tr" | "bottom" | "bl" | "br" | "left" | "lt" | "lb" | "right" | "rt" | "rb";
|
|
413
413
|
animationName: string;
|
|
414
414
|
autoFitPosition: boolean;
|
|
415
415
|
popupVisible: boolean;
|
|
@@ -597,8 +597,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
597
597
|
}, string, {
|
|
598
598
|
mini: boolean;
|
|
599
599
|
disabled: boolean;
|
|
600
|
-
position: "top" | "tl" | "tr" | "bottom" | "bl" | "br" | "left" | "lt" | "lb" | "right" | "rt" | "rb";
|
|
601
600
|
trigger: "hover" | "click" | "focus" | "contextMenu" | ("hover" | "click" | "focus" | "contextMenu")[];
|
|
601
|
+
position: "top" | "tl" | "tr" | "bottom" | "bl" | "br" | "left" | "lt" | "lb" | "right" | "rt" | "rb";
|
|
602
602
|
animationName: string;
|
|
603
603
|
autoFitPosition: boolean;
|
|
604
604
|
popupVisible: boolean;
|
|
@@ -17,17 +17,20 @@ export * from './form-slider';
|
|
|
17
17
|
export * from './form-switch';
|
|
18
18
|
export * from './form-textarea';
|
|
19
19
|
export * from './color-picker';
|
|
20
|
+
export * from './bar-chart';
|
|
20
21
|
export * from './draggable';
|
|
21
22
|
export * from './grid';
|
|
22
23
|
export * from './heatmap';
|
|
23
24
|
export * from './image';
|
|
24
25
|
export * from './layout';
|
|
26
|
+
export * from './line-chart';
|
|
25
27
|
export * from './link';
|
|
26
28
|
export * from './menu';
|
|
27
29
|
export * from './message';
|
|
28
30
|
export * from './network';
|
|
29
31
|
export * from './notification';
|
|
30
32
|
export * from './pagination';
|
|
33
|
+
export * from './pie-chart';
|
|
31
34
|
export * from './popconfirm';
|
|
32
35
|
export * from './popover';
|
|
33
36
|
export * from './popup';
|
|
@@ -49,4 +52,5 @@ export * from './timeline-item';
|
|
|
49
52
|
export * from './tooltip';
|
|
50
53
|
export * from './trend-chart';
|
|
51
54
|
export * from './trigger';
|
|
55
|
+
export * from './upload';
|
|
52
56
|
export * from './watermark';
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { SlotsType } from 'vue';
|
|
2
|
+
import { LineChartActiveData, LineChartClickData, LineChartSeries, LineChartTooltipSlotProps } from './interface';
|
|
3
|
+
import { LineChartPlot } from './helpers/layout';
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
categories: {
|
|
6
|
+
type: import('vue').PropType<Array<string | number>>;
|
|
7
|
+
default: () => never[];
|
|
8
|
+
};
|
|
9
|
+
series: {
|
|
10
|
+
required: boolean;
|
|
11
|
+
type: import('vue').PropType<LineChartSeries[]>;
|
|
12
|
+
default: () => never[];
|
|
13
|
+
};
|
|
14
|
+
stack: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
area: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
smooth: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
connectNulls: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
showPoints: {
|
|
31
|
+
type: import('vue').PropType<boolean | "auto">;
|
|
32
|
+
default: string;
|
|
33
|
+
validator: (value: boolean | "auto") => boolean;
|
|
34
|
+
};
|
|
35
|
+
height: {
|
|
36
|
+
type: import('vue').PropType<number | string>;
|
|
37
|
+
default: number;
|
|
38
|
+
};
|
|
39
|
+
width: {
|
|
40
|
+
type: import('vue').PropType<number | string>;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
max: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
};
|
|
46
|
+
min: {
|
|
47
|
+
type: NumberConstructor;
|
|
48
|
+
};
|
|
49
|
+
padding: {
|
|
50
|
+
default: string;
|
|
51
|
+
type: import('vue').PropType<string | number>;
|
|
52
|
+
validator(val: string | number): boolean;
|
|
53
|
+
};
|
|
54
|
+
grid: {
|
|
55
|
+
default: null;
|
|
56
|
+
type: import('vue').PropType<import('./interface').LineChartGridOptions>;
|
|
57
|
+
};
|
|
58
|
+
labels: {
|
|
59
|
+
default: null;
|
|
60
|
+
type: import('vue').PropType<import('./interface').LineChartLabelsOptions>;
|
|
61
|
+
};
|
|
62
|
+
tooltip: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
66
|
+
legend: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
valueFormatter: {
|
|
71
|
+
type: import('vue').PropType<(value: number) => string>;
|
|
72
|
+
default: (value: number) => string;
|
|
73
|
+
};
|
|
74
|
+
loading: {
|
|
75
|
+
type: import('vue').PropType<boolean | Record<string, unknown>>;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
ariaLabel: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
};
|
|
81
|
+
}>, {
|
|
82
|
+
className: {
|
|
83
|
+
block: string;
|
|
84
|
+
element: (className: string) => string;
|
|
85
|
+
modifier: (className: string) => string;
|
|
86
|
+
is: (className: string) => string;
|
|
87
|
+
};
|
|
88
|
+
state: {
|
|
89
|
+
activeIndex: number | null;
|
|
90
|
+
keyboardActive: boolean;
|
|
91
|
+
hiddenIndexes: number[];
|
|
92
|
+
tooltipWidth: number;
|
|
93
|
+
};
|
|
94
|
+
size: {
|
|
95
|
+
width: number;
|
|
96
|
+
height: number;
|
|
97
|
+
};
|
|
98
|
+
refs: {
|
|
99
|
+
root: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
100
|
+
canvas: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
101
|
+
tooltip: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
102
|
+
};
|
|
103
|
+
slots: Readonly<{
|
|
104
|
+
tooltip?: ((props: LineChartTooltipSlotProps) => unknown) | undefined;
|
|
105
|
+
legend?: ((props: {
|
|
106
|
+
series: LineChartSeries[];
|
|
107
|
+
hiddenIndexes: number[];
|
|
108
|
+
}) => unknown) | undefined;
|
|
109
|
+
point?: ((props: {
|
|
110
|
+
seriesIndex: number;
|
|
111
|
+
index: number;
|
|
112
|
+
value: number;
|
|
113
|
+
x: number;
|
|
114
|
+
y: number;
|
|
115
|
+
color: string;
|
|
116
|
+
}) => unknown) | undefined;
|
|
117
|
+
empty?: (() => unknown) | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
t: (key: import('../..').LocaleKey | (string & {}), params?: Record<string, string | number>) => string;
|
|
120
|
+
fontSize: import('vue').ComputedRef<number>;
|
|
121
|
+
labelColor: import('vue').ComputedRef<"var(--x-chart-color-axis-text)" | import('../bar-chart/props').CSSColor>;
|
|
122
|
+
yVisible: import('vue').ComputedRef<boolean>;
|
|
123
|
+
xVisible: import('vue').ComputedRef<boolean>;
|
|
124
|
+
showHorizontalLines: import('vue').ComputedRef<boolean>;
|
|
125
|
+
seriesList: import('vue').ComputedRef<LineChartSeries[]>;
|
|
126
|
+
visibleSeriesIndexes: import('vue').ComputedRef<number[]>;
|
|
127
|
+
categoryCount: import('vue').ComputedRef<number>;
|
|
128
|
+
hasData: import('vue').ComputedRef<boolean>;
|
|
129
|
+
plot: import('vue').ComputedRef<LineChartPlot>;
|
|
130
|
+
domain: import('vue').ComputedRef<import('../../_utils/chart').NiceDomain>;
|
|
131
|
+
seriesPaths: import('vue').ComputedRef<import('./helpers/layout').LineChartSeriesPath[]>;
|
|
132
|
+
pointsAlwaysVisible: import('vue').ComputedRef<boolean>;
|
|
133
|
+
axisTicks: import('vue').ComputedRef<{
|
|
134
|
+
y: number;
|
|
135
|
+
label: string;
|
|
136
|
+
isBaseline: boolean;
|
|
137
|
+
}[]>;
|
|
138
|
+
axisXLabels: import('vue').ComputedRef<{
|
|
139
|
+
x: number;
|
|
140
|
+
text: string;
|
|
141
|
+
}[]>;
|
|
142
|
+
activeCategory: import('vue').ComputedRef<LineChartActiveData | null>;
|
|
143
|
+
tooltipSlotProps: import('vue').ComputedRef<LineChartTooltipSlotProps | null>;
|
|
144
|
+
tooltipEntries: import('vue').ComputedRef<{
|
|
145
|
+
key: number;
|
|
146
|
+
name: string;
|
|
147
|
+
value: string;
|
|
148
|
+
color: string;
|
|
149
|
+
}[]>;
|
|
150
|
+
tooltipTotal: import('vue').ComputedRef<{
|
|
151
|
+
label: string;
|
|
152
|
+
value: string;
|
|
153
|
+
} | null>;
|
|
154
|
+
tooltipStyle: import('vue').ComputedRef<Record<string, string>>;
|
|
155
|
+
legendItems: import('vue').ComputedRef<{
|
|
156
|
+
key: number;
|
|
157
|
+
name: string;
|
|
158
|
+
color: string;
|
|
159
|
+
hidden: boolean;
|
|
160
|
+
}[]>;
|
|
161
|
+
categoryLabel: (index: number) => string;
|
|
162
|
+
formatValue: import('vue').ComputedRef<(value: number) => string>;
|
|
163
|
+
seriesColor: (index: number) => string;
|
|
164
|
+
liveText: import('vue').ComputedRef<string>;
|
|
165
|
+
handleMouseMove: (ev: MouseEvent) => void;
|
|
166
|
+
handleClick: (ev: MouseEvent) => void;
|
|
167
|
+
handleKeydown: (ev: KeyboardEvent) => void;
|
|
168
|
+
clearActive: () => void;
|
|
169
|
+
toggleSeries: (index: number) => void;
|
|
170
|
+
setTooltipElement: (el: HTMLDivElement | null) => void;
|
|
171
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
172
|
+
/**
|
|
173
|
+
* @zh 点击数据点或绘图区时触发
|
|
174
|
+
* @en Emitted when a data point or the plot area is clicked
|
|
175
|
+
*/
|
|
176
|
+
'line-click': (data: LineChartClickData) => boolean;
|
|
177
|
+
/**
|
|
178
|
+
* @zh 图例切换后触发,参数为当前可见的系列下标
|
|
179
|
+
* @en Emitted after a legend toggle, with the visible series indexes
|
|
180
|
+
*/
|
|
181
|
+
'legend-change': (visibleIndexes: number[]) => boolean;
|
|
182
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
183
|
+
categories: {
|
|
184
|
+
type: import('vue').PropType<Array<string | number>>;
|
|
185
|
+
default: () => never[];
|
|
186
|
+
};
|
|
187
|
+
series: {
|
|
188
|
+
required: boolean;
|
|
189
|
+
type: import('vue').PropType<LineChartSeries[]>;
|
|
190
|
+
default: () => never[];
|
|
191
|
+
};
|
|
192
|
+
stack: {
|
|
193
|
+
type: BooleanConstructor;
|
|
194
|
+
default: boolean;
|
|
195
|
+
};
|
|
196
|
+
area: {
|
|
197
|
+
type: BooleanConstructor;
|
|
198
|
+
default: boolean;
|
|
199
|
+
};
|
|
200
|
+
smooth: {
|
|
201
|
+
type: BooleanConstructor;
|
|
202
|
+
default: boolean;
|
|
203
|
+
};
|
|
204
|
+
connectNulls: {
|
|
205
|
+
type: BooleanConstructor;
|
|
206
|
+
default: boolean;
|
|
207
|
+
};
|
|
208
|
+
showPoints: {
|
|
209
|
+
type: import('vue').PropType<boolean | "auto">;
|
|
210
|
+
default: string;
|
|
211
|
+
validator: (value: boolean | "auto") => boolean;
|
|
212
|
+
};
|
|
213
|
+
height: {
|
|
214
|
+
type: import('vue').PropType<number | string>;
|
|
215
|
+
default: number;
|
|
216
|
+
};
|
|
217
|
+
width: {
|
|
218
|
+
type: import('vue').PropType<number | string>;
|
|
219
|
+
default: string;
|
|
220
|
+
};
|
|
221
|
+
max: {
|
|
222
|
+
type: NumberConstructor;
|
|
223
|
+
};
|
|
224
|
+
min: {
|
|
225
|
+
type: NumberConstructor;
|
|
226
|
+
};
|
|
227
|
+
padding: {
|
|
228
|
+
default: string;
|
|
229
|
+
type: import('vue').PropType<string | number>;
|
|
230
|
+
validator(val: string | number): boolean;
|
|
231
|
+
};
|
|
232
|
+
grid: {
|
|
233
|
+
default: null;
|
|
234
|
+
type: import('vue').PropType<import('./interface').LineChartGridOptions>;
|
|
235
|
+
};
|
|
236
|
+
labels: {
|
|
237
|
+
default: null;
|
|
238
|
+
type: import('vue').PropType<import('./interface').LineChartLabelsOptions>;
|
|
239
|
+
};
|
|
240
|
+
tooltip: {
|
|
241
|
+
type: BooleanConstructor;
|
|
242
|
+
default: boolean;
|
|
243
|
+
};
|
|
244
|
+
legend: {
|
|
245
|
+
type: BooleanConstructor;
|
|
246
|
+
default: boolean;
|
|
247
|
+
};
|
|
248
|
+
valueFormatter: {
|
|
249
|
+
type: import('vue').PropType<(value: number) => string>;
|
|
250
|
+
default: (value: number) => string;
|
|
251
|
+
};
|
|
252
|
+
loading: {
|
|
253
|
+
type: import('vue').PropType<boolean | Record<string, unknown>>;
|
|
254
|
+
default: boolean;
|
|
255
|
+
};
|
|
256
|
+
ariaLabel: {
|
|
257
|
+
type: StringConstructor;
|
|
258
|
+
};
|
|
259
|
+
}>> & Readonly<{
|
|
260
|
+
"onLegend-change"?: ((visibleIndexes: number[]) => any) | undefined;
|
|
261
|
+
"onLine-click"?: ((data: LineChartClickData) => any) | undefined;
|
|
262
|
+
}>, {
|
|
263
|
+
loading: boolean | Record<string, unknown>;
|
|
264
|
+
area: boolean;
|
|
265
|
+
legend: boolean;
|
|
266
|
+
height: string | number;
|
|
267
|
+
width: string | number;
|
|
268
|
+
grid: import('./interface').LineChartGridOptions;
|
|
269
|
+
padding: string | number;
|
|
270
|
+
smooth: boolean;
|
|
271
|
+
tooltip: boolean;
|
|
272
|
+
categories: (string | number)[];
|
|
273
|
+
series: LineChartSeries[];
|
|
274
|
+
stack: boolean;
|
|
275
|
+
labels: import('./interface').LineChartLabelsOptions;
|
|
276
|
+
valueFormatter: (value: number) => string;
|
|
277
|
+
connectNulls: boolean;
|
|
278
|
+
showPoints: boolean | "auto";
|
|
279
|
+
}, SlotsType<{
|
|
280
|
+
tooltip?: (props: LineChartTooltipSlotProps) => unknown;
|
|
281
|
+
legend?: (props: {
|
|
282
|
+
series: LineChartSeries[];
|
|
283
|
+
hiddenIndexes: number[];
|
|
284
|
+
}) => unknown;
|
|
285
|
+
point?: (props: {
|
|
286
|
+
seriesIndex: number;
|
|
287
|
+
index: number;
|
|
288
|
+
value: number;
|
|
289
|
+
x: number;
|
|
290
|
+
y: number;
|
|
291
|
+
color: string;
|
|
292
|
+
}) => unknown;
|
|
293
|
+
empty?: () => unknown;
|
|
294
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
295
|
+
export default _default;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface LineChartPlot {
|
|
2
|
+
left: number;
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
export interface LineChartPointGeometry {
|
|
10
|
+
/** 类目下标 */
|
|
11
|
+
index: number;
|
|
12
|
+
/** 系列下标 */
|
|
13
|
+
seriesIndex: number;
|
|
14
|
+
/** 数据点的值 */
|
|
15
|
+
value: number;
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
export interface LineChartSeriesPath {
|
|
20
|
+
/** 系列下标 */
|
|
21
|
+
seriesIndex: number;
|
|
22
|
+
/** 折线路径(平滑时为三次贝塞尔);缺测断点会切成多段 */
|
|
23
|
+
d: string;
|
|
24
|
+
/** 面积填充路径;未开启 area 时为空串 */
|
|
25
|
+
areaD: string;
|
|
26
|
+
/** 该系列的数据点,供数据点渲染与交互命中 */
|
|
27
|
+
points: LineChartPointGeometry[];
|
|
28
|
+
}
|
|
29
|
+
export interface BuildLineChartSeriesParams {
|
|
30
|
+
/** values[seriesIndex][categoryIndex];缺测为 null */
|
|
31
|
+
values: Array<Array<number | null>>;
|
|
32
|
+
/**
|
|
33
|
+
* 面积填充的下边界(堆叠面积用):
|
|
34
|
+
* 逐系列给出,形状与 values 相同;省略时填充到 baseline 水平线。
|
|
35
|
+
*/
|
|
36
|
+
lower?: Array<Array<number | null>>;
|
|
37
|
+
plot: LineChartPlot;
|
|
38
|
+
/** 数值域下界(负值场景下为负数) */
|
|
39
|
+
domainMin: number;
|
|
40
|
+
/** 数值域上界 */
|
|
41
|
+
domainMax: number;
|
|
42
|
+
/** 是否平滑 */
|
|
43
|
+
smooth: boolean;
|
|
44
|
+
/** 缺测点是否跨过(连到下一个有效点) */
|
|
45
|
+
connectNulls: boolean;
|
|
46
|
+
/** 是否绘制面积填充 */
|
|
47
|
+
area: boolean;
|
|
48
|
+
/** 面积基线的 y(未给 lower 时使用) */
|
|
49
|
+
baseline: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 计算每个系列的折线 / 面积路径与数据点坐标。
|
|
53
|
+
*
|
|
54
|
+
* 类目排在带中心:n 个类目把绘图区均分为 n 段,第 i 个数据点落在第 i 段中心,
|
|
55
|
+
* 与柱状图的类目带一致,两个图表的类目轴可以对齐比较。
|
|
56
|
+
*
|
|
57
|
+
* 缺测(null / undefined)默认断线;`connectNulls` 为真时跨过缺测连到下一点,
|
|
58
|
+
* 但缺测处不产生数据点(不存在的点不应被鼠标命中)。
|
|
59
|
+
*/
|
|
60
|
+
export declare const buildLineChartSeries: (params: BuildLineChartSeriesParams) => LineChartSeriesPath[];
|
|
61
|
+
export interface StackedLineChartLayer {
|
|
62
|
+
seriesIndex: number;
|
|
63
|
+
/** 本层的值(缺测为 0) */
|
|
64
|
+
values: number[];
|
|
65
|
+
/** 本层下界(下方所有层的累加) */
|
|
66
|
+
base: number[];
|
|
67
|
+
/** 本层上界(base + values) */
|
|
68
|
+
top: number[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 堆叠分层:把每个系列的下界累加为上一层的上界。
|
|
72
|
+
* 缺测按 0 处理,保证各层类目数一致、堆叠带不出现空洞。
|
|
73
|
+
*/
|
|
74
|
+
export declare const buildStackedLayers: (values: Array<Array<number | null>>) => StackedLineChartLayer[];
|