@tsingroc/tsingroc-components 5.0.2 → 5.1.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/dist/components/BarLineChart/BarLineChart.module.css +10 -0
- package/dist/components/BarLineChart/index.d.ts +66 -0
- package/dist/components/BarLineChart/index.js +590 -0
- package/dist/components/BaseBarChart/BaseBarChart.module.css +12 -0
- package/dist/components/BaseBarChart/index.d.ts +33 -0
- package/dist/components/BaseBarChart/index.js +121 -0
- package/dist/components/DataCellNumber/DataCellNumber.module.css +20 -0
- package/dist/components/DataCellNumber/index.d.ts +14 -0
- package/dist/components/DataCellNumber/index.js +142 -0
- package/dist/components/FlexColLayout/index.d.ts +6 -0
- package/dist/components/FlexColLayout/index.js +40 -0
- package/dist/components/FlexRowLayout/index.d.ts +5 -0
- package/dist/components/FlexRowLayout/index.js +45 -0
- package/dist/components/HighlightSyncedECharts/index.d.ts +47 -0
- package/dist/components/HighlightSyncedECharts/index.js +260 -0
- package/dist/components/HighlightSyncedTable/index.d.ts +8 -0
- package/dist/components/HighlightSyncedTable/index.js +183 -0
- package/dist/components/LoadingSection/index.d.ts +41 -0
- package/dist/components/LoadingSection/index.js +183 -0
- package/dist/components/LoadingSkeleton/index.d.ts +42 -0
- package/dist/components/LoadingSkeleton/index.js +634 -0
- package/dist/components/ScrollableTable/ScrollableTable.module.css +21 -0
- package/dist/components/ScrollableTable/index.d.ts +13 -0
- package/dist/components/ScrollableTable/index.js +29 -0
- package/dist/components/TsingrocTable/TsingrocTable.module.css +32 -0
- package/dist/components/TsingrocTable/index.d.ts +12 -0
- package/dist/components/TsingrocTable/index.js +23 -0
- package/dist/components/TsingrocTheme/index.js +3 -3
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/pages/DayAheadReviewPage/components/PricePlot/index.d.ts +7 -0
- package/dist/pages/DayAheadReviewPage/components/PricePlot/index.js +136 -0
- package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/ProfitBarChart.module.css +13 -0
- package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/index.d.ts +17 -0
- package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/index.js +278 -0
- package/dist/pages/DayAheadReviewPage/components/RevenueCard/RevenueCard.module.css +40 -0
- package/dist/pages/DayAheadReviewPage/components/RevenueCard/index.d.ts +9 -0
- package/dist/pages/DayAheadReviewPage/components/RevenueCard/index.js +195 -0
- package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/RevenueSummaryCard.module.css +38 -0
- package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/index.d.ts +10 -0
- package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/index.js +117 -0
- package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/ReviewLineChart.module.css +11 -0
- package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/index.d.ts +53 -0
- package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/index.js +398 -0
- package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/ReviewSummaryTable.module.css +33 -0
- package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/index.d.ts +17 -0
- package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/index.js +187 -0
- package/dist/pages/DayAheadReviewPage/components/StrategyPlot/index.d.ts +10 -0
- package/dist/pages/DayAheadReviewPage/components/StrategyPlot/index.js +223 -0
- package/dist/pages/DayAheadReviewPage/components/SummaryTable/index.d.ts +7 -0
- package/dist/pages/DayAheadReviewPage/components/SummaryTable/index.js +39 -0
- package/dist/pages/DayAheadReviewPage/components/SummaryTable/useTableColumns.d.ts +10 -0
- package/dist/pages/DayAheadReviewPage/components/SummaryTable/useTableColumns.js +307 -0
- package/dist/pages/DayAheadReviewPage/hook/useDayAheadReviewDate.d.ts +137 -0
- package/dist/pages/DayAheadReviewPage/hook/useDayAheadReviewDate.js +252 -0
- package/dist/pages/DayAheadReviewPage/index.d.ts +149 -0
- package/dist/pages/DayAheadReviewPage/index.js +259 -0
- package/dist/pages/DayAheadReviewPage/layout/LeftChartContainer.d.ts +12 -0
- package/dist/pages/DayAheadReviewPage/layout/LeftChartContainer.js +236 -0
- package/dist/pages/DayAheadReviewPage/layout/ReviewPageLayout.d.ts +4 -0
- package/dist/pages/DayAheadReviewPage/layout/ReviewPageLayout.js +32 -0
- package/dist/pages/DayAheadReviewPage/layout/RightSummaryContainer.d.ts +14 -0
- package/dist/pages/DayAheadReviewPage/layout/RightSummaryContainer.js +199 -0
- package/dist/pages/DayAheadReviewPage/layout/TopDayReviewHeader.d.ts +9 -0
- package/dist/pages/DayAheadReviewPage/layout/TopDayReviewHeader.js +115 -0
- package/dist/pages/DayAheadReviewPage/types/dayahead.d.ts +172 -0
- package/dist/pages/DayAheadReviewPage/types/dayahead.js +1 -0
- package/dist/utils/accessibility.d.ts +114 -0
- package/dist/utils/accessibility.js +214 -0
- package/dist/utils/constants.d.ts +18 -0
- package/dist/utils/constants.js +34 -0
- package/dist/utils/export.d.ts +10 -0
- package/dist/utils/export.js +72 -0
- package/dist/utils/formatters.d.ts +46 -0
- package/dist/utils/formatters.js +84 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/presenters.d.ts +24 -0
- package/dist/utils/presenters.js +48 -0
- package/dist/utils/ui.d.ts +116 -0
- package/dist/utils/ui.js +171 -0
- package/package.json +27 -25
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface BarSeriesConfig {
|
|
2
|
+
name: string;
|
|
3
|
+
data: (number | null | undefined)[];
|
|
4
|
+
option?: {
|
|
5
|
+
color?: string;
|
|
6
|
+
barWidth?: string | number;
|
|
7
|
+
tooltip?: {
|
|
8
|
+
valueFormatter?: (value: unknown) => string;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface LineSeriesConfig {
|
|
14
|
+
name: string;
|
|
15
|
+
data: (number | null | undefined)[];
|
|
16
|
+
option?: {
|
|
17
|
+
color?: string;
|
|
18
|
+
smooth?: boolean;
|
|
19
|
+
lineStyle?: {
|
|
20
|
+
width?: number;
|
|
21
|
+
type?: "solid" | "dashed" | "dotted";
|
|
22
|
+
};
|
|
23
|
+
tooltip?: {
|
|
24
|
+
valueFormatter?: (value: unknown) => string;
|
|
25
|
+
};
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface BarLineChartProps {
|
|
30
|
+
title: string;
|
|
31
|
+
chartClassName?: string;
|
|
32
|
+
gridOption?: {
|
|
33
|
+
left?: string | number;
|
|
34
|
+
top?: string | number;
|
|
35
|
+
bottom?: string | number;
|
|
36
|
+
right?: string | number;
|
|
37
|
+
};
|
|
38
|
+
xAxisData?: string[];
|
|
39
|
+
xAxisFormat?: "datetime" | "date" | "time";
|
|
40
|
+
xAxisInterval?: number | ((dataLength: number) => number);
|
|
41
|
+
useUtc?: boolean;
|
|
42
|
+
barSeries?: BarSeriesConfig[];
|
|
43
|
+
lineSeries?: LineSeriesConfig[];
|
|
44
|
+
/** Optional. If omitted, derived from lineSeries + barSeries to guarantee match. */
|
|
45
|
+
legendData?: string[];
|
|
46
|
+
legendOption?: {
|
|
47
|
+
left?: string | number;
|
|
48
|
+
right?: string | number;
|
|
49
|
+
top?: string | number;
|
|
50
|
+
bottom?: string | number;
|
|
51
|
+
orient?: "horizontal" | "vertical";
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
showTitle?: boolean;
|
|
55
|
+
barYAxisName?: string;
|
|
56
|
+
lineYAxisName?: string;
|
|
57
|
+
barYAxisNameLocation?: "start" | "middle" | "end";
|
|
58
|
+
lineYAxisNameLocation?: "start" | "middle" | "end";
|
|
59
|
+
barYAxisNameGap?: number;
|
|
60
|
+
lineYAxisNameGap?: number;
|
|
61
|
+
barYAxisNamePadding?: number | number[];
|
|
62
|
+
lineYAxisNamePadding?: number | number[];
|
|
63
|
+
barYAxisMin?: number;
|
|
64
|
+
}
|
|
65
|
+
declare const BarLineChart: ({ title, chartClassName, gridOption, xAxisData, xAxisFormat, xAxisInterval, useUtc, barSeries, lineSeries, legendData: _legendData, legendOption, showTitle, barYAxisName, lineYAxisName, barYAxisNameLocation, lineYAxisNameLocation, barYAxisNameGap, lineYAxisNameGap, barYAxisNamePadding, lineYAxisNamePadding, }: BarLineChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export default BarLineChart;
|
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Card } from "antd";
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
|
+
import utc from "dayjs/plugin/utc";
|
|
5
|
+
import * as echarts from "#src/echarts";
|
|
6
|
+
import { COLOR_CHART_AXIS } from "#src/utils/constants";
|
|
7
|
+
import HighlightSyncedECharts from "../HighlightSyncedECharts";
|
|
8
|
+
import styles from "./BarLineChart.module.css";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
dayjs.extend(utc);
|
|
11
|
+
const DEFAULT_GRID_OPTION = {
|
|
12
|
+
left: "3%",
|
|
13
|
+
top: 20,
|
|
14
|
+
bottom: 0,
|
|
15
|
+
right: 0
|
|
16
|
+
};
|
|
17
|
+
const AXIS_COLOR = "#ADADAD";
|
|
18
|
+
const AXIS_FONT_SIZE = 11;
|
|
19
|
+
const generateDefaultHourlyData = useUtc => {
|
|
20
|
+
if (useUtc) {
|
|
21
|
+
// UTC mode: generate timestamps with Z suffix
|
|
22
|
+
return Array.from({
|
|
23
|
+
length: 24
|
|
24
|
+
}, (_, i) => dayjs.utc().startOf("day").add(i, "hour").toISOString());
|
|
25
|
+
}
|
|
26
|
+
// Local mode: generate timestamps with +08:00 offset to match API format
|
|
27
|
+
return Array.from({
|
|
28
|
+
length: 24
|
|
29
|
+
}, (_, i) => dayjs().startOf("day").add(i, "hour").format("YYYY-MM-DDTHH:mm:ss+08:00"));
|
|
30
|
+
};
|
|
31
|
+
const formatTimeData = (timeData, useUtc, format) => timeData.map(t => {
|
|
32
|
+
const parsed = useUtc ? dayjs.utc(t) : dayjs(t);
|
|
33
|
+
return format === "date" ? parsed.format("YYYY-MM-DD") : format === "time" ? parsed.format("HH:mm") : parsed.format("MM-DD HH:mm");
|
|
34
|
+
});
|
|
35
|
+
const calculateInterval = (xAxisInterval, isDefaultHourlyData, dataLength) => {
|
|
36
|
+
if (xAxisInterval !== undefined) {
|
|
37
|
+
return typeof xAxisInterval === "function" ? xAxisInterval(dataLength) : xAxisInterval;
|
|
38
|
+
}
|
|
39
|
+
return isDefaultHourlyData ? 1 : undefined;
|
|
40
|
+
};
|
|
41
|
+
const BarLineChart = t0 => {
|
|
42
|
+
const $ = _c(119);
|
|
43
|
+
const {
|
|
44
|
+
title,
|
|
45
|
+
chartClassName,
|
|
46
|
+
gridOption,
|
|
47
|
+
xAxisData,
|
|
48
|
+
xAxisFormat: t1,
|
|
49
|
+
xAxisInterval,
|
|
50
|
+
useUtc: t2,
|
|
51
|
+
barSeries: t3,
|
|
52
|
+
lineSeries: t4,
|
|
53
|
+
legendData: _legendData,
|
|
54
|
+
legendOption,
|
|
55
|
+
showTitle: t5,
|
|
56
|
+
barYAxisName: t6,
|
|
57
|
+
lineYAxisName: t7,
|
|
58
|
+
barYAxisNameLocation: t8,
|
|
59
|
+
lineYAxisNameLocation: t9,
|
|
60
|
+
barYAxisNameGap: t10,
|
|
61
|
+
lineYAxisNameGap: t11,
|
|
62
|
+
barYAxisNamePadding,
|
|
63
|
+
lineYAxisNamePadding
|
|
64
|
+
} = t0;
|
|
65
|
+
const xAxisFormat = t1 === undefined ? "datetime" : t1;
|
|
66
|
+
const useUtc = t2 === undefined ? false : t2;
|
|
67
|
+
let T0;
|
|
68
|
+
let T1;
|
|
69
|
+
let alignedBarAxisMax;
|
|
70
|
+
let alignedLineAxisMax;
|
|
71
|
+
let barAxisInterval;
|
|
72
|
+
let barYAxisName;
|
|
73
|
+
let barYAxisNameGap;
|
|
74
|
+
let barYAxisNameLocation;
|
|
75
|
+
let formattedXAxisData;
|
|
76
|
+
let interval;
|
|
77
|
+
let lineAxisInterval;
|
|
78
|
+
let lineYAxisName;
|
|
79
|
+
let lineYAxisNameGap;
|
|
80
|
+
let lineYAxisNameLocation;
|
|
81
|
+
let series;
|
|
82
|
+
let showTitle;
|
|
83
|
+
let t12;
|
|
84
|
+
let t13;
|
|
85
|
+
let t14;
|
|
86
|
+
let t15;
|
|
87
|
+
let t16;
|
|
88
|
+
let t17;
|
|
89
|
+
if ($[0] !== _legendData || $[1] !== chartClassName || $[2] !== gridOption?.bottom || $[3] !== gridOption?.left || $[4] !== gridOption?.right || $[5] !== gridOption?.top || $[6] !== legendOption || $[7] !== t10 || $[8] !== t11 || $[9] !== t3 || $[10] !== t4 || $[11] !== t5 || $[12] !== t6 || $[13] !== t7 || $[14] !== t8 || $[15] !== t9 || $[16] !== title || $[17] !== useUtc || $[18] !== xAxisData || $[19] !== xAxisFormat || $[20] !== xAxisInterval) {
|
|
90
|
+
const barSeries = t3 === undefined ? [] : t3;
|
|
91
|
+
const lineSeries = t4 === undefined ? [] : t4;
|
|
92
|
+
showTitle = t5 === undefined ? false : t5;
|
|
93
|
+
barYAxisName = t6 === undefined ? "\u5355\u4F4D\uFF1A\u5143" : t6;
|
|
94
|
+
lineYAxisName = t7 === undefined ? "\u5355\u4F4D\uFF1AMWh" : t7;
|
|
95
|
+
barYAxisNameLocation = t8 === undefined ? "end" : t8;
|
|
96
|
+
lineYAxisNameLocation = t9 === undefined ? "end" : t9;
|
|
97
|
+
barYAxisNameGap = t10 === undefined ? 10 : t10;
|
|
98
|
+
lineYAxisNameGap = t11 === undefined ? 10 : t11;
|
|
99
|
+
const hasData = Boolean(xAxisData?.length);
|
|
100
|
+
let t18;
|
|
101
|
+
if ($[43] !== hasData || $[44] !== useUtc || $[45] !== xAxisData) {
|
|
102
|
+
t18 = hasData ? xAxisData : generateDefaultHourlyData(useUtc);
|
|
103
|
+
$[43] = hasData;
|
|
104
|
+
$[44] = useUtc;
|
|
105
|
+
$[45] = xAxisData;
|
|
106
|
+
$[46] = t18;
|
|
107
|
+
} else {
|
|
108
|
+
t18 = $[46];
|
|
109
|
+
}
|
|
110
|
+
const rawXAxisData = t18;
|
|
111
|
+
let t19;
|
|
112
|
+
if ($[47] !== rawXAxisData || $[48] !== useUtc || $[49] !== xAxisFormat) {
|
|
113
|
+
t19 = formatTimeData(rawXAxisData, useUtc, xAxisFormat);
|
|
114
|
+
$[47] = rawXAxisData;
|
|
115
|
+
$[48] = useUtc;
|
|
116
|
+
$[49] = xAxisFormat;
|
|
117
|
+
$[50] = t19;
|
|
118
|
+
} else {
|
|
119
|
+
t19 = $[50];
|
|
120
|
+
}
|
|
121
|
+
formattedXAxisData = t19;
|
|
122
|
+
const t20 = !hasData;
|
|
123
|
+
let t21;
|
|
124
|
+
if ($[51] !== rawXAxisData.length || $[52] !== t20 || $[53] !== xAxisInterval) {
|
|
125
|
+
t21 = calculateInterval(xAxisInterval, t20, rawXAxisData.length);
|
|
126
|
+
$[51] = rawXAxisData.length;
|
|
127
|
+
$[52] = t20;
|
|
128
|
+
$[53] = xAxisInterval;
|
|
129
|
+
$[54] = t21;
|
|
130
|
+
} else {
|
|
131
|
+
t21 = $[54];
|
|
132
|
+
}
|
|
133
|
+
interval = t21;
|
|
134
|
+
const finalGridOption = {
|
|
135
|
+
left: gridOption?.left ?? DEFAULT_GRID_OPTION.left,
|
|
136
|
+
top: gridOption?.top ?? DEFAULT_GRID_OPTION.top,
|
|
137
|
+
bottom: gridOption?.bottom ?? DEFAULT_GRID_OPTION.bottom,
|
|
138
|
+
right: gridOption?.right ?? DEFAULT_GRID_OPTION.right
|
|
139
|
+
};
|
|
140
|
+
series = [...barSeries.flatMap(_temp), ...lineSeries.flatMap(_temp2)];
|
|
141
|
+
const legendData = _legendData && _legendData.length > 0 ? _legendData : [...lineSeries, ...barSeries].map(_temp3);
|
|
142
|
+
const barAxisValues = barSeries.flatMap(_temp4).filter(_temp5);
|
|
143
|
+
const lineAxisValues = lineSeries.flatMap(_temp6).filter(_temp7);
|
|
144
|
+
const barAxisMaxAbs = barAxisValues.length > 0 ? Math.max(...barAxisValues.map(_temp8)) : 1500;
|
|
145
|
+
const lineAxisMaxAbs = lineAxisValues.length > 0 ? Math.max(...lineAxisValues.map(_temp9)) : 600;
|
|
146
|
+
const barAxisMax = barAxisMaxAbs * 1.1;
|
|
147
|
+
const lineAxisMax = lineAxisMaxAbs * 1.1;
|
|
148
|
+
barAxisInterval = Math.ceil(barAxisMax / 5 / 100) * 100;
|
|
149
|
+
lineAxisInterval = Math.ceil(lineAxisMax / 5 / 50) * 50;
|
|
150
|
+
alignedBarAxisMax = Math.ceil(barAxisMax / barAxisInterval) * barAxisInterval;
|
|
151
|
+
alignedLineAxisMax = Math.ceil(lineAxisMax / lineAxisInterval) * lineAxisInterval;
|
|
152
|
+
T1 = Card;
|
|
153
|
+
t15 = styles.barLineChart;
|
|
154
|
+
let t22;
|
|
155
|
+
if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
|
|
156
|
+
t16 = {
|
|
157
|
+
body: {
|
|
158
|
+
height: "100%",
|
|
159
|
+
width: "100%",
|
|
160
|
+
padding: 0,
|
|
161
|
+
minHeight: 200,
|
|
162
|
+
display: "flex",
|
|
163
|
+
flexDirection: "column"
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
t22 = {
|
|
167
|
+
fontSize: "1.1rem"
|
|
168
|
+
};
|
|
169
|
+
$[55] = t16;
|
|
170
|
+
$[56] = t22;
|
|
171
|
+
} else {
|
|
172
|
+
t16 = $[55];
|
|
173
|
+
t22 = $[56];
|
|
174
|
+
}
|
|
175
|
+
if ($[57] !== title) {
|
|
176
|
+
t17 = /*#__PURE__*/_jsx("div", {
|
|
177
|
+
style: t22,
|
|
178
|
+
children: title
|
|
179
|
+
});
|
|
180
|
+
$[57] = title;
|
|
181
|
+
$[58] = t17;
|
|
182
|
+
} else {
|
|
183
|
+
t17 = $[58];
|
|
184
|
+
}
|
|
185
|
+
T0 = HighlightSyncedECharts;
|
|
186
|
+
t13 = chartClassName ?? styles.barLineChartContainer;
|
|
187
|
+
if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
|
|
188
|
+
t14 = {
|
|
189
|
+
height: "100%",
|
|
190
|
+
width: "100%"
|
|
191
|
+
};
|
|
192
|
+
$[59] = t14;
|
|
193
|
+
} else {
|
|
194
|
+
t14 = $[59];
|
|
195
|
+
}
|
|
196
|
+
t12 = echarts.buildEChartsOption({}, echarts.grid({
|
|
197
|
+
option: finalGridOption
|
|
198
|
+
}), echarts.legend({
|
|
199
|
+
data: legendData,
|
|
200
|
+
option: legendOption
|
|
201
|
+
}), echarts.tooltip({
|
|
202
|
+
backgroundColor: "rgba(255,255,255,0.95)",
|
|
203
|
+
borderColor: COLOR_CHART_AXIS
|
|
204
|
+
}));
|
|
205
|
+
$[0] = _legendData;
|
|
206
|
+
$[1] = chartClassName;
|
|
207
|
+
$[2] = gridOption?.bottom;
|
|
208
|
+
$[3] = gridOption?.left;
|
|
209
|
+
$[4] = gridOption?.right;
|
|
210
|
+
$[5] = gridOption?.top;
|
|
211
|
+
$[6] = legendOption;
|
|
212
|
+
$[7] = t10;
|
|
213
|
+
$[8] = t11;
|
|
214
|
+
$[9] = t3;
|
|
215
|
+
$[10] = t4;
|
|
216
|
+
$[11] = t5;
|
|
217
|
+
$[12] = t6;
|
|
218
|
+
$[13] = t7;
|
|
219
|
+
$[14] = t8;
|
|
220
|
+
$[15] = t9;
|
|
221
|
+
$[16] = title;
|
|
222
|
+
$[17] = useUtc;
|
|
223
|
+
$[18] = xAxisData;
|
|
224
|
+
$[19] = xAxisFormat;
|
|
225
|
+
$[20] = xAxisInterval;
|
|
226
|
+
$[21] = T0;
|
|
227
|
+
$[22] = T1;
|
|
228
|
+
$[23] = alignedBarAxisMax;
|
|
229
|
+
$[24] = alignedLineAxisMax;
|
|
230
|
+
$[25] = barAxisInterval;
|
|
231
|
+
$[26] = barYAxisName;
|
|
232
|
+
$[27] = barYAxisNameGap;
|
|
233
|
+
$[28] = barYAxisNameLocation;
|
|
234
|
+
$[29] = formattedXAxisData;
|
|
235
|
+
$[30] = interval;
|
|
236
|
+
$[31] = lineAxisInterval;
|
|
237
|
+
$[32] = lineYAxisName;
|
|
238
|
+
$[33] = lineYAxisNameGap;
|
|
239
|
+
$[34] = lineYAxisNameLocation;
|
|
240
|
+
$[35] = series;
|
|
241
|
+
$[36] = showTitle;
|
|
242
|
+
$[37] = t12;
|
|
243
|
+
$[38] = t13;
|
|
244
|
+
$[39] = t14;
|
|
245
|
+
$[40] = t15;
|
|
246
|
+
$[41] = t16;
|
|
247
|
+
$[42] = t17;
|
|
248
|
+
} else {
|
|
249
|
+
T0 = $[21];
|
|
250
|
+
T1 = $[22];
|
|
251
|
+
alignedBarAxisMax = $[23];
|
|
252
|
+
alignedLineAxisMax = $[24];
|
|
253
|
+
barAxisInterval = $[25];
|
|
254
|
+
barYAxisName = $[26];
|
|
255
|
+
barYAxisNameGap = $[27];
|
|
256
|
+
barYAxisNameLocation = $[28];
|
|
257
|
+
formattedXAxisData = $[29];
|
|
258
|
+
interval = $[30];
|
|
259
|
+
lineAxisInterval = $[31];
|
|
260
|
+
lineYAxisName = $[32];
|
|
261
|
+
lineYAxisNameGap = $[33];
|
|
262
|
+
lineYAxisNameLocation = $[34];
|
|
263
|
+
series = $[35];
|
|
264
|
+
showTitle = $[36];
|
|
265
|
+
t12 = $[37];
|
|
266
|
+
t13 = $[38];
|
|
267
|
+
t14 = $[39];
|
|
268
|
+
t15 = $[40];
|
|
269
|
+
t16 = $[41];
|
|
270
|
+
t17 = $[42];
|
|
271
|
+
}
|
|
272
|
+
let t18;
|
|
273
|
+
if ($[60] !== interval) {
|
|
274
|
+
t18 = {
|
|
275
|
+
interval,
|
|
276
|
+
color: AXIS_COLOR,
|
|
277
|
+
fontSize: AXIS_FONT_SIZE
|
|
278
|
+
};
|
|
279
|
+
$[60] = interval;
|
|
280
|
+
$[61] = t18;
|
|
281
|
+
} else {
|
|
282
|
+
t18 = $[61];
|
|
283
|
+
}
|
|
284
|
+
let t19;
|
|
285
|
+
if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
|
|
286
|
+
t19 = {
|
|
287
|
+
lineStyle: {
|
|
288
|
+
color: AXIS_COLOR
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
$[62] = t19;
|
|
292
|
+
} else {
|
|
293
|
+
t19 = $[62];
|
|
294
|
+
}
|
|
295
|
+
let t20;
|
|
296
|
+
if ($[63] !== formattedXAxisData || $[64] !== t18) {
|
|
297
|
+
t20 = {
|
|
298
|
+
type: "category",
|
|
299
|
+
data: formattedXAxisData,
|
|
300
|
+
boundaryGap: true,
|
|
301
|
+
axisLabel: t18,
|
|
302
|
+
axisLine: t19,
|
|
303
|
+
alignTicks: true
|
|
304
|
+
};
|
|
305
|
+
$[63] = formattedXAxisData;
|
|
306
|
+
$[64] = t18;
|
|
307
|
+
$[65] = t20;
|
|
308
|
+
} else {
|
|
309
|
+
t20 = $[65];
|
|
310
|
+
}
|
|
311
|
+
let t21;
|
|
312
|
+
if ($[66] !== barYAxisNamePadding) {
|
|
313
|
+
t21 = barYAxisNamePadding && {
|
|
314
|
+
padding: barYAxisNamePadding
|
|
315
|
+
};
|
|
316
|
+
$[66] = barYAxisNamePadding;
|
|
317
|
+
$[67] = t21;
|
|
318
|
+
} else {
|
|
319
|
+
t21 = $[67];
|
|
320
|
+
}
|
|
321
|
+
let t22;
|
|
322
|
+
if ($[68] !== t21) {
|
|
323
|
+
t22 = {
|
|
324
|
+
color: COLOR_CHART_AXIS,
|
|
325
|
+
...t21
|
|
326
|
+
};
|
|
327
|
+
$[68] = t21;
|
|
328
|
+
$[69] = t22;
|
|
329
|
+
} else {
|
|
330
|
+
t22 = $[69];
|
|
331
|
+
}
|
|
332
|
+
let t23;
|
|
333
|
+
if ($[70] === Symbol.for("react.memo_cache_sentinel")) {
|
|
334
|
+
t23 = {
|
|
335
|
+
color: AXIS_COLOR,
|
|
336
|
+
fontSize: AXIS_FONT_SIZE
|
|
337
|
+
};
|
|
338
|
+
$[70] = t23;
|
|
339
|
+
} else {
|
|
340
|
+
t23 = $[70];
|
|
341
|
+
}
|
|
342
|
+
let t24;
|
|
343
|
+
if ($[71] === Symbol.for("react.memo_cache_sentinel")) {
|
|
344
|
+
t24 = {
|
|
345
|
+
show: false,
|
|
346
|
+
lineStyle: {
|
|
347
|
+
color: AXIS_COLOR
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
$[71] = t24;
|
|
351
|
+
} else {
|
|
352
|
+
t24 = $[71];
|
|
353
|
+
}
|
|
354
|
+
const t25 = -alignedBarAxisMax;
|
|
355
|
+
let t26;
|
|
356
|
+
if ($[72] === Symbol.for("react.memo_cache_sentinel")) {
|
|
357
|
+
t26 = {
|
|
358
|
+
show: true
|
|
359
|
+
};
|
|
360
|
+
$[72] = t26;
|
|
361
|
+
} else {
|
|
362
|
+
t26 = $[72];
|
|
363
|
+
}
|
|
364
|
+
let t27;
|
|
365
|
+
if ($[73] !== alignedBarAxisMax || $[74] !== barAxisInterval || $[75] !== barYAxisName || $[76] !== barYAxisNameGap || $[77] !== barYAxisNameLocation || $[78] !== t22 || $[79] !== t25) {
|
|
366
|
+
t27 = {
|
|
367
|
+
type: "value",
|
|
368
|
+
name: barYAxisName,
|
|
369
|
+
nameLocation: barYAxisNameLocation,
|
|
370
|
+
nameGap: barYAxisNameGap,
|
|
371
|
+
nameTextStyle: t22,
|
|
372
|
+
axisLabel: t23,
|
|
373
|
+
axisLine: t24,
|
|
374
|
+
position: "left",
|
|
375
|
+
alignTicks: true,
|
|
376
|
+
min: t25,
|
|
377
|
+
max: alignedBarAxisMax,
|
|
378
|
+
interval: barAxisInterval,
|
|
379
|
+
splitLine: t26
|
|
380
|
+
};
|
|
381
|
+
$[73] = alignedBarAxisMax;
|
|
382
|
+
$[74] = barAxisInterval;
|
|
383
|
+
$[75] = barYAxisName;
|
|
384
|
+
$[76] = barYAxisNameGap;
|
|
385
|
+
$[77] = barYAxisNameLocation;
|
|
386
|
+
$[78] = t22;
|
|
387
|
+
$[79] = t25;
|
|
388
|
+
$[80] = t27;
|
|
389
|
+
} else {
|
|
390
|
+
t27 = $[80];
|
|
391
|
+
}
|
|
392
|
+
let t28;
|
|
393
|
+
if ($[81] !== lineYAxisNamePadding) {
|
|
394
|
+
t28 = lineYAxisNamePadding && {
|
|
395
|
+
padding: lineYAxisNamePadding
|
|
396
|
+
};
|
|
397
|
+
$[81] = lineYAxisNamePadding;
|
|
398
|
+
$[82] = t28;
|
|
399
|
+
} else {
|
|
400
|
+
t28 = $[82];
|
|
401
|
+
}
|
|
402
|
+
let t29;
|
|
403
|
+
if ($[83] !== t28) {
|
|
404
|
+
t29 = {
|
|
405
|
+
color: COLOR_CHART_AXIS,
|
|
406
|
+
...t28
|
|
407
|
+
};
|
|
408
|
+
$[83] = t28;
|
|
409
|
+
$[84] = t29;
|
|
410
|
+
} else {
|
|
411
|
+
t29 = $[84];
|
|
412
|
+
}
|
|
413
|
+
let t30;
|
|
414
|
+
if ($[85] === Symbol.for("react.memo_cache_sentinel")) {
|
|
415
|
+
t30 = {
|
|
416
|
+
color: AXIS_COLOR,
|
|
417
|
+
fontSize: AXIS_FONT_SIZE
|
|
418
|
+
};
|
|
419
|
+
$[85] = t30;
|
|
420
|
+
} else {
|
|
421
|
+
t30 = $[85];
|
|
422
|
+
}
|
|
423
|
+
let t31;
|
|
424
|
+
if ($[86] === Symbol.for("react.memo_cache_sentinel")) {
|
|
425
|
+
t31 = {
|
|
426
|
+
show: false,
|
|
427
|
+
lineStyle: {
|
|
428
|
+
color: AXIS_COLOR
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
$[86] = t31;
|
|
432
|
+
} else {
|
|
433
|
+
t31 = $[86];
|
|
434
|
+
}
|
|
435
|
+
const t32 = -alignedLineAxisMax;
|
|
436
|
+
let t33;
|
|
437
|
+
if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
|
|
438
|
+
t33 = {
|
|
439
|
+
show: true
|
|
440
|
+
};
|
|
441
|
+
$[87] = t33;
|
|
442
|
+
} else {
|
|
443
|
+
t33 = $[87];
|
|
444
|
+
}
|
|
445
|
+
let t34;
|
|
446
|
+
if ($[88] !== alignedLineAxisMax || $[89] !== lineAxisInterval || $[90] !== lineYAxisName || $[91] !== lineYAxisNameGap || $[92] !== lineYAxisNameLocation || $[93] !== t29 || $[94] !== t32) {
|
|
447
|
+
t34 = {
|
|
448
|
+
type: "value",
|
|
449
|
+
name: lineYAxisName,
|
|
450
|
+
nameLocation: lineYAxisNameLocation,
|
|
451
|
+
nameGap: lineYAxisNameGap,
|
|
452
|
+
nameTextStyle: t29,
|
|
453
|
+
axisLabel: t30,
|
|
454
|
+
axisLine: t31,
|
|
455
|
+
position: "right",
|
|
456
|
+
alignTicks: true,
|
|
457
|
+
min: t32,
|
|
458
|
+
max: alignedLineAxisMax,
|
|
459
|
+
interval: lineAxisInterval,
|
|
460
|
+
splitLine: t33,
|
|
461
|
+
smooth: false
|
|
462
|
+
};
|
|
463
|
+
$[88] = alignedLineAxisMax;
|
|
464
|
+
$[89] = lineAxisInterval;
|
|
465
|
+
$[90] = lineYAxisName;
|
|
466
|
+
$[91] = lineYAxisNameGap;
|
|
467
|
+
$[92] = lineYAxisNameLocation;
|
|
468
|
+
$[93] = t29;
|
|
469
|
+
$[94] = t32;
|
|
470
|
+
$[95] = t34;
|
|
471
|
+
} else {
|
|
472
|
+
t34 = $[95];
|
|
473
|
+
}
|
|
474
|
+
let t35;
|
|
475
|
+
if ($[96] !== t27 || $[97] !== t34) {
|
|
476
|
+
t35 = [t27, t34];
|
|
477
|
+
$[96] = t27;
|
|
478
|
+
$[97] = t34;
|
|
479
|
+
$[98] = t35;
|
|
480
|
+
} else {
|
|
481
|
+
t35 = $[98];
|
|
482
|
+
}
|
|
483
|
+
let t36;
|
|
484
|
+
if ($[99] !== showTitle || $[100] !== title) {
|
|
485
|
+
t36 = showTitle && {
|
|
486
|
+
title: {
|
|
487
|
+
text: title,
|
|
488
|
+
left: "center",
|
|
489
|
+
top: 10
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
$[99] = showTitle;
|
|
493
|
+
$[100] = title;
|
|
494
|
+
$[101] = t36;
|
|
495
|
+
} else {
|
|
496
|
+
t36 = $[101];
|
|
497
|
+
}
|
|
498
|
+
let t37;
|
|
499
|
+
if ($[102] !== series || $[103] !== t12 || $[104] !== t20 || $[105] !== t35 || $[106] !== t36) {
|
|
500
|
+
t37 = {
|
|
501
|
+
...t12,
|
|
502
|
+
xAxis: t20,
|
|
503
|
+
yAxis: t35,
|
|
504
|
+
series,
|
|
505
|
+
...t36
|
|
506
|
+
};
|
|
507
|
+
$[102] = series;
|
|
508
|
+
$[103] = t12;
|
|
509
|
+
$[104] = t20;
|
|
510
|
+
$[105] = t35;
|
|
511
|
+
$[106] = t36;
|
|
512
|
+
$[107] = t37;
|
|
513
|
+
} else {
|
|
514
|
+
t37 = $[107];
|
|
515
|
+
}
|
|
516
|
+
let t38;
|
|
517
|
+
if ($[108] !== T0 || $[109] !== t13 || $[110] !== t14 || $[111] !== t37) {
|
|
518
|
+
t38 = /*#__PURE__*/_jsx(T0, {
|
|
519
|
+
className: t13,
|
|
520
|
+
style: t14,
|
|
521
|
+
option: t37
|
|
522
|
+
});
|
|
523
|
+
$[108] = T0;
|
|
524
|
+
$[109] = t13;
|
|
525
|
+
$[110] = t14;
|
|
526
|
+
$[111] = t37;
|
|
527
|
+
$[112] = t38;
|
|
528
|
+
} else {
|
|
529
|
+
t38 = $[112];
|
|
530
|
+
}
|
|
531
|
+
let t39;
|
|
532
|
+
if ($[113] !== T1 || $[114] !== t15 || $[115] !== t16 || $[116] !== t17 || $[117] !== t38) {
|
|
533
|
+
t39 = /*#__PURE__*/_jsxs(T1, {
|
|
534
|
+
className: t15,
|
|
535
|
+
styles: t16,
|
|
536
|
+
children: [t17, t38]
|
|
537
|
+
});
|
|
538
|
+
$[113] = T1;
|
|
539
|
+
$[114] = t15;
|
|
540
|
+
$[115] = t16;
|
|
541
|
+
$[116] = t17;
|
|
542
|
+
$[117] = t38;
|
|
543
|
+
$[118] = t39;
|
|
544
|
+
} else {
|
|
545
|
+
t39 = $[118];
|
|
546
|
+
}
|
|
547
|
+
return t39;
|
|
548
|
+
};
|
|
549
|
+
export default BarLineChart;
|
|
550
|
+
function _temp(s) {
|
|
551
|
+
return echarts.barSeries({
|
|
552
|
+
name: s.name,
|
|
553
|
+
data: s.data,
|
|
554
|
+
option: {
|
|
555
|
+
...s.option,
|
|
556
|
+
yAxisIndex: 0
|
|
557
|
+
}
|
|
558
|
+
}).series ?? [];
|
|
559
|
+
}
|
|
560
|
+
function _temp2(s_0) {
|
|
561
|
+
return echarts.lineSeries({
|
|
562
|
+
name: s_0.name,
|
|
563
|
+
data: s_0.data,
|
|
564
|
+
option: {
|
|
565
|
+
...s_0.option,
|
|
566
|
+
yAxisIndex: 1
|
|
567
|
+
}
|
|
568
|
+
}).series ?? [];
|
|
569
|
+
}
|
|
570
|
+
function _temp3(s_1) {
|
|
571
|
+
return s_1.name;
|
|
572
|
+
}
|
|
573
|
+
function _temp4(s_2) {
|
|
574
|
+
return s_2.data;
|
|
575
|
+
}
|
|
576
|
+
function _temp5(value) {
|
|
577
|
+
return typeof value === "number";
|
|
578
|
+
}
|
|
579
|
+
function _temp6(s_3) {
|
|
580
|
+
return s_3.data;
|
|
581
|
+
}
|
|
582
|
+
function _temp7(value_0) {
|
|
583
|
+
return typeof value_0 === "number";
|
|
584
|
+
}
|
|
585
|
+
function _temp8(v) {
|
|
586
|
+
return Math.abs(v);
|
|
587
|
+
}
|
|
588
|
+
function _temp9(v_0) {
|
|
589
|
+
return Math.abs(v_0);
|
|
590
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface BarSeriesConfig {
|
|
2
|
+
name: string;
|
|
3
|
+
/** Bar values per category. Use `null` to create gaps (no bar rendered). */
|
|
4
|
+
data: Array<number | null>;
|
|
5
|
+
/** Single color for all bars, or omit when using per-point styling (e.g. itemStyle in option). */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** ECharts series option (e.g. barWidth, itemStyle, tooltip). */
|
|
8
|
+
option?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface BaseBarChartProps {
|
|
11
|
+
/** Chart title shown above the chart. */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** X-axis category labels (e.g. time "00:00", "02:00", ...). */
|
|
14
|
+
categories: string[];
|
|
15
|
+
/** Bar series: each has name, data array, optional color and option. */
|
|
16
|
+
series: BarSeriesConfig[];
|
|
17
|
+
/** Y-axis label (e.g. "收益(元)"). */
|
|
18
|
+
yAxisName?: string;
|
|
19
|
+
/** Grid insets. */
|
|
20
|
+
gridOption?: {
|
|
21
|
+
left?: string | number;
|
|
22
|
+
top?: string | number;
|
|
23
|
+
bottom?: string | number;
|
|
24
|
+
right?: string | number;
|
|
25
|
+
};
|
|
26
|
+
/** Tooltip value formatter (e.g. value => `¥${value.toFixed(2)}`). */
|
|
27
|
+
tooltipValueFormatter?: (value: number) => string;
|
|
28
|
+
/** Show legend with series names. */
|
|
29
|
+
showLegend?: boolean;
|
|
30
|
+
/** Show y-axis split lines (grid). Default false. */
|
|
31
|
+
showSplitLine?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export default function BaseBarChart({ title, categories, series, yAxisName, gridOption, tooltipValueFormatter, showLegend, showSplitLine, }: BaseBarChartProps): import("react/jsx-runtime").JSX.Element;
|