@ant-design/agentic-ui 2.30.2 → 2.30.3
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/dist/Hooks/useLanguage.d.ts +3 -0
- package/dist/I18n/locales.d.ts +3 -0
- package/dist/I18n/locales.js +6 -0
- package/dist/MarkdownRenderer/useMarkdownToReact.js +3 -1
- package/dist/Plugins/chart/AreaChart/index.js +4 -3
- package/dist/Plugins/chart/BarChart/index.js +3 -3
- package/dist/Plugins/chart/BoxPlotChart/index.d.ts +65 -0
- package/dist/Plugins/chart/BoxPlotChart/index.js +665 -0
- package/dist/Plugins/chart/BoxPlotChart/style.d.ts +8 -0
- package/dist/Plugins/chart/BoxPlotChart/style.js +118 -0
- package/dist/Plugins/chart/ChartAttrToolBar/index.js +5 -16
- package/dist/Plugins/chart/ChartMark/Area.d.ts +2 -1
- package/dist/Plugins/chart/ChartMark/Area.js +5 -4
- package/dist/Plugins/chart/ChartMark/Bar.d.ts +2 -1
- package/dist/Plugins/chart/ChartMark/Bar.js +5 -4
- package/dist/Plugins/chart/ChartMark/Column.d.ts +2 -1
- package/dist/Plugins/chart/ChartMark/Column.js +5 -4
- package/dist/Plugins/chart/ChartMark/Line.d.ts +2 -1
- package/dist/Plugins/chart/ChartMark/Line.js +5 -4
- package/dist/Plugins/chart/ChartMark/Pie.d.ts +2 -1
- package/dist/Plugins/chart/ChartMark/Pie.js +5 -4
- package/dist/Plugins/chart/ChartRender.d.ts +1 -1
- package/dist/Plugins/chart/ChartRender.js +188 -12
- package/dist/Plugins/chart/DonutChart/Legend.d.ts +5 -3
- package/dist/Plugins/chart/DonutChart/Legend.js +30 -38
- package/dist/Plugins/chart/DonutChart/index.js +82 -23
- package/dist/Plugins/chart/DonutChart/plugins.d.ts +2 -2
- package/dist/Plugins/chart/DonutChart/plugins.js +5 -5
- package/dist/Plugins/chart/DonutChart/types.d.ts +2 -0
- package/dist/Plugins/chart/FunnelChart/index.js +24 -14
- package/dist/Plugins/chart/HistogramChart/index.d.ts +65 -0
- package/dist/Plugins/chart/HistogramChart/index.js +665 -0
- package/dist/Plugins/chart/HistogramChart/style.d.ts +8 -0
- package/dist/Plugins/chart/HistogramChart/style.js +118 -0
- package/dist/Plugins/chart/LineChart/index.js +4 -3
- package/dist/Plugins/chart/RadarChart/index.d.ts +2 -0
- package/dist/Plugins/chart/RadarChart/index.js +28 -26
- package/dist/Plugins/chart/ScatterChart/index.d.ts +2 -0
- package/dist/Plugins/chart/ScatterChart/index.js +43 -28
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.d.ts +1 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +14 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartDarkAntdContext.d.ts +7 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartDarkAntdContext.js +8 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +8 -2
- package/dist/Plugins/chart/components/ChartContainer/style.js +3 -3
- package/dist/Plugins/chart/components/ChartToolBar/ChartToolBar.d.ts +2 -0
- package/dist/Plugins/chart/components/ChartToolBar/ChartToolBar.js +23 -32
- package/dist/Plugins/chart/index.d.ts +4 -0
- package/dist/Plugins/chart/index.js +2 -0
- package/dist/Plugins/chart/loadChartRuntime.d.ts +4 -0
- package/dist/Plugins/chart/loadChartRuntime.js +5 -1
- package/package.json +3 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
import { useEditorStyleRegister } from "../../../Hooks/useStyle";
|
|
54
|
+
var genStyle = function genStyle(token) {
|
|
55
|
+
return _define_property({}, token.componentCls, {
|
|
56
|
+
// 统计数据容器样式
|
|
57
|
+
'&-statistic-container': {
|
|
58
|
+
display: 'flex',
|
|
59
|
+
gap: '16px',
|
|
60
|
+
marginBottom: '16px',
|
|
61
|
+
flexWrap: 'wrap',
|
|
62
|
+
alignItems: 'flex-start'
|
|
63
|
+
},
|
|
64
|
+
// 箱线图容器样式
|
|
65
|
+
'.chart-wrapper': {
|
|
66
|
+
width: '100%',
|
|
67
|
+
height: 'calc(100% - 120px)',
|
|
68
|
+
minHeight: 300,
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
overflow: 'hidden'
|
|
73
|
+
},
|
|
74
|
+
// 确保图表不会超出容器边界
|
|
75
|
+
canvas: {
|
|
76
|
+
maxWidth: '100% !important',
|
|
77
|
+
maxHeight: '100% !important'
|
|
78
|
+
},
|
|
79
|
+
// 移动端响应式样式
|
|
80
|
+
'@media (max-width: 768px)': {
|
|
81
|
+
'.chart-wrapper': {
|
|
82
|
+
height: 'calc(100% - 100px)',
|
|
83
|
+
minHeight: 250
|
|
84
|
+
},
|
|
85
|
+
'.chart-title': {
|
|
86
|
+
fontSize: 14,
|
|
87
|
+
marginBottom: 8,
|
|
88
|
+
textAlign: 'center'
|
|
89
|
+
},
|
|
90
|
+
'.chart-filter': {
|
|
91
|
+
flexWrap: 'wrap',
|
|
92
|
+
gap: 8,
|
|
93
|
+
marginBottom: 12,
|
|
94
|
+
'.filter-button': {
|
|
95
|
+
fontSize: 12,
|
|
96
|
+
padding: '6px 12px'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
// 超小屏幕优化 (375px以下)
|
|
101
|
+
'@media (max-width: 375px)': {
|
|
102
|
+
padding: 8,
|
|
103
|
+
'.chart-wrapper': {
|
|
104
|
+
minHeight: 220
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
export function useStyle(prefixCls) {
|
|
110
|
+
return useEditorStyleRegister('BoxPlotChart', function(token) {
|
|
111
|
+
var boxPlotToken = _object_spread_props(_object_spread({}, token), {
|
|
112
|
+
componentCls: ".".concat(prefixCls)
|
|
113
|
+
});
|
|
114
|
+
return [
|
|
115
|
+
genStyle(boxPlotToken)
|
|
116
|
+
];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DeleteOutlined } from "@ant-design/icons";
|
|
2
2
|
import { ConfigProvider, Tooltip } from "antd";
|
|
3
3
|
import React, { useContext, useRef } from "react";
|
|
4
|
+
import clsx from "clsx";
|
|
4
5
|
import { Transforms } from "slate";
|
|
5
6
|
import { ReactEditor } from "slate-react";
|
|
6
7
|
import { I18nContext } from "../../../I18n";
|
|
@@ -69,10 +70,7 @@ import { useStyle } from "./ChartAttrToolBarStyle";
|
|
|
69
70
|
var baseClassName = context === null || context === void 0 ? void 0 : context.getPrefixCls("chart-attr-toolbar");
|
|
70
71
|
var _useStyle = useStyle(baseClassName), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
71
72
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
72
|
-
className:
|
|
73
|
-
baseClassName,
|
|
74
|
-
hashId
|
|
75
|
-
].filter(Boolean).join(' '),
|
|
73
|
+
className: clsx(baseClassName, hashId),
|
|
76
74
|
style: {
|
|
77
75
|
width: 'auto'
|
|
78
76
|
},
|
|
@@ -94,10 +92,7 @@ import { useStyle } from "./ChartAttrToolBarStyle";
|
|
|
94
92
|
if (!item.title) {
|
|
95
93
|
return /*#__PURE__*/ React.createElement("div", {
|
|
96
94
|
key: index,
|
|
97
|
-
className:
|
|
98
|
-
"".concat(baseClassName, "-item"),
|
|
99
|
-
hashId
|
|
100
|
-
].filter(Boolean).join(' '),
|
|
95
|
+
className: clsx("".concat(baseClassName, "-item"), hashId),
|
|
101
96
|
onClick: item.onClick,
|
|
102
97
|
style: item.style
|
|
103
98
|
}, item.icon);
|
|
@@ -107,20 +102,14 @@ import { useStyle } from "./ChartAttrToolBarStyle";
|
|
|
107
102
|
key: index,
|
|
108
103
|
title: item.title
|
|
109
104
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
110
|
-
className:
|
|
111
|
-
"".concat(baseClassName, "-item"),
|
|
112
|
-
hashId
|
|
113
|
-
].filter(Boolean).join(' '),
|
|
105
|
+
className: clsx("".concat(baseClassName, "-item"), hashId),
|
|
114
106
|
onClick: item.onClick
|
|
115
107
|
}, item.icon));
|
|
116
108
|
}), readonly ? null : /*#__PURE__*/ React.createElement(Tooltip, {
|
|
117
109
|
mouseEnterDelay: 0.3,
|
|
118
110
|
title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale = i18n.locale) === null || _i18n_locale === void 0 ? void 0 : _i18n_locale.delete) || '删除'
|
|
119
111
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
120
|
-
className:
|
|
121
|
-
"".concat(baseClassName, "-item"),
|
|
122
|
-
hashId
|
|
123
|
-
].filter(Boolean).join(' ')
|
|
112
|
+
className: clsx("".concat(baseClassName, "-item"), hashId)
|
|
124
113
|
}, /*#__PURE__*/ React.createElement(DeleteOutlined, {
|
|
125
114
|
onClick: remove
|
|
126
115
|
})))));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chart as ChartJS } from 'chart.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ChartProps } from './useChart';
|
|
3
|
-
export declare const Area: React.
|
|
4
|
+
export declare const Area: React.ForwardRefExoticComponent<ChartProps & React.RefAttributes<ChartJS<keyof import("chart.js").ChartTypeRegistry, (number | number[] | import("chart.js").Point | [number, number] | import("chart.js").BubbleDataPoint | (Partial<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot> & Pick<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot, "min" | "max" | "median" | "q1" | "q3">) | (Partial<import("@sgratzl/chartjs-chart-boxplot").IViolin> & Pick<import("@sgratzl/chartjs-chart-boxplot").IViolin, "median" | "coords">) | null)[], unknown>>>;
|
|
@@ -24,12 +24,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
24
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
25
|
}
|
|
26
26
|
import { CategoryScale, Chart as ChartJS, Filler, Legend, LinearScale, LineElement, PointElement, Title, Tooltip } from "chart.js";
|
|
27
|
-
import React, { useImperativeHandle, useRef } from "react";
|
|
27
|
+
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Line } from "react-chartjs-2";
|
|
29
29
|
import { isWindowDefined } from "../env";
|
|
30
30
|
import { Container } from "./Container";
|
|
31
31
|
var chartMarkAreaRegistered = false;
|
|
32
|
-
export var Area =
|
|
32
|
+
export var Area = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
33
33
|
React.useMemo(function() {
|
|
34
34
|
if (chartMarkAreaRegistered) {
|
|
35
35
|
return undefined;
|
|
@@ -44,7 +44,7 @@ export var Area = function Area(props) {
|
|
|
44
44
|
var chartRef = React.useRef(undefined);
|
|
45
45
|
var htmlRef = useRef(null);
|
|
46
46
|
var lineChartRef = useRef(null);
|
|
47
|
-
useImperativeHandle(
|
|
47
|
+
useImperativeHandle(ref, function() {
|
|
48
48
|
return chartRef.current;
|
|
49
49
|
}, [
|
|
50
50
|
chartRef.current
|
|
@@ -182,4 +182,5 @@ export var Area = function Area(props) {
|
|
|
182
182
|
data: chartData,
|
|
183
183
|
options: options
|
|
184
184
|
}));
|
|
185
|
-
};
|
|
185
|
+
});
|
|
186
|
+
Area.displayName = 'Area';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chart as ChartJS } from 'chart.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ChartProps } from './useChart';
|
|
3
|
-
export declare const Bar: React.
|
|
4
|
+
export declare const Bar: React.ForwardRefExoticComponent<ChartProps & React.RefAttributes<ChartJS<keyof import("chart.js").ChartTypeRegistry, (number | number[] | import("chart.js").Point | [number, number] | import("chart.js").BubbleDataPoint | (Partial<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot> & Pick<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot, "min" | "max" | "median" | "q1" | "q3">) | (Partial<import("@sgratzl/chartjs-chart-boxplot").IViolin> & Pick<import("@sgratzl/chartjs-chart-boxplot").IViolin, "median" | "coords">) | null)[], unknown>>>;
|
|
@@ -24,13 +24,13 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
24
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
25
|
}
|
|
26
26
|
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Title, Tooltip } from "chart.js";
|
|
27
|
-
import React, { useImperativeHandle, useRef } from "react";
|
|
27
|
+
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Bar as ChartBar } from "react-chartjs-2";
|
|
29
29
|
import { isWindowDefined } from "../env";
|
|
30
30
|
import { stringFormatNumber } from "../utils";
|
|
31
31
|
import { Container } from "./Container";
|
|
32
32
|
var chartMarkBarRegistered = false;
|
|
33
|
-
export var Bar =
|
|
33
|
+
export var Bar = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
34
34
|
React.useMemo(function() {
|
|
35
35
|
if (chartMarkBarRegistered) {
|
|
36
36
|
return undefined;
|
|
@@ -45,7 +45,7 @@ export var Bar = function Bar(props) {
|
|
|
45
45
|
var chartRef = React.useRef(undefined);
|
|
46
46
|
var htmlRef = useRef(null);
|
|
47
47
|
var barChartRef = useRef(null);
|
|
48
|
-
useImperativeHandle(
|
|
48
|
+
useImperativeHandle(ref, function() {
|
|
49
49
|
return chartRef.current;
|
|
50
50
|
}, [
|
|
51
51
|
chartRef.current
|
|
@@ -189,4 +189,5 @@ export var Bar = function Bar(props) {
|
|
|
189
189
|
data: chartData,
|
|
190
190
|
options: options
|
|
191
191
|
}));
|
|
192
|
-
};
|
|
192
|
+
});
|
|
193
|
+
Bar.displayName = 'Bar';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chart as ChartJS } from 'chart.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ChartProps } from './useChart';
|
|
3
|
-
export declare const Column: React.
|
|
4
|
+
export declare const Column: React.ForwardRefExoticComponent<ChartProps & React.RefAttributes<ChartJS<keyof import("chart.js").ChartTypeRegistry, (number | number[] | import("chart.js").Point | [number, number] | import("chart.js").BubbleDataPoint | (Partial<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot> & Pick<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot, "min" | "max" | "median" | "q1" | "q3">) | (Partial<import("@sgratzl/chartjs-chart-boxplot").IViolin> & Pick<import("@sgratzl/chartjs-chart-boxplot").IViolin, "median" | "coords">) | null)[], unknown>>>;
|
|
@@ -24,13 +24,13 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
24
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
25
|
}
|
|
26
26
|
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Title, Tooltip } from "chart.js";
|
|
27
|
-
import React, { useImperativeHandle, useRef } from "react";
|
|
27
|
+
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Bar as ChartBar } from "react-chartjs-2";
|
|
29
29
|
import { isWindowDefined } from "../env";
|
|
30
30
|
import { stringFormatNumber } from "../utils";
|
|
31
31
|
import { Container } from "./Container";
|
|
32
32
|
var chartMarkColumnRegistered = false;
|
|
33
|
-
export var Column =
|
|
33
|
+
export var Column = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
34
34
|
React.useMemo(function() {
|
|
35
35
|
if (chartMarkColumnRegistered) {
|
|
36
36
|
return undefined;
|
|
@@ -45,7 +45,7 @@ export var Column = function Column(props) {
|
|
|
45
45
|
var chartRef = React.useRef(undefined);
|
|
46
46
|
var htmlRef = useRef(null);
|
|
47
47
|
var barChartRef = useRef(null);
|
|
48
|
-
useImperativeHandle(
|
|
48
|
+
useImperativeHandle(ref, function() {
|
|
49
49
|
return chartRef.current;
|
|
50
50
|
}, [
|
|
51
51
|
chartRef.current
|
|
@@ -189,4 +189,5 @@ export var Column = function Column(props) {
|
|
|
189
189
|
data: chartData,
|
|
190
190
|
options: options
|
|
191
191
|
}));
|
|
192
|
-
};
|
|
192
|
+
});
|
|
193
|
+
Column.displayName = 'Column';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chart as ChartJS } from 'chart.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ChartProps } from './useChart';
|
|
3
|
-
export declare const Line: React.
|
|
4
|
+
export declare const Line: React.ForwardRefExoticComponent<ChartProps & React.RefAttributes<ChartJS<keyof import("chart.js").ChartTypeRegistry, (number | number[] | import("chart.js").Point | [number, number] | import("chart.js").BubbleDataPoint | (Partial<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot> & Pick<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot, "min" | "max" | "median" | "q1" | "q3">) | (Partial<import("@sgratzl/chartjs-chart-boxplot").IViolin> & Pick<import("@sgratzl/chartjs-chart-boxplot").IViolin, "median" | "coords">) | null)[], unknown>>>;
|
|
@@ -24,13 +24,13 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
24
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
25
|
}
|
|
26
26
|
import { CategoryScale, Chart as ChartJS, Legend, LinearScale, LineElement, PointElement, Title, Tooltip } from "chart.js";
|
|
27
|
-
import React, { useImperativeHandle, useRef } from "react";
|
|
27
|
+
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Line as ChartLine } from "react-chartjs-2";
|
|
29
29
|
import { isWindowDefined } from "../env";
|
|
30
30
|
import { stringFormatNumber } from "../utils";
|
|
31
31
|
import { Container } from "./Container";
|
|
32
32
|
var chartMarkLineRegistered = false;
|
|
33
|
-
export var Line =
|
|
33
|
+
export var Line = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
34
34
|
React.useMemo(function() {
|
|
35
35
|
if (chartMarkLineRegistered) {
|
|
36
36
|
return undefined;
|
|
@@ -45,7 +45,7 @@ export var Line = function Line(props) {
|
|
|
45
45
|
var chartRef = React.useRef(undefined);
|
|
46
46
|
var htmlRef = useRef(null);
|
|
47
47
|
var lineChartRef = useRef(null);
|
|
48
|
-
useImperativeHandle(
|
|
48
|
+
useImperativeHandle(ref, function() {
|
|
49
49
|
return chartRef.current;
|
|
50
50
|
}, [
|
|
51
51
|
chartRef.current
|
|
@@ -187,4 +187,5 @@ export var Line = function Line(props) {
|
|
|
187
187
|
data: chartData,
|
|
188
188
|
options: options
|
|
189
189
|
}));
|
|
190
|
-
};
|
|
190
|
+
});
|
|
191
|
+
Line.displayName = 'Line';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chart as ChartJS } from 'chart.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ChartProps } from './useChart';
|
|
3
|
-
export declare const Pie: React.
|
|
4
|
+
export declare const Pie: React.ForwardRefExoticComponent<ChartProps & React.RefAttributes<ChartJS<keyof import("chart.js").ChartTypeRegistry, (number | number[] | import("chart.js").Point | [number, number] | import("chart.js").BubbleDataPoint | (Partial<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot> & Pick<import("@sgratzl/chartjs-chart-boxplot").IBoxPlot, "min" | "max" | "median" | "q1" | "q3">) | (Partial<import("@sgratzl/chartjs-chart-boxplot").IViolin> & Pick<import("@sgratzl/chartjs-chart-boxplot").IViolin, "median" | "coords">) | null)[], unknown>>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ArcElement, Chart as ChartJS, Legend, Tooltip } from "chart.js";
|
|
2
|
-
import React, { useImperativeHandle, useRef } from "react";
|
|
2
|
+
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
3
3
|
import { Doughnut } from "react-chartjs-2";
|
|
4
4
|
import { defaultColorList } from "../const";
|
|
5
5
|
import { isWindowDefined } from "../env";
|
|
6
6
|
import { Container } from "./Container";
|
|
7
7
|
var chartMarkPieRegistered = false;
|
|
8
|
-
export var Pie =
|
|
8
|
+
export var Pie = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
9
9
|
React.useMemo(function() {
|
|
10
10
|
if (chartMarkPieRegistered) {
|
|
11
11
|
return undefined;
|
|
@@ -20,7 +20,7 @@ export var Pie = function Pie(props) {
|
|
|
20
20
|
var chartRef = React.useRef(undefined);
|
|
21
21
|
var htmlRef = useRef(null);
|
|
22
22
|
var pieChartRef = useRef(null);
|
|
23
|
-
useImperativeHandle(
|
|
23
|
+
useImperativeHandle(ref, function() {
|
|
24
24
|
return chartRef.current;
|
|
25
25
|
}, [
|
|
26
26
|
chartRef.current
|
|
@@ -86,4 +86,5 @@ export var Pie = function Pie(props) {
|
|
|
86
86
|
data: chartData,
|
|
87
87
|
options: options
|
|
88
88
|
}));
|
|
89
|
-
};
|
|
89
|
+
});
|
|
90
|
+
Pie.displayName = 'Pie';
|
|
@@ -58,7 +58,7 @@ import React from 'react';
|
|
|
58
58
|
* - 使用 React.lazy 和 Suspense 实现代码分割
|
|
59
59
|
*/
|
|
60
60
|
export declare const ChartRender: React.FC<{
|
|
61
|
-
chartType: 'pie' | 'donut' | 'bar' | 'line' | 'column' | 'area' | 'radar' | 'scatter' | 'funnel' | 'descriptions' | 'table';
|
|
61
|
+
chartType: 'pie' | 'donut' | 'bar' | 'line' | 'column' | 'area' | 'radar' | 'scatter' | 'funnel' | 'boxplot' | 'histogram' | 'descriptions' | 'table';
|
|
62
62
|
chartData: Record<string, any>[];
|
|
63
63
|
config: {
|
|
64
64
|
height: any;
|