Skip to content

Commit 5a61f9e

Browse files
committed
Remove chart visibility toggles
1 parent 93ccf00 commit 5a61f9e

File tree

2 files changed

+3
-49
lines changed

2 files changed

+3
-49
lines changed

src/App.jsx

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ function App() {
3131
const [compareMode, setCompareMode] = useState('normal');
3232
const [relativeBaseline, setRelativeBaseline] = useState(0.002);
3333
const [absoluteBaseline, setAbsoluteBaseline] = useState(0.005);
34-
const [showLoss, setShowLoss] = useState(true);
35-
const [showGradNorm, setShowGradNorm] = useState(false);
3634
const [configModalOpen, setConfigModalOpen] = useState(false);
3735
const [configFile, setConfigFile] = useState(null);
3836
const [globalDragOver, setGlobalDragOver] = useState(false);
@@ -319,41 +317,7 @@ function App() {
319317
<div className="space-y-3">
320318
<div>
321319
<h4 className="text-xs font-medium text-gray-700 mb-2">📊 图表显示</h4>
322-
<div className="space-y-2">
323-
<label className="flex items-center cursor-pointer hover:bg-gray-50 p-1 rounded">
324-
<input
325-
type="checkbox"
326-
checked={showLoss}
327-
onChange={(e) => setShowLoss(e.target.checked)}
328-
className="rounded border-gray-300 text-blue-600 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
329-
aria-describedby="show-loss-description"
330-
/>
331-
<span className="ml-2 text-xs text-gray-700">📉 显示 Loss 函数</span>
332-
<span
333-
id="show-loss-description"
334-
className="sr-only"
335-
>
336-
控制是否显示损失函数图表
337-
</span>
338-
</label>
339-
340-
<label className="flex items-center cursor-pointer hover:bg-gray-50 p-1 rounded">
341-
<input
342-
type="checkbox"
343-
checked={showGradNorm}
344-
onChange={(e) => setShowGradNorm(e.target.checked)}
345-
className="rounded border-gray-300 text-blue-600 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
346-
aria-describedby="show-gradnorm-description"
347-
/>
348-
<span className="ml-2 text-xs text-gray-700">📈 显示 Grad Norm</span>
349-
<span
350-
id="show-gradnorm-description"
351-
className="sr-only"
352-
>
353-
控制是否显示梯度范数图表
354-
</span>
355-
</label>
356-
</div>
320+
<p className="text-xs text-gray-500">上传文件后自动展示所有已配置的指标图表</p>
357321
</div>
358322

359323
<div className="border-t pt-3">
@@ -425,8 +389,6 @@ function App() {
425389
compareMode={compareMode}
426390
relativeBaseline={relativeBaseline}
427391
absoluteBaseline={absoluteBaseline}
428-
showLoss={showLoss}
429-
showGradNorm={showGradNorm}
430392
xRange={xRange}
431393
onXRangeChange={setXRange}
432394
onMaxStepChange={setMaxStep}

src/components/ChartContainer.jsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ export default function ChartContainer({
6565
compareMode,
6666
relativeBaseline = 0.002,
6767
absoluteBaseline = 0.005,
68-
showLoss = true,
69-
showGradNorm = false,
7068
xRange = { min: undefined, max: undefined },
7169
onXRangeChange,
7270
onMaxStepChange
@@ -402,13 +400,7 @@ export default function ChartContainer({
402400
.map(file => ({ name: file.name, data: file.metricsData[name] }));
403401
});
404402

405-
const metricsToShow = metrics.filter((m, idx) => {
406-
if (idx === 0) return showLoss;
407-
if (idx === 1) return showGradNorm;
408-
return true;
409-
});
410-
411-
if (metricsToShow.length === 0) {
403+
if (metrics.length === 0) {
412404
return (
413405
<div className="bg-white rounded-lg shadow-md p-8">
414406
<div className="text-center text-gray-500">
@@ -420,7 +412,7 @@ export default function ChartContainer({
420412

421413
const stats = [];
422414

423-
const metricElements = metricsToShow.map((metric, idx) => {
415+
const metricElements = metrics.map((metric, idx) => {
424416
const key = metric.name || metric.keyword || `metric${idx + 1}`;
425417
const dataArray = metricDataArrays[key] || [];
426418
const showComparison = dataArray.length === 2;

0 commit comments

Comments
 (0)