@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('HistogramChart', function(token) {
|
|
111
|
+
var histogramToken = _object_spread_props(_object_spread({}, token), {
|
|
112
|
+
componentCls: ".".concat(prefixCls)
|
|
113
|
+
});
|
|
114
|
+
return [
|
|
115
|
+
genStyle(histogramToken)
|
|
116
|
+
];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
@@ -216,8 +216,8 @@ var LineChart = function LineChart(_0) {
|
|
|
216
216
|
borderColor: resolvedColor,
|
|
217
217
|
backgroundColor: hexToRgba(resolvedColor, 0.2),
|
|
218
218
|
pointBackgroundColor: resolvedColor,
|
|
219
|
-
pointBorderColor: '#fff',
|
|
220
|
-
pointBorderWidth: 1,
|
|
219
|
+
pointBorderColor: isLight ? '#fff' : resolvedColor,
|
|
220
|
+
pointBorderWidth: isLight ? 1 : 0,
|
|
221
221
|
borderWidth: 3,
|
|
222
222
|
tension: 0,
|
|
223
223
|
fill: false
|
|
@@ -231,7 +231,8 @@ var LineChart = function LineChart(_0) {
|
|
|
231
231
|
filteredData,
|
|
232
232
|
types,
|
|
233
233
|
xValues,
|
|
234
|
-
color
|
|
234
|
+
color,
|
|
235
|
+
isLight
|
|
235
236
|
]);
|
|
236
237
|
var options = {
|
|
237
238
|
responsive: true,
|
|
@@ -33,6 +33,8 @@ interface RadarChartProps extends ChartContainerProps {
|
|
|
33
33
|
classNames?: ChartClassNames;
|
|
34
34
|
/** 数据时间 */
|
|
35
35
|
dataTime?: string;
|
|
36
|
+
/** 图表主题 */
|
|
37
|
+
theme?: 'dark' | 'light';
|
|
36
38
|
/** 自定义主色(可选),支持 string 或 string[];数组按序对应各数据序列 */
|
|
37
39
|
color?: string | string[];
|
|
38
40
|
/** 头部工具条额外按钮 */
|
|
@@ -144,11 +144,12 @@ import { Radar } from "react-chartjs-2";
|
|
|
144
144
|
import ChartStatistic from "../ChartStatistic";
|
|
145
145
|
import { ChartContainer, ChartFilter, ChartToolBar, downloadChart } from "../components";
|
|
146
146
|
import { defaultColorList } from "../const";
|
|
147
|
+
import { useChartTheme } from "../hooks";
|
|
147
148
|
import { hexToRgba, resolveCssVariable } from "../utils";
|
|
148
149
|
import { useStyle } from "./style";
|
|
149
150
|
var radarChartComponentsRegistered = false;
|
|
150
151
|
var RadarChart = function RadarChart(_0) {
|
|
151
|
-
var data = _0.data, title = _0.title, _0_width = _0.width, width = _0_width === void 0 ? 600 : _0_width, _0_height = _0.height, height = _0_height === void 0 ? 400 : _0_height, className = _0.className, classNamesProp = _0.classNames, toolbarExtra = _0.toolbarExtra, _0_renderFilterInToolbar = _0.renderFilterInToolbar, renderFilterInToolbar = _0_renderFilterInToolbar === void 0 ? false : _0_renderFilterInToolbar, dataTime = _0.dataTime, color = _0.color, statisticConfig = _0.statistic, _0_textMaxWidth = _0.textMaxWidth, textMaxWidth = _0_textMaxWidth === void 0 ? 80 : _0_textMaxWidth, _0_loading = _0.loading, loading = _0_loading === void 0 ? false : _0_loading, props = _object_without_properties(_0, [
|
|
152
|
+
var data = _0.data, title = _0.title, _0_width = _0.width, width = _0_width === void 0 ? 600 : _0_width, _0_height = _0.height, height = _0_height === void 0 ? 400 : _0_height, className = _0.className, classNamesProp = _0.classNames, toolbarExtra = _0.toolbarExtra, _0_renderFilterInToolbar = _0.renderFilterInToolbar, renderFilterInToolbar = _0_renderFilterInToolbar === void 0 ? false : _0_renderFilterInToolbar, dataTime = _0.dataTime, _0_theme = _0.theme, theme = _0_theme === void 0 ? 'light' : _0_theme, color = _0.color, statisticConfig = _0.statistic, _0_textMaxWidth = _0.textMaxWidth, textMaxWidth = _0_textMaxWidth === void 0 ? 80 : _0_textMaxWidth, _0_loading = _0.loading, loading = _0_loading === void 0 ? false : _0_loading, props = _object_without_properties(_0, [
|
|
152
153
|
"data",
|
|
153
154
|
"title",
|
|
154
155
|
"width",
|
|
@@ -158,6 +159,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
158
159
|
"toolbarExtra",
|
|
159
160
|
"renderFilterInToolbar",
|
|
160
161
|
"dataTime",
|
|
162
|
+
"theme",
|
|
161
163
|
"color",
|
|
162
164
|
"statistic",
|
|
163
165
|
"textMaxWidth",
|
|
@@ -177,6 +179,8 @@ var RadarChart = function RadarChart(_0) {
|
|
|
177
179
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
178
180
|
var prefixCls = getPrefixCls('radar-chart');
|
|
179
181
|
var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
182
|
+
// 主题颜色 - 必须在所有条件返回之前调用
|
|
183
|
+
var _useChartTheme = useChartTheme(theme), axisTextColor = _useChartTheme.axisTextColor, gridColor = _useChartTheme.gridColor, isLight = _useChartTheme.isLight;
|
|
180
184
|
// 处理 ChartStatistic 组件配置
|
|
181
185
|
var statistics = useMemo(function() {
|
|
182
186
|
if (!statisticConfig) return null;
|
|
@@ -269,7 +273,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
269
273
|
var _props_styles;
|
|
270
274
|
return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
|
|
271
275
|
baseClassName: classNames("".concat(prefixCls, "-container")),
|
|
272
|
-
theme:
|
|
276
|
+
theme: theme,
|
|
273
277
|
className: classNames(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.root, hashId, className),
|
|
274
278
|
isMobile: isMobile,
|
|
275
279
|
variant: props.variant,
|
|
@@ -279,6 +283,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
279
283
|
}, props.style, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root)
|
|
280
284
|
}, /*#__PURE__*/ React.createElement(ChartToolBar, {
|
|
281
285
|
title: title || '雷达图',
|
|
286
|
+
theme: theme,
|
|
282
287
|
onDownload: function onDownload() {},
|
|
283
288
|
extra: toolbarExtra,
|
|
284
289
|
dataTime: dataTime,
|
|
@@ -338,19 +343,14 @@ var RadarChart = function RadarChart(_0) {
|
|
|
338
343
|
backgroundColor: hexToRgba(resolvedColor, 0.125),
|
|
339
344
|
borderWidth: isMobile ? 1.5 : 2,
|
|
340
345
|
pointBackgroundColor: resolvedColor,
|
|
341
|
-
|
|
342
|
-
|
|
346
|
+
// 与折线图一致:浅色 1px 白边;暗色去掉白边,避免图例色块出现亮框
|
|
347
|
+
pointBorderColor: isLight ? '#fff' : resolvedColor,
|
|
348
|
+
pointBorderWidth: isLight ? 1 : 0,
|
|
343
349
|
pointRadius: isMobile ? 3 : 4,
|
|
344
350
|
pointHoverRadius: isMobile ? 5 : 6,
|
|
345
351
|
fill: true
|
|
346
352
|
};
|
|
347
353
|
});
|
|
348
|
-
// 构建当前配置(用于主题等设置)
|
|
349
|
-
var currentConfig = {
|
|
350
|
-
theme: 'light',
|
|
351
|
-
showLegend: true,
|
|
352
|
-
legendPosition: 'right'
|
|
353
|
-
};
|
|
354
354
|
// 筛选器的枚举,添加安全检查
|
|
355
355
|
var filterEnum = categories.length > 0 ? categories.filter(function(category) {
|
|
356
356
|
return Boolean(category);
|
|
@@ -382,8 +382,8 @@ var RadarChart = function RadarChart(_0) {
|
|
|
382
382
|
backgroundColor: "".concat(defaultColorList[0] || '#1677ff', "20"),
|
|
383
383
|
borderWidth: isMobile ? 1.5 : 2,
|
|
384
384
|
pointBackgroundColor: defaultColorList[0] || '#1677ff',
|
|
385
|
-
pointBorderColor: '#fff',
|
|
386
|
-
pointBorderWidth:
|
|
385
|
+
pointBorderColor: isLight ? '#fff' : defaultColorList[0] || '#1677ff',
|
|
386
|
+
pointBorderWidth: isLight ? 1 : 0,
|
|
387
387
|
pointRadius: isMobile ? 3 : 4,
|
|
388
388
|
pointHoverRadius: isMobile ? 5 : 6,
|
|
389
389
|
fill: true
|
|
@@ -396,10 +396,10 @@ var RadarChart = function RadarChart(_0) {
|
|
|
396
396
|
maintainAspectRatio: false,
|
|
397
397
|
plugins: {
|
|
398
398
|
legend: {
|
|
399
|
-
display:
|
|
400
|
-
position: isMobile ? 'bottom' :
|
|
399
|
+
display: true,
|
|
400
|
+
position: isMobile ? 'bottom' : 'right',
|
|
401
401
|
labels: {
|
|
402
|
-
color:
|
|
402
|
+
color: axisTextColor,
|
|
403
403
|
font: {
|
|
404
404
|
size: isMobile ? 10 : 12,
|
|
405
405
|
weight: 'normal'
|
|
@@ -488,10 +488,10 @@ var RadarChart = function RadarChart(_0) {
|
|
|
488
488
|
// 获取数据集颜色作为图标颜色
|
|
489
489
|
var iconColor = (dataPoint === null || dataPoint === void 0 ? void 0 : (_dataPoint_dataset1 = dataPoint.dataset) === null || _dataPoint_dataset1 === void 0 ? void 0 : (_dataPoint_dataset_borderColor = _dataPoint_dataset1.borderColor) === null || _dataPoint_dataset_borderColor === void 0 ? void 0 : _dataPoint_dataset_borderColor.toString()) || '#388BFF';
|
|
490
490
|
// 创建 HTML 内容
|
|
491
|
-
var isDark =
|
|
491
|
+
var isDark = !isLight;
|
|
492
492
|
var bgColor = isDark ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.95)';
|
|
493
493
|
var labelColor = isDark ? '#fff' : '#767E8B'; // 左边图标信息颜色
|
|
494
|
-
tooltipEl1.innerHTML = '\n <div style="\n background-color: '.concat(bgColor, ";\n border: 1px solid ").concat(isDark ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 16, 32, 0.0627)', ";\n border-radius: ").concat(isMobile ? '6px' : '8px', ";\n padding: ").concat(isMobile ? '8px 12px' : '12px 16px', ";\n font-family: 'PingFang SC', sans-serif;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n backdrop-filter: blur(10px);\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 120px;\n \">\n <div style=\"\n font-family: 'PingFang SC', sans-serif;\n font-size: 12px;\n font-weight: normal;\n line-height: 20px;\n text-align: center;\n letter-spacing: 0em;\n font-variation-settings: 'opsz' auto;\n color: #767E8B;\n display: flex;\n align-items: center;\n justify-content: space-between;\n \">").concat(dimensionTitle, '</div>\n <div style="\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 20px;\n ">\n <div style="\n display: flex;\n align-items: center;\n gap: 8px;\n ">\n <div style="\n width: 12px;\n height: 12px;\n background-color: ').concat(iconColor, ';\n border-radius: 2px;\n flex-shrink: 0;\n "></div>\n <span style="\n color: ').concat(labelColor, ";\n font-size: ").concat(isMobile ? '11px' : '12px', ";\n font-weight: 500;\n font-family: 'PingFang SC', sans-serif;\n white-space: nowrap;\n \">").concat(label, "</span>\n </div>\n <span style=\"\n font-family: Rubik, sans-serif;\n font-size: 13px;\n font-weight: 500;\n line-height: 13px;\n text-align: center;\n letter-spacing: 0.04em;\n font-variation-settings: 'opsz' auto;\n font-feature-settings: 'kern' on;\n color: #343A45;\n white-space: nowrap;\n
|
|
494
|
+
tooltipEl1.innerHTML = '\n <div style="\n background-color: '.concat(bgColor, ";\n border: 1px solid ").concat(isDark ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 16, 32, 0.0627)', ";\n border-radius: ").concat(isMobile ? '6px' : '8px', ";\n padding: ").concat(isMobile ? '8px 12px' : '12px 16px', ";\n font-family: 'PingFang SC', sans-serif;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n backdrop-filter: blur(10px);\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 120px;\n \">\n <div style=\"\n font-family: 'PingFang SC', sans-serif;\n font-size: 12px;\n font-weight: normal;\n line-height: 20px;\n text-align: center;\n letter-spacing: 0em;\n font-variation-settings: 'opsz' auto;\n color: #767E8B;\n display: flex;\n align-items: center;\n justify-content: space-between;\n \">").concat(dimensionTitle, '</div>\n <div style="\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 20px;\n ">\n <div style="\n display: flex;\n align-items: center;\n gap: 8px;\n ">\n <div style="\n width: 12px;\n height: 12px;\n background-color: ').concat(iconColor, ';\n border-radius: 2px;\n flex-shrink: 0;\n "></div>\n <span style="\n color: ').concat(labelColor, ";\n font-size: ").concat(isMobile ? '11px' : '12px', ";\n font-weight: 500;\n font-family: 'PingFang SC', sans-serif;\n white-space: nowrap;\n \">").concat(label, "</span>\n </div>\n <span style=\"\n font-family: Rubik, sans-serif;\n font-size: 13px;\n font-weight: 500;\n line-height: 13px;\n text-align: center;\n letter-spacing: 0.04em;\n font-variation-settings: 'opsz' auto;\n font-feature-settings: 'kern' on;\n color: ").concat(isDark ? '#F9FAFB' : '#343A45', ';\n white-space: nowrap;\n ">').concat(value, "</span>\n </div>\n </div>\n ");
|
|
495
495
|
// 定位 tooltip
|
|
496
496
|
var position = chart.canvas.getBoundingClientRect();
|
|
497
497
|
tooltipEl1.style.opacity = '1';
|
|
@@ -508,7 +508,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
508
508
|
min: 0,
|
|
509
509
|
ticks: {
|
|
510
510
|
stepSize: isMobile ? 25 : 20,
|
|
511
|
-
color:
|
|
511
|
+
color: axisTextColor,
|
|
512
512
|
font: {
|
|
513
513
|
size: isMobile ? 8 : 10
|
|
514
514
|
},
|
|
@@ -519,15 +519,15 @@ var RadarChart = function RadarChart(_0) {
|
|
|
519
519
|
}
|
|
520
520
|
},
|
|
521
521
|
grid: {
|
|
522
|
-
color:
|
|
522
|
+
color: gridColor,
|
|
523
523
|
lineWidth: 1
|
|
524
524
|
},
|
|
525
525
|
angleLines: {
|
|
526
|
-
color:
|
|
526
|
+
color: gridColor,
|
|
527
527
|
lineWidth: 1
|
|
528
528
|
},
|
|
529
529
|
pointLabels: {
|
|
530
|
-
color:
|
|
530
|
+
color: axisTextColor,
|
|
531
531
|
font: {
|
|
532
532
|
size: isMobile ? 10 : 12,
|
|
533
533
|
weight: 500
|
|
@@ -559,7 +559,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
559
559
|
var _props_styles1;
|
|
560
560
|
return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
|
|
561
561
|
baseClassName: classNames("".concat(prefixCls, "-container")),
|
|
562
|
-
theme:
|
|
562
|
+
theme: theme,
|
|
563
563
|
className: classNames(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.root, hashId, className),
|
|
564
564
|
isMobile: isMobile,
|
|
565
565
|
variant: props.variant,
|
|
@@ -569,6 +569,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
569
569
|
}, props.style, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.root)
|
|
570
570
|
}, /*#__PURE__*/ React.createElement(ChartToolBar, {
|
|
571
571
|
title: title || '雷达图',
|
|
572
|
+
theme: theme,
|
|
572
573
|
onDownload: handleDownload,
|
|
573
574
|
extra: toolbarExtra,
|
|
574
575
|
dataTime: dataTime,
|
|
@@ -582,7 +583,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
582
583
|
selectedCustomSelection: selectedFilterLabel,
|
|
583
584
|
onSelectionChange: setSelectedFilterLabel
|
|
584
585
|
}), {
|
|
585
|
-
theme:
|
|
586
|
+
theme: theme,
|
|
586
587
|
variant: "compact"
|
|
587
588
|
})) : undefined
|
|
588
589
|
}), !renderFilterInToolbar && filterEnum.length > 0 && /*#__PURE__*/ React.createElement(ChartFilter, _object_spread_props(_object_spread({
|
|
@@ -594,14 +595,14 @@ var RadarChart = function RadarChart(_0) {
|
|
|
594
595
|
selectedCustomSelection: selectedFilterLabel,
|
|
595
596
|
onSelectionChange: setSelectedFilterLabel
|
|
596
597
|
}), {
|
|
597
|
-
theme:
|
|
598
|
+
theme: theme
|
|
598
599
|
})), statistics && /*#__PURE__*/ React.createElement("div", {
|
|
599
600
|
className: classNames("".concat(prefixCls, "-statistic-container"), hashId)
|
|
600
601
|
}, statistics.map(function(config, index) {
|
|
601
602
|
return /*#__PURE__*/ React.createElement(ChartStatistic, _object_spread_props(_object_spread({
|
|
602
603
|
key: index
|
|
603
604
|
}, config), {
|
|
604
|
-
theme:
|
|
605
|
+
theme: theme
|
|
605
606
|
}));
|
|
606
607
|
})), /*#__PURE__*/ React.createElement("div", {
|
|
607
608
|
className: classNames("".concat(prefixCls, "-chart-wrapper"), hashId)
|
|
@@ -615,7 +616,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
615
616
|
console.error('RadarChart 渲染错误:', error);
|
|
616
617
|
return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
|
|
617
618
|
baseClassName: classNames("".concat(prefixCls, "-container")),
|
|
618
|
-
theme:
|
|
619
|
+
theme: theme,
|
|
619
620
|
className: classNames(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.root, hashId, className),
|
|
620
621
|
isMobile: isMobile,
|
|
621
622
|
variant: props.variant,
|
|
@@ -625,6 +626,7 @@ var RadarChart = function RadarChart(_0) {
|
|
|
625
626
|
}, props.style, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.root)
|
|
626
627
|
}, /*#__PURE__*/ React.createElement(ChartToolBar, {
|
|
627
628
|
title: title || '雷达图',
|
|
629
|
+
theme: theme,
|
|
628
630
|
onDownload: function onDownload() {},
|
|
629
631
|
extra: toolbarExtra,
|
|
630
632
|
dataTime: dataTime,
|
|
@@ -24,6 +24,8 @@ export interface ScatterChartProps extends ChartContainerProps {
|
|
|
24
24
|
classNames?: ChartClassNames;
|
|
25
25
|
/** 数据时间 */
|
|
26
26
|
dataTime?: string;
|
|
27
|
+
/** 图表主题 */
|
|
28
|
+
theme?: 'dark' | 'light';
|
|
27
29
|
/** 自定义主色(可选),支持 string 或 string[];数组按序对应各数据序列 */
|
|
28
30
|
color?: string | string[];
|
|
29
31
|
/** 头部工具条额外按钮 */
|
|
@@ -144,11 +144,12 @@ import { Scatter } from "react-chartjs-2";
|
|
|
144
144
|
import ChartStatistic from "../ChartStatistic";
|
|
145
145
|
import { ChartContainer, ChartFilter, ChartToolBar, downloadChart } from "../components";
|
|
146
146
|
import { defaultColorList } from "../const";
|
|
147
|
+
import { useChartTheme } from "../hooks";
|
|
147
148
|
import { hexToRgba, resolveCssVariable } from "../utils";
|
|
148
149
|
import { useStyle } from "./style";
|
|
149
150
|
var scatterChartComponentsRegistered = false;
|
|
150
151
|
var ScatterChart = function ScatterChart(_0) {
|
|
151
|
-
var data = _0.data, _0_width = _0.width, width = _0_width === void 0 ? 600 : _0_width, _0_height = _0.height, height = _0_height === void 0 ? 400 : _0_height, className = _0.className, classNamesProp = _0.classNames, title = _0.title, toolbarExtra = _0.toolbarExtra, _0_renderFilterInToolbar = _0.renderFilterInToolbar, renderFilterInToolbar = _0_renderFilterInToolbar === void 0 ? false : _0_renderFilterInToolbar, dataTime = _0.dataTime, _0_xUnit = _0.xUnit, xUnit = _0_xUnit === void 0 ? '月' : _0_xUnit, yUnit = _0.yUnit, xAxisLabel = _0.xAxisLabel, yAxisLabel = _0.yAxisLabel, _0_xPosition = _0.xPosition, xPosition = _0_xPosition === void 0 ? 'bottom' : _0_xPosition, _0_yPosition = _0.yPosition, yPosition = _0_yPosition === void 0 ? 'left' : _0_yPosition, _0_hiddenX = _0.hiddenX, hiddenX = _0_hiddenX === void 0 ? false : _0_hiddenX, _0_hiddenY = _0.hiddenY, hiddenY = _0_hiddenY === void 0 ? false : _0_hiddenY, _0_showGrid = _0.showGrid, showGrid = _0_showGrid === void 0 ? true : _0_showGrid, color = _0.color, statisticConfig = _0.statistic, _0_textMaxWidth = _0.textMaxWidth, textMaxWidth = _0_textMaxWidth === void 0 ? 80 : _0_textMaxWidth, _0_loading = _0.loading, loading = _0_loading === void 0 ? false : _0_loading, props = _object_without_properties(_0, [
|
|
152
|
+
var data = _0.data, _0_width = _0.width, width = _0_width === void 0 ? 600 : _0_width, _0_height = _0.height, height = _0_height === void 0 ? 400 : _0_height, className = _0.className, classNamesProp = _0.classNames, title = _0.title, toolbarExtra = _0.toolbarExtra, _0_renderFilterInToolbar = _0.renderFilterInToolbar, renderFilterInToolbar = _0_renderFilterInToolbar === void 0 ? false : _0_renderFilterInToolbar, dataTime = _0.dataTime, _0_xUnit = _0.xUnit, xUnit = _0_xUnit === void 0 ? '月' : _0_xUnit, yUnit = _0.yUnit, xAxisLabel = _0.xAxisLabel, yAxisLabel = _0.yAxisLabel, _0_xPosition = _0.xPosition, xPosition = _0_xPosition === void 0 ? 'bottom' : _0_xPosition, _0_yPosition = _0.yPosition, yPosition = _0_yPosition === void 0 ? 'left' : _0_yPosition, _0_hiddenX = _0.hiddenX, hiddenX = _0_hiddenX === void 0 ? false : _0_hiddenX, _0_hiddenY = _0.hiddenY, hiddenY = _0_hiddenY === void 0 ? false : _0_hiddenY, _0_showGrid = _0.showGrid, showGrid = _0_showGrid === void 0 ? true : _0_showGrid, _0_theme = _0.theme, theme = _0_theme === void 0 ? 'light' : _0_theme, color = _0.color, statisticConfig = _0.statistic, _0_textMaxWidth = _0.textMaxWidth, textMaxWidth = _0_textMaxWidth === void 0 ? 80 : _0_textMaxWidth, _0_loading = _0.loading, loading = _0_loading === void 0 ? false : _0_loading, props = _object_without_properties(_0, [
|
|
152
153
|
"data",
|
|
153
154
|
"width",
|
|
154
155
|
"height",
|
|
@@ -167,6 +168,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
167
168
|
"hiddenX",
|
|
168
169
|
"hiddenY",
|
|
169
170
|
"showGrid",
|
|
171
|
+
"theme",
|
|
170
172
|
"color",
|
|
171
173
|
"statistic",
|
|
172
174
|
"textMaxWidth",
|
|
@@ -186,6 +188,8 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
186
188
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
187
189
|
var prefixCls = getPrefixCls('scatter-chart');
|
|
188
190
|
var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
191
|
+
// 主题颜色 - 必须在所有条件返回之前调用
|
|
192
|
+
var _useChartTheme = useChartTheme(theme), axisTextColor = _useChartTheme.axisTextColor, gridColor = _useChartTheme.gridColor, isLight = _useChartTheme.isLight;
|
|
189
193
|
// 处理 ChartStatistic 组件配置
|
|
190
194
|
var statistics = useMemo(function() {
|
|
191
195
|
if (!statisticConfig) return null;
|
|
@@ -273,7 +277,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
273
277
|
var _props_styles;
|
|
274
278
|
return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
|
|
275
279
|
baseClassName: classNames("".concat(prefixCls, "-container")),
|
|
276
|
-
theme:
|
|
280
|
+
theme: theme,
|
|
277
281
|
className: classNames(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.root, hashId, className),
|
|
278
282
|
isMobile: isMobile,
|
|
279
283
|
variant: props.variant,
|
|
@@ -283,6 +287,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
283
287
|
}, props.style, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root)
|
|
284
288
|
}, /*#__PURE__*/ React.createElement(ChartToolBar, {
|
|
285
289
|
title: title || '散点图',
|
|
290
|
+
theme: theme,
|
|
286
291
|
onDownload: function onDownload() {},
|
|
287
292
|
extra: toolbarExtra,
|
|
288
293
|
dataTime: dataTime,
|
|
@@ -358,12 +363,6 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
358
363
|
pointHoverRadius: isMobile ? 6 : 8
|
|
359
364
|
};
|
|
360
365
|
});
|
|
361
|
-
// 构建当前配置(应用默认值)
|
|
362
|
-
var currentConfig = {
|
|
363
|
-
theme: 'light',
|
|
364
|
-
showLegend: true,
|
|
365
|
-
legendPosition: 'bottom'
|
|
366
|
-
};
|
|
367
366
|
// 筛选器的枚举,添加安全检查
|
|
368
367
|
var filterEnum = categories.length > 0 ? categories.filter(function(category) {
|
|
369
368
|
return Boolean(category);
|
|
@@ -404,11 +403,11 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
404
403
|
maintainAspectRatio: false,
|
|
405
404
|
plugins: {
|
|
406
405
|
legend: {
|
|
407
|
-
display:
|
|
408
|
-
position: isMobile ? 'bottom' :
|
|
406
|
+
display: true,
|
|
407
|
+
position: isMobile ? 'bottom' : 'bottom',
|
|
409
408
|
align: 'start',
|
|
410
409
|
labels: {
|
|
411
|
-
color:
|
|
410
|
+
color: axisTextColor,
|
|
412
411
|
font: {
|
|
413
412
|
size: isMobile ? 10 : 12,
|
|
414
413
|
weight: 'normal'
|
|
@@ -418,18 +417,32 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
418
417
|
pointStyle: 'rectRounded',
|
|
419
418
|
generateLabels: function generateLabels(chart) {
|
|
420
419
|
var original = ChartJS.defaults.plugins.legend.labels.generateLabels(chart);
|
|
420
|
+
// 与折线图图例一致:实心色块 + 浅色 1px 白边;散点数据点仍为半透明,仅图例拉齐
|
|
421
|
+
var withLineLikeSwatch = function withLineLikeSwatch(label) {
|
|
422
|
+
var _label_datasetIndex;
|
|
423
|
+
var _chart_data_datasets, _chart_data;
|
|
424
|
+
var idx = (_label_datasetIndex = label.datasetIndex) !== null && _label_datasetIndex !== void 0 ? _label_datasetIndex : 0;
|
|
425
|
+
var ds = (_chart_data = chart.data) === null || _chart_data === void 0 ? void 0 : (_chart_data_datasets = _chart_data.datasets) === null || _chart_data_datasets === void 0 ? void 0 : _chart_data_datasets[idx];
|
|
426
|
+
var seriesColor = typeof (ds === null || ds === void 0 ? void 0 : ds.borderColor) === 'string' && ds.borderColor ? ds.borderColor : defaultColorList[0] || '#1677ff';
|
|
427
|
+
return _object_spread_props(_object_spread({}, label), {
|
|
428
|
+
fillStyle: seriesColor,
|
|
429
|
+
strokeStyle: isLight ? '#fff' : seriesColor,
|
|
430
|
+
lineWidth: isLight ? 1 : 0
|
|
431
|
+
});
|
|
432
|
+
};
|
|
421
433
|
// 创建一个临时 canvas 来测量文字宽度
|
|
422
434
|
var canvas = document.createElement('canvas');
|
|
423
435
|
var ctx = canvas.getContext('2d');
|
|
424
|
-
if (!ctx) return original;
|
|
436
|
+
if (!ctx) return original.map(withLineLikeSwatch);
|
|
425
437
|
// 设置字体样式与图例相同
|
|
426
438
|
var fontSize = isMobile ? 10 : 12;
|
|
427
439
|
ctx.font = "".concat(fontSize, "px 'PingFang SC', sans-serif");
|
|
428
440
|
return original.map(function(label) {
|
|
429
|
-
var
|
|
441
|
+
var labelAligned = withLineLikeSwatch(label);
|
|
442
|
+
var originalText = labelAligned.text;
|
|
430
443
|
var textWidth = ctx.measureText(originalText).width;
|
|
431
444
|
if (textWidth <= textMaxWidth) {
|
|
432
|
-
return
|
|
445
|
+
return labelAligned;
|
|
433
446
|
}
|
|
434
447
|
// 文字超过最大宽度,需要截断
|
|
435
448
|
var ellipsis = '...';
|
|
@@ -442,7 +455,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
442
455
|
truncatedText = truncatedText.slice(0, -1);
|
|
443
456
|
truncatedWidth = ctx.measureText(truncatedText).width;
|
|
444
457
|
}
|
|
445
|
-
return _object_spread_props(_object_spread({},
|
|
458
|
+
return _object_spread_props(_object_spread({}, labelAligned), {
|
|
446
459
|
text: truncatedText + ellipsis
|
|
447
460
|
});
|
|
448
461
|
});
|
|
@@ -506,10 +519,10 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
506
519
|
// 获取数据集颜色作为图标颜色
|
|
507
520
|
var iconColor = (dataPoint === null || dataPoint === void 0 ? void 0 : (_dataPoint_dataset1 = dataPoint.dataset) === null || _dataPoint_dataset1 === void 0 ? void 0 : (_dataPoint_dataset_borderColor = _dataPoint_dataset1.borderColor) === null || _dataPoint_dataset_borderColor === void 0 ? void 0 : _dataPoint_dataset_borderColor.toString()) || '#917EF7';
|
|
508
521
|
// 创建 HTML 内容
|
|
509
|
-
var isDark =
|
|
522
|
+
var isDark = !isLight;
|
|
510
523
|
var bgColor = isDark ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.95)';
|
|
511
524
|
var labelColor = isDark ? '#fff' : '#767E8B'; // 左边图标信息颜色
|
|
512
|
-
tooltipEl1.innerHTML = '\n <div style="\n background-color: '.concat(bgColor, ";\n border: 1px solid ").concat(isDark ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 16, 32, 0.0627)', ";\n border-radius: ").concat(isMobile ? '6px' : '8px', ";\n padding: ").concat(isMobile ? '8px 12px' : '12px 16px', ";\n font-family: 'PingFang SC', sans-serif;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n backdrop-filter: blur(10px);\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 120px;\n \">\n <div style=\"\n font-family: 'PingFang SC', sans-serif;\n font-size: 12px;\n font-weight: normal;\n line-height: 20px;\n text-align: center;\n letter-spacing: 0em;\n font-variation-settings: 'opsz' auto;\n color: #767E8B;\n display: flex;\n align-items: center;\n justify-content: space-between;\n \">").concat(dimensionTitle, '</div>\n <div style="\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 20px;\n ">\n <div style="\n display: flex;\n align-items: center;\n gap: 8px;\n ">\n <div style="\n width: 12px;\n height: 12px;\n background-color: ').concat(iconColor, ';\n border-radius: 2px;\n flex-shrink: 0;\n "></div>\n <span style="\n color: ').concat(labelColor, ";\n font-size: ").concat(isMobile ? '11px' : '12px', ";\n font-weight: 500;\n font-family: 'PingFang SC', sans-serif;\n white-space: nowrap;\n \">").concat(label, "</span>\n </div>\n <span style=\"\n font-family: Rubik, sans-serif;\n font-size: 13px;\n font-weight: 500;\n line-height: 13px;\n text-align: center;\n letter-spacing: 0.04em;\n font-variation-settings: 'opsz' auto;\n font-feature-settings: 'kern' on;\n color: #343A45;\n white-space: nowrap;\n
|
|
525
|
+
tooltipEl1.innerHTML = '\n <div style="\n background-color: '.concat(bgColor, ";\n border: 1px solid ").concat(isDark ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 16, 32, 0.0627)', ";\n border-radius: ").concat(isMobile ? '6px' : '8px', ";\n padding: ").concat(isMobile ? '8px 12px' : '12px 16px', ";\n font-family: 'PingFang SC', sans-serif;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n backdrop-filter: blur(10px);\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 120px;\n \">\n <div style=\"\n font-family: 'PingFang SC', sans-serif;\n font-size: 12px;\n font-weight: normal;\n line-height: 20px;\n text-align: center;\n letter-spacing: 0em;\n font-variation-settings: 'opsz' auto;\n color: #767E8B;\n display: flex;\n align-items: center;\n justify-content: space-between;\n \">").concat(dimensionTitle, '</div>\n <div style="\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 20px;\n ">\n <div style="\n display: flex;\n align-items: center;\n gap: 8px;\n ">\n <div style="\n width: 12px;\n height: 12px;\n background-color: ').concat(iconColor, ';\n border-radius: 2px;\n flex-shrink: 0;\n "></div>\n <span style="\n color: ').concat(labelColor, ";\n font-size: ").concat(isMobile ? '11px' : '12px', ";\n font-weight: 500;\n font-family: 'PingFang SC', sans-serif;\n white-space: nowrap;\n \">").concat(label, "</span>\n </div>\n <span style=\"\n font-family: Rubik, sans-serif;\n font-size: 13px;\n font-weight: 500;\n line-height: 13px;\n text-align: center;\n letter-spacing: 0.04em;\n font-variation-settings: 'opsz' auto;\n font-feature-settings: 'kern' on;\n color: ").concat(isDark ? '#F9FAFB' : '#343A45', ';\n white-space: nowrap;\n ">').concat(coordinates, "</span>\n </div>\n </div>\n ");
|
|
513
526
|
// 定位 tooltip
|
|
514
527
|
var position = chart.canvas.getBoundingClientRect();
|
|
515
528
|
tooltipEl1.style.opacity = '1';
|
|
@@ -527,7 +540,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
527
540
|
title: {
|
|
528
541
|
display: !!xAxisLabel,
|
|
529
542
|
text: xAxisLabel || '',
|
|
530
|
-
color:
|
|
543
|
+
color: axisTextColor,
|
|
531
544
|
font: {
|
|
532
545
|
size: isMobile ? 10 : 12,
|
|
533
546
|
weight: 500
|
|
@@ -537,7 +550,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
537
550
|
max: 12,
|
|
538
551
|
ticks: {
|
|
539
552
|
stepSize: 1,
|
|
540
|
-
color:
|
|
553
|
+
color: axisTextColor,
|
|
541
554
|
font: {
|
|
542
555
|
size: isMobile ? 8 : 10
|
|
543
556
|
},
|
|
@@ -547,7 +560,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
547
560
|
},
|
|
548
561
|
grid: {
|
|
549
562
|
display: showGrid,
|
|
550
|
-
color:
|
|
563
|
+
color: gridColor,
|
|
551
564
|
lineWidth: 1
|
|
552
565
|
}
|
|
553
566
|
},
|
|
@@ -558,7 +571,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
558
571
|
title: {
|
|
559
572
|
display: !!yAxisLabel,
|
|
560
573
|
text: yAxisLabel || '',
|
|
561
|
-
color:
|
|
574
|
+
color: axisTextColor,
|
|
562
575
|
font: {
|
|
563
576
|
family: 'PingFang SC',
|
|
564
577
|
size: isMobile ? 10 : 12,
|
|
@@ -570,7 +583,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
570
583
|
max: 100,
|
|
571
584
|
ticks: {
|
|
572
585
|
stepSize: 10,
|
|
573
|
-
color:
|
|
586
|
+
color: axisTextColor,
|
|
574
587
|
font: {
|
|
575
588
|
family: 'PingFang SC',
|
|
576
589
|
size: isMobile ? 8 : 12,
|
|
@@ -582,7 +595,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
582
595
|
},
|
|
583
596
|
grid: {
|
|
584
597
|
display: showGrid,
|
|
585
|
-
color:
|
|
598
|
+
color: gridColor,
|
|
586
599
|
lineWidth: 1
|
|
587
600
|
}
|
|
588
601
|
}
|
|
@@ -610,7 +623,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
610
623
|
var _props_styles1, _props_styles2, _props_styles3;
|
|
611
624
|
return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
|
|
612
625
|
baseClassName: classNames("".concat(prefixCls, "-container")),
|
|
613
|
-
theme:
|
|
626
|
+
theme: theme,
|
|
614
627
|
className: classNames(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.root, hashId, className),
|
|
615
628
|
isMobile: isMobile,
|
|
616
629
|
variant: props.variant,
|
|
@@ -620,6 +633,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
620
633
|
}, props.style, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.root)
|
|
621
634
|
}, /*#__PURE__*/ React.createElement(ChartToolBar, {
|
|
622
635
|
title: title || '散点图',
|
|
636
|
+
theme: theme,
|
|
623
637
|
onDownload: handleDownload,
|
|
624
638
|
extra: toolbarExtra,
|
|
625
639
|
dataTime: dataTime,
|
|
@@ -633,7 +647,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
633
647
|
selectedCustomSelection: selectedFilterLabel,
|
|
634
648
|
onSelectionChange: setSelectedFilterLabel
|
|
635
649
|
}), {
|
|
636
|
-
theme:
|
|
650
|
+
theme: theme,
|
|
637
651
|
variant: "compact"
|
|
638
652
|
})) : undefined
|
|
639
653
|
}), !renderFilterInToolbar && filterEnum.length > 0 && /*#__PURE__*/ React.createElement(ChartFilter, _object_spread_props(_object_spread({
|
|
@@ -645,7 +659,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
645
659
|
selectedCustomSelection: selectedFilterLabel,
|
|
646
660
|
onSelectionChange: setSelectedFilterLabel
|
|
647
661
|
}), {
|
|
648
|
-
theme:
|
|
662
|
+
theme: theme
|
|
649
663
|
})), statistics && /*#__PURE__*/ React.createElement("div", {
|
|
650
664
|
className: classNames(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.statisticContainer, "".concat(prefixCls, "-statistic-container")),
|
|
651
665
|
style: (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.statisticContainer
|
|
@@ -653,7 +667,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
653
667
|
return /*#__PURE__*/ React.createElement(ChartStatistic, _object_spread_props(_object_spread({
|
|
654
668
|
key: index
|
|
655
669
|
}, config), {
|
|
656
|
-
theme:
|
|
670
|
+
theme: theme
|
|
657
671
|
}));
|
|
658
672
|
})), /*#__PURE__*/ React.createElement("div", {
|
|
659
673
|
className: classNames(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.wrapper, "".concat(prefixCls, "-chart-wrapper")),
|
|
@@ -670,7 +684,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
670
684
|
console.error('ScatterChart 渲染错误:', error);
|
|
671
685
|
return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
|
|
672
686
|
baseClassName: classNames("".concat(prefixCls, "-container")),
|
|
673
|
-
theme:
|
|
687
|
+
theme: theme,
|
|
674
688
|
isMobile: isMobile,
|
|
675
689
|
className: classNames(hashId, className),
|
|
676
690
|
variant: props.variant,
|
|
@@ -680,6 +694,7 @@ var ScatterChart = function ScatterChart(_0) {
|
|
|
680
694
|
}, props.style, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.root)
|
|
681
695
|
}, /*#__PURE__*/ React.createElement(ChartToolBar, {
|
|
682
696
|
title: title || '散点图',
|
|
697
|
+
theme: theme,
|
|
683
698
|
onDownload: function onDownload() {},
|
|
684
699
|
extra: toolbarExtra,
|
|
685
700
|
dataTime: dataTime,
|
|
@@ -97,6 +97,7 @@ export interface ChartContainerRef {
|
|
|
97
97
|
* - 统一的样式管理
|
|
98
98
|
* - 内置错误边界保护,防止图表错误影响整个应用
|
|
99
99
|
* - 错误边界默认启用,可通过配置禁用或自定义
|
|
100
|
+
* - `theme="dark"` 时在本容器内嵌套 Ant Design 暗色算法,工具栏/筛选等 antd 控件与画布暗色一致(嵌套容器不重复包裹)
|
|
100
101
|
*/
|
|
101
102
|
declare const ChartContainer: React.FC<ChartContainerProps & {
|
|
102
103
|
baseClassName: string;
|