@ant-design/agentic-ui 2.0.15 → 2.0.17

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.
Files changed (58) hide show
  1. package/dist/Bubble/AIBubble.js +3 -0
  2. package/dist/Bubble/MessagesContent/MarkdownPreview.js +3 -1
  3. package/dist/Bubble/style.js +4 -1
  4. package/dist/Components/Loading/index.d.ts +2 -1
  5. package/dist/Components/Loading/index.js +3 -161
  6. package/dist/Components/lotties/LoadingLottie/index.d.ts +65 -0
  7. package/dist/Components/lotties/LoadingLottie/index.js +53 -0
  8. package/dist/Components/lotties/LoadingLottie/loading.json +1 -0
  9. package/dist/History/index.js +7 -2
  10. package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +11 -8
  11. package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +16 -12
  12. package/dist/MarkdownEditor/editor/utils/dom.d.ts +1 -1
  13. package/dist/MarkdownEditor/editor/utils/index.d.ts +1 -1
  14. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +1 -1
  15. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +9 -8
  16. package/dist/MarkdownInputField/AttachmentButton/index.d.ts +2 -0
  17. package/dist/MarkdownInputField/AttachmentButton/style.js +3 -3
  18. package/dist/MarkdownInputField/Enlargement/index.js +9 -29
  19. package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +30 -27
  20. package/dist/MarkdownInputField/FileMapView/index.d.ts +4 -4
  21. package/dist/MarkdownInputField/FileMapView/index.js +20 -13
  22. package/dist/MarkdownInputField/FileUploadManager/index.js +2 -2
  23. package/dist/MarkdownInputField/MarkdownInputField.d.ts +9 -19
  24. package/dist/MarkdownInputField/MarkdownInputField.js +218 -250
  25. package/dist/MarkdownInputField/RefinePromptButton/index.js +8 -53
  26. package/dist/MarkdownInputField/style.js +54 -47
  27. package/dist/Plugins/chart/AreaChart/index.d.ts +2 -2
  28. package/dist/Plugins/chart/AreaChart/index.js +9 -29
  29. package/dist/Plugins/chart/BarChart/index.d.ts +8 -8
  30. package/dist/Plugins/chart/BarChart/index.js +9 -8
  31. package/dist/Plugins/chart/DonutChart/constants.d.ts +0 -1
  32. package/dist/Plugins/chart/DonutChart/constants.js +0 -14
  33. package/dist/Plugins/chart/DonutChart/index.js +51 -16
  34. package/dist/Plugins/chart/DonutChart/style.js +7 -0
  35. package/dist/Plugins/chart/DonutChart/types.d.ts +2 -0
  36. package/dist/Plugins/chart/FunnelChart/index.d.ts +8 -8
  37. package/dist/Plugins/chart/FunnelChart/index.js +85 -66
  38. package/dist/Plugins/chart/FunnelChart/style.js +12 -0
  39. package/dist/Plugins/chart/LineChart/index.d.ts +2 -2
  40. package/dist/Plugins/chart/LineChart/index.js +16 -19
  41. package/dist/Plugins/chart/RadarChart/index.d.ts +11 -5
  42. package/dist/Plugins/chart/RadarChart/index.js +35 -50
  43. package/dist/Plugins/chart/RadarChart/style.js +8 -0
  44. package/dist/Plugins/chart/ScatterChart/index.d.ts +23 -6
  45. package/dist/Plugins/chart/ScatterChart/index.js +58 -57
  46. package/dist/Plugins/chart/ScatterChart/style.js +8 -0
  47. package/dist/Plugins/chart/components/ChartContainer/style.js +7 -1
  48. package/dist/Plugins/chart/hooks/useChartStatistic.d.ts +0 -6
  49. package/dist/Plugins/chart/hooks/useChartStatistic.js +0 -16
  50. package/dist/Workspace/File/PreviewComponent.js +3 -2
  51. package/dist/Workspace/File/style.js +2 -1
  52. package/dist/Workspace/RealtimeFollow/style.js +1 -6
  53. package/dist/Workspace/style.js +2 -1
  54. package/package.json +1 -1
  55. package/dist/Components/Loading/style.d.ts +0 -5
  56. package/dist/Components/Loading/style.js +0 -46
  57. package/dist/MarkdownInputField/Enlargement/style.d.ts +0 -10
  58. package/dist/MarkdownInputField/Enlargement/style.js +0 -75
@@ -16,12 +16,10 @@ export interface FunnelChartDataItem {
16
16
  ratio?: number | string;
17
17
  }
18
18
  export interface FunnelChartProps extends ChartContainerProps {
19
- /** 图表标题 */
20
- title?: string;
21
19
  /** 扁平化数据数组(x 为阶段名,y 为数值) */
22
20
  data: FunnelChartDataItem[];
23
- /** 自定义主色 */
24
- color?: string;
21
+ /** 图表标题 */
22
+ title?: string;
25
23
  /** 图表宽度,默认600px */
26
24
  width?: number | string;
27
25
  /** 图表高度,默认400px */
@@ -30,12 +28,12 @@ export interface FunnelChartProps extends ChartContainerProps {
30
28
  className?: string;
31
29
  /** 数据时间 */
32
30
  dataTime?: string;
33
- /** 主题 */
31
+ /** 图表主题 */
34
32
  theme?: 'dark' | 'light';
35
- /** 是否显示图例 */
33
+ /** 自定义主色 */
34
+ color?: string;
35
+ /** 是否显示图例,默认true */
36
36
  showLegend?: boolean;
37
- /** 统计数据组件配置 */
38
- statistic?: StatisticConfigType;
39
37
  /** 图例位置 */
40
38
  legendPosition?: 'top' | 'left' | 'bottom' | 'right';
41
39
  /** 图例水平对齐方式 */
@@ -46,6 +44,8 @@ export interface FunnelChartProps extends ChartContainerProps {
46
44
  toolbarExtra?: React.ReactNode;
47
45
  /** 是否将过滤器渲染到工具栏 */
48
46
  renderFilterInToolbar?: boolean;
47
+ /** ChartStatistic组件配置:object表示单个配置,array表示多个配置 */
48
+ statistic?: StatisticConfigType;
49
49
  typeNames?: {
50
50
  rate?: string;
51
51
  /** 类型名称,用于图例和数据集标签 */
@@ -40,6 +40,7 @@ import {
40
40
  LinearScale,
41
41
  Tooltip
42
42
  } from "chart.js";
43
+ import classNames from "classnames";
43
44
  import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
44
45
  import { Bar } from "react-chartjs-2";
45
46
  import ChartStatistic from "../ChartStatistic";
@@ -49,12 +50,10 @@ import {
49
50
  ChartToolBar,
50
51
  downloadChart
51
52
  } from "../components";
52
- import {
53
- useChartStatistic
54
- } from "../hooks/useChartStatistic";
53
+ import { defaultColorList } from "../const";
55
54
  import { findDataPointByXValue, isXValueEqual, toNumber } from "../utils";
55
+ import { useStyle } from "./style";
56
56
  ChartJS.register(CategoryScale, LinearScale, BarElement, Tooltip, Legend);
57
- var defaultColors = "#1890ff";
58
57
  var FunnelChart = (_a) => {
59
58
  var _b = _a, {
60
59
  title,
@@ -72,7 +71,7 @@ var FunnelChart = (_a) => {
72
71
  toolbarExtra,
73
72
  renderFilterInToolbar = false,
74
73
  typeNames,
75
- statistic
74
+ statistic: statisticConfig
76
75
  } = _b, props = __objRest(_b, [
77
76
  "title",
78
77
  "data",
@@ -92,7 +91,11 @@ var FunnelChart = (_a) => {
92
91
  "statistic"
93
92
  ]);
94
93
  const safeData = Array.isArray(data) ? data : [];
95
- const statisticComponentConfigs = useChartStatistic(statistic);
94
+ const statistics = useMemo(() => {
95
+ if (!statisticConfig)
96
+ return null;
97
+ return Array.isArray(statisticConfig) ? statisticConfig : [statisticConfig];
98
+ }, [statisticConfig]);
96
99
  const [windowWidth, setWindowWidth] = useState(
97
100
  typeof window !== "undefined" ? window.innerWidth : 768
98
101
  );
@@ -107,6 +110,7 @@ var FunnelChart = (_a) => {
107
110
  }, []);
108
111
  const context = useContext(ConfigProvider.ConfigContext);
109
112
  const baseClassName = context == null ? void 0 : context.getPrefixCls("funnel-chart-container");
113
+ const { hashId, wrapSSR } = useStyle(baseClassName);
110
114
  const chartRef = useRef(null);
111
115
  const [showTrapezoid, setShowTrapezoid] = useState(true);
112
116
  const [pluginToggleKey, setPluginToggleKey] = useState(0);
@@ -167,7 +171,7 @@ var FunnelChart = (_a) => {
167
171
  return chartHeight;
168
172
  }, [height, chartHeight]);
169
173
  const processedData = useMemo(() => {
170
- const baseColor = color || defaultColors;
174
+ const baseColor = color || defaultColorList[0];
171
175
  const labels = stages.map((x) => x.toString());
172
176
  const values = stages.map((x) => {
173
177
  const dp = findDataPointByXValue(filteredData, x);
@@ -535,68 +539,83 @@ var FunnelChart = (_a) => {
535
539
  }
536
540
  };
537
541
  }, [isMobile, axisTextColor]);
538
- return /* @__PURE__ */ React.createElement(
539
- ChartContainer,
540
- {
541
- baseClassName,
542
- className,
543
- theme,
544
- isMobile,
545
- variant: props.variant,
546
- style: {
547
- width: responsiveWidth
548
- }
549
- },
542
+ return wrapSSR(
550
543
  /* @__PURE__ */ React.createElement(
551
- ChartToolBar,
544
+ ChartContainer,
552
545
  {
553
- title,
546
+ baseClassName,
547
+ className,
554
548
  theme,
555
- onDownload: handleDownload,
556
- dataTime,
557
- extra: toolbarExtra,
558
- filter: renderFilterInToolbar && filterOptions && filterOptions.length > 1 ? /* @__PURE__ */ React.createElement(
559
- ChartFilter,
560
- __spreadProps(__spreadValues({
561
- filterOptions,
562
- selectedFilter,
563
- onFilterChange: setSelectedFilter
564
- }, customOptions && {
565
- customOptions,
566
- selectedCustomSelection: selectedFilterLabel,
567
- onSelectionChange: setSelectedFilterLabel
568
- }), {
569
- theme,
570
- variant: "compact"
571
- })
572
- ) : void 0
573
- }
574
- ),
575
- !renderFilterInToolbar && filterOptions && filterOptions.length > 1 && /* @__PURE__ */ React.createElement(
576
- ChartFilter,
577
- __spreadProps(__spreadValues({
578
- filterOptions,
579
- selectedFilter,
580
- onFilterChange: setSelectedFilter
581
- }, customOptions && {
582
- customOptions,
583
- selectedCustomSelection: selectedFilterLabel,
584
- onSelectionChange: setSelectedFilterLabel
585
- }), {
586
- theme
587
- })
588
- ),
589
- statisticComponentConfigs && /* @__PURE__ */ React.createElement("div", { style: { marginBottom: 16 } }, statisticComponentConfigs.map((config, index) => /* @__PURE__ */ React.createElement(ChartStatistic, __spreadProps(__spreadValues({ key: index }, config), { theme })))),
590
- /* @__PURE__ */ React.createElement("div", { className: "chart-wrapper", style: { height: finalHeight } }, /* @__PURE__ */ React.createElement(
591
- Bar,
592
- {
593
- key: `funnel-${pluginToggleKey}`,
594
- ref: chartRef,
595
- data: processedData,
596
- options,
597
- plugins: [trapezoidPlugin, rightLabelPlugin]
598
- }
599
- ))
549
+ isMobile,
550
+ variant: props.variant,
551
+ style: {
552
+ width: responsiveWidth
553
+ }
554
+ },
555
+ /* @__PURE__ */ React.createElement(
556
+ ChartToolBar,
557
+ {
558
+ title,
559
+ theme,
560
+ onDownload: handleDownload,
561
+ dataTime,
562
+ extra: toolbarExtra,
563
+ filter: renderFilterInToolbar && filterOptions && filterOptions.length > 1 ? /* @__PURE__ */ React.createElement(
564
+ ChartFilter,
565
+ __spreadProps(__spreadValues({
566
+ filterOptions,
567
+ selectedFilter,
568
+ onFilterChange: setSelectedFilter
569
+ }, customOptions && {
570
+ customOptions,
571
+ selectedCustomSelection: selectedFilterLabel,
572
+ onSelectionChange: setSelectedFilterLabel
573
+ }), {
574
+ theme,
575
+ variant: "compact"
576
+ })
577
+ ) : void 0
578
+ }
579
+ ),
580
+ !renderFilterInToolbar && filterOptions && filterOptions.length > 1 && /* @__PURE__ */ React.createElement(
581
+ ChartFilter,
582
+ __spreadProps(__spreadValues({
583
+ filterOptions,
584
+ selectedFilter,
585
+ onFilterChange: setSelectedFilter
586
+ }, customOptions && {
587
+ customOptions,
588
+ selectedCustomSelection: selectedFilterLabel,
589
+ onSelectionChange: setSelectedFilterLabel
590
+ }), {
591
+ theme
592
+ })
593
+ ),
594
+ statistics && /* @__PURE__ */ React.createElement(
595
+ "div",
596
+ {
597
+ className: classNames(`${baseClassName}-statistic-container`, hashId)
598
+ },
599
+ statistics.map((config, index) => /* @__PURE__ */ React.createElement(ChartStatistic, __spreadProps(__spreadValues({ key: index }, config), { theme })))
600
+ ),
601
+ /* @__PURE__ */ React.createElement(
602
+ "div",
603
+ {
604
+ className: classNames(`${baseClassName}-wrapper`, hashId),
605
+ style: { height: finalHeight }
606
+ },
607
+ /* @__PURE__ */ React.createElement(
608
+ Bar,
609
+ {
610
+ key: `funnel-${pluginToggleKey}`,
611
+ ref: chartRef,
612
+ data: processedData,
613
+ options,
614
+ plugins: [trapezoidPlugin, rightLabelPlugin]
615
+ }
616
+ )
617
+ )
618
+ )
600
619
  );
601
620
  };
602
621
  var FunnelChart_default = FunnelChart;
@@ -38,6 +38,18 @@ var genStyle = (token) => {
38
38
  maxWidth: "100% !important",
39
39
  maxHeight: "100% !important"
40
40
  },
41
+ "&-statistic-container": {
42
+ display: "flex",
43
+ gap: "16px",
44
+ marginBottom: "16px",
45
+ flexWrap: "wrap",
46
+ alignItems: "flex-start"
47
+ },
48
+ "&-wrapper": {
49
+ position: "relative",
50
+ width: "100%",
51
+ height: "100%"
52
+ },
41
53
  "@media (max-width: 768px)": {
42
54
  ".chart-wrapper": {
43
55
  height: "calc(100% - 100px)",
@@ -23,10 +23,10 @@ export interface LineChartConfigItem {
23
23
  yAxisStep?: number;
24
24
  }
25
25
  export interface LineChartProps extends ChartContainerProps {
26
- /** 图表标题 */
27
- title?: string;
28
26
  /** 扁平化数据数组 */
29
27
  data: LineChartDataItem[];
28
+ /** 图表标题 */
29
+ title?: string;
30
30
  /** 图表宽度,默认600px */
31
31
  width?: number | string;
32
32
  /** 图表高度,默认400px */
@@ -51,9 +51,7 @@ import {
51
51
  ChartToolBar,
52
52
  downloadChart
53
53
  } from "../components";
54
- import {
55
- useChartStatistic
56
- } from "../hooks/useChartStatistic";
54
+ import { defaultColorList } from "../const";
57
55
  import {
58
56
  extractAndSortXValues,
59
57
  findDataPointByXValue
@@ -67,18 +65,6 @@ ChartJS.register(
67
65
  Tooltip,
68
66
  Legend
69
67
  );
70
- var defaultColors = [
71
- "#1677ff",
72
- "#8954FC",
73
- "#15e7e4",
74
- "#F45BB5",
75
- "#00A6FF",
76
- "#33E59B",
77
- "#D666E4",
78
- "#6151FF",
79
- "#BF3C93",
80
- "#005EE0"
81
- ];
82
68
  var LineChart = (_a) => {
83
69
  var _b = _a, {
84
70
  title,
@@ -140,7 +126,11 @@ var LineChart = (_a) => {
140
126
  const context = useContext(ConfigProvider.ConfigContext);
141
127
  const baseClassName = context == null ? void 0 : context.getPrefixCls("line-chart-container");
142
128
  const chartRef = useRef(null);
143
- const statisticComponentConfigs = useChartStatistic(statisticConfig);
129
+ const statistics = useMemo(() => {
130
+ if (!statisticConfig)
131
+ return null;
132
+ return Array.isArray(statisticConfig) ? statisticConfig : [statisticConfig];
133
+ }, [statisticConfig]);
144
134
  const categories = useMemo(() => {
145
135
  const uniqueCategories = [
146
136
  ...new Set(safeData.map((item) => item.category))
@@ -195,7 +185,7 @@ var LineChart = (_a) => {
195
185
  const labels = xValues.map((x) => x.toString());
196
186
  const datasets = types.map((type, index) => {
197
187
  const provided = color;
198
- const baseColor = Array.isArray(provided) ? provided[index % provided.length] || defaultColors[index % defaultColors.length] : provided || defaultColors[index % defaultColors.length];
188
+ const baseColor = Array.isArray(provided) ? provided[index % provided.length] || defaultColorList[index % defaultColorList.length] : provided || defaultColorList[index % defaultColorList.length];
199
189
  const typeData = xValues.map((x) => {
200
190
  const dataPoint = findDataPointByXValue(filteredData, x, type);
201
191
  const v = dataPoint == null ? void 0 : dataPoint.y;
@@ -372,7 +362,7 @@ var LineChart = (_a) => {
372
362
  ) : void 0
373
363
  }
374
364
  ),
375
- statisticComponentConfigs && /* @__PURE__ */ React.createElement("div", { className: "chart-statistic-container" }, statisticComponentConfigs.map((config, index) => /* @__PURE__ */ React.createElement(ChartStatistic, __spreadProps(__spreadValues({ key: index }, config), { theme })))),
365
+ statistics && /* @__PURE__ */ React.createElement("div", { className: `${baseClassName}-statistic-container` }, statistics.map((config, index) => /* @__PURE__ */ React.createElement(ChartStatistic, __spreadProps(__spreadValues({ key: index }, config), { theme })))),
376
366
  !renderFilterInToolbar && filterOptions && filterOptions.length > 1 && /* @__PURE__ */ React.createElement(
377
367
  ChartFilter,
378
368
  __spreadProps(__spreadValues({
@@ -387,7 +377,14 @@ var LineChart = (_a) => {
387
377
  theme
388
378
  })
389
379
  ),
390
- /* @__PURE__ */ React.createElement("div", { className: "chart-wrapper", style: { height: responsiveHeight } }, /* @__PURE__ */ React.createElement(Line, { ref: chartRef, data: processedData, options }))
380
+ /* @__PURE__ */ React.createElement(
381
+ "div",
382
+ {
383
+ className: `${baseClassName}-wrapper`,
384
+ style: { height: responsiveHeight }
385
+ },
386
+ /* @__PURE__ */ React.createElement(Line, { ref: chartRef, data: processedData, options })
387
+ )
391
388
  );
392
389
  };
393
390
  var LineChart_default = LineChart;
@@ -9,19 +9,25 @@ export interface RadarChartDataItem {
9
9
  filterLabel?: string;
10
10
  }
11
11
  interface RadarChartProps extends ChartContainerProps {
12
+ /** 扁平化数据数组 */
12
13
  data: RadarChartDataItem[];
14
+ /** 图表标题 */
13
15
  title?: string;
16
+ /** 图表宽度,默认600px */
14
17
  width?: number | string;
18
+ /** 图表高度,默认400px */
15
19
  height?: number | string;
20
+ /** 自定义CSS类名 */
16
21
  className?: string;
22
+ /** 数据时间 */
23
+ dataTime?: string;
24
+ /** 自定义主色(可选),支持 string 或 string[];数组按序对应各数据序列 */
25
+ color?: string | string[];
26
+ /** 头部工具条额外按钮 */
17
27
  toolbarExtra?: React.ReactNode;
18
28
  /** 是否将过滤器渲染到工具栏 */
19
29
  renderFilterInToolbar?: boolean;
20
- dataTime?: string;
21
- borderColor?: string;
22
- backgroundColor?: string;
23
- pointBackgroundColor?: string;
24
- /** 统计数据组件配置 */
30
+ /** ChartStatistic组件配置:object表示单个配置,array表示多个配置 */
25
31
  statistic?: StatisticConfigType;
26
32
  /** 图例文字最大宽度(像素),超出则显示省略号,默认80px */
27
33
  textMaxWidth?: number;
@@ -42,7 +42,7 @@ import {
42
42
  Tooltip
43
43
  } from "chart.js";
44
44
  import classNames from "classnames";
45
- import React, { useContext, useEffect, useRef, useState } from "react";
45
+ import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
46
46
  import { Radar } from "react-chartjs-2";
47
47
  import ChartStatistic from "../ChartStatistic";
48
48
  import {
@@ -51,9 +51,7 @@ import {
51
51
  ChartToolBar,
52
52
  downloadChart
53
53
  } from "../components";
54
- import {
55
- useChartStatistic
56
- } from "../hooks/useChartStatistic";
54
+ import { defaultColorList } from "../const";
57
55
  import { useStyle } from "./style";
58
56
  ChartJS.register(
59
57
  RadialLinearScale,
@@ -63,28 +61,6 @@ ChartJS.register(
63
61
  Tooltip,
64
62
  Legend
65
63
  );
66
- var defaultColors = [
67
- "#388BFF",
68
- // 第一个颜色:蓝色
69
- "#917EF7",
70
- // 第二个颜色:紫色
71
- "#2AD8FC",
72
- // 第三个颜色:青色
73
- "#F45BB5",
74
- // 粉色
75
- "#00A6FF",
76
- // 天蓝色
77
- "#33E59B",
78
- // 绿色
79
- "#D666E4",
80
- // 紫红色
81
- "#6151FF",
82
- // 靛蓝色
83
- "#BF3C93",
84
- // 玫红色
85
- "#005EE0"
86
- // 深蓝色
87
- ];
88
64
  var RadarChart = (_a) => {
89
65
  var _b = _a, {
90
66
  data,
@@ -95,10 +71,8 @@ var RadarChart = (_a) => {
95
71
  toolbarExtra,
96
72
  renderFilterInToolbar = false,
97
73
  dataTime,
98
- borderColor,
99
- backgroundColor,
100
- pointBackgroundColor,
101
- statistic,
74
+ color,
75
+ statistic: statisticConfig,
102
76
  textMaxWidth = 80
103
77
  } = _b, props = __objRest(_b, [
104
78
  "data",
@@ -109,16 +83,18 @@ var RadarChart = (_a) => {
109
83
  "toolbarExtra",
110
84
  "renderFilterInToolbar",
111
85
  "dataTime",
112
- "borderColor",
113
- "backgroundColor",
114
- "pointBackgroundColor",
86
+ "color",
115
87
  "statistic",
116
88
  "textMaxWidth"
117
89
  ]);
118
90
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
119
91
  const prefixCls = getPrefixCls("radar-chart");
120
92
  const { wrapSSR, hashId } = useStyle(prefixCls);
121
- const statisticComponentConfigs = useChartStatistic(statistic);
93
+ const statistics = useMemo(() => {
94
+ if (!statisticConfig)
95
+ return null;
96
+ return Array.isArray(statisticConfig) ? statisticConfig : [statisticConfig];
97
+ }, [statisticConfig]);
122
98
  const [windowWidth, setWindowWidth] = useState(
123
99
  typeof window !== "undefined" ? window.innerWidth : 768
124
100
  );
@@ -246,15 +222,18 @@ var RadarChart = (_a) => {
246
222
  }
247
223
  return 0;
248
224
  });
249
- const safeIndex = Math.max(0, index % defaultColors.length);
250
- const safeDefaultColor = defaultColors[safeIndex] || "#388BFF";
225
+ const providedColor = color;
226
+ const baseColor = Array.isArray(providedColor) ? providedColor[index % providedColor.length] : providedColor;
227
+ const safeIndex = Math.max(0, index % defaultColorList.length);
228
+ const safeDefaultColor = defaultColorList[safeIndex] || "#1677ff";
229
+ const finalColor = baseColor || safeDefaultColor;
251
230
  return {
252
231
  label: type || "默认",
253
232
  data: scores,
254
- borderColor: borderColor || safeDefaultColor,
255
- backgroundColor: backgroundColor || `${safeDefaultColor}20`,
233
+ borderColor: finalColor,
234
+ backgroundColor: `${finalColor}20`,
256
235
  borderWidth: isMobile ? 1.5 : 2,
257
- pointBackgroundColor: pointBackgroundColor || safeDefaultColor,
236
+ pointBackgroundColor: finalColor,
258
237
  pointBorderColor: "#fff",
259
238
  pointBorderWidth: isMobile ? 1 : 2,
260
239
  pointRadius: isMobile ? 3 : 4,
@@ -281,10 +260,10 @@ var RadarChart = (_a) => {
281
260
  {
282
261
  label: "默认",
283
262
  data: [0],
284
- borderColor: defaultColors[0] || "#388BFF",
285
- backgroundColor: `${defaultColors[0] || "#388BFF"}20`,
263
+ borderColor: defaultColorList[0] || "#1677ff",
264
+ backgroundColor: `${defaultColorList[0] || "#1677ff"}20`,
286
265
  borderWidth: isMobile ? 1.5 : 2,
287
- pointBackgroundColor: defaultColors[0] || "#388BFF",
266
+ pointBackgroundColor: defaultColorList[0] || "#1677ff",
288
267
  pointBorderColor: "#fff",
289
268
  pointBorderWidth: isMobile ? 1 : 2,
290
269
  pointRadius: isMobile ? 3 : 4,
@@ -565,14 +544,20 @@ var RadarChart = (_a) => {
565
544
  theme: currentConfig.theme
566
545
  })
567
546
  ),
568
- statisticComponentConfigs && /* @__PURE__ */ React.createElement("div", { style: { marginBottom: 16 } }, statisticComponentConfigs.map((config, index) => /* @__PURE__ */ React.createElement(
569
- ChartStatistic,
570
- __spreadProps(__spreadValues({
571
- key: index
572
- }, config), {
573
- theme: currentConfig.theme
574
- })
575
- ))),
547
+ statistics && /* @__PURE__ */ React.createElement(
548
+ "div",
549
+ {
550
+ className: classNames(`${prefixCls}-statistic-container`, hashId)
551
+ },
552
+ statistics.map((config, index) => /* @__PURE__ */ React.createElement(
553
+ ChartStatistic,
554
+ __spreadProps(__spreadValues({
555
+ key: index
556
+ }, config), {
557
+ theme: currentConfig.theme
558
+ })
559
+ ))
560
+ ),
576
561
  /* @__PURE__ */ React.createElement("div", { className: classNames(`${prefixCls}-chart-wrapper`, hashId) }, /* @__PURE__ */ React.createElement(Radar, { ref: chartRef, data: processedData, options }))
577
562
  )
578
563
  );
@@ -39,6 +39,14 @@ var genStyle = (token) => {
39
39
  overflow: "hidden"
40
40
  // 防止内容溢出
41
41
  },
42
+ // 统计数据容器样式
43
+ [`${token.componentCls}-statistic-container`]: {
44
+ display: "flex",
45
+ gap: "16px",
46
+ marginBottom: "16px",
47
+ flexWrap: "wrap",
48
+ alignItems: "flex-start"
49
+ },
42
50
  // 确保图表不会超出容器边界
43
51
  canvas: {
44
52
  maxWidth: "100% !important",
@@ -9,26 +9,43 @@ export interface ScatterChartDataItem {
9
9
  filterLabel?: string;
10
10
  }
11
11
  export interface ScatterChartProps extends ChartContainerProps {
12
+ /** 扁平化数据数组 */
12
13
  data: ScatterChartDataItem[];
14
+ /** 图表标题 */
13
15
  title?: string;
16
+ /** 图表宽度,默认600px */
14
17
  width?: number | string;
18
+ /** 图表高度,默认400px */
15
19
  height?: number | string;
20
+ /** 自定义CSS类名 */
16
21
  className?: string;
22
+ /** 数据时间 */
23
+ dataTime?: string;
24
+ /** 自定义主色(可选),支持 string 或 string[];数组按序对应各数据序列 */
25
+ color?: string | string[];
26
+ /** 头部工具条额外按钮 */
17
27
  toolbarExtra?: React.ReactNode;
18
28
  /** 是否将过滤器渲染到工具栏 */
19
29
  renderFilterInToolbar?: boolean;
20
- dataTime?: string;
30
+ /** X轴单位 */
21
31
  xUnit?: string;
32
+ /** Y轴单位 */
22
33
  yUnit?: string;
23
- xLabel?: string;
24
- yLabel?: string;
34
+ /** X轴标签 */
35
+ xAxisLabel?: string;
36
+ /** Y轴标签 */
37
+ yAxisLabel?: string;
38
+ /** X轴位置 */
39
+ xPosition?: 'top' | 'bottom';
40
+ /** Y轴位置 */
41
+ yPosition?: 'left' | 'right';
25
42
  /** 是否隐藏X轴,默认false */
26
43
  hiddenX?: boolean;
27
44
  /** 是否隐藏Y轴,默认false */
28
45
  hiddenY?: boolean;
29
- borderColor?: string;
30
- backgroundColor?: string;
31
- /** 统计数据组件配置 */
46
+ /** 是否显示网格线,默认true */
47
+ showGrid?: boolean;
48
+ /** ChartStatistic组件配置:object表示单个配置,array表示多个配置 */
32
49
  statistic?: StatisticConfigType;
33
50
  /** 图例文字最大宽度(像素),超出则显示省略号,默认80px */
34
51
  textMaxWidth?: number;