fix: detect only upward peaks (zScore > 5), min 15min zoom padding
CI/CD / build-and-push (push) Successful in 1m28s Details

- Changed Math.abs(zScore) > threshold to zScore > threshold
  so only upward spikes are detected (not dips below average)
- Zoom padding minimum 15 minutes on each side for short peak intervals

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cloud User 2026-03-17 14:25:46 +09:00
parent 282644dda5
commit 7a228a4123
3 changed files with 5 additions and 3 deletions

View File

@ -31,7 +31,8 @@ export default forwardRef<NetworkChartHandle, NetworkChartProps>(function Networ
const maxTime = Math.max(...allTimes);
const range = maxTime - minTime;
if (range === 0) return;
const padding = (endMs - startMs) * 0.5;
const MIN_PADDING = 15 * 60 * 1000; // 15분
const padding = Math.max(MIN_PADDING, (endMs - startMs) * 0.5);
const s = Math.max(0, ((startMs - padding - minTime) / range) * 100);
const e = Math.min(100, ((endMs + padding - minTime) / range) * 100);
chart.dispatchAction({ type: 'dataZoom', start: s, end: e });

View File

@ -37,7 +37,8 @@ export default forwardRef<ChartHandle, TimeSeriesChartProps>(function TimeSeries
const maxTime = Math.max(...allTimes);
const range = maxTime - minTime;
if (range === 0) return;
const padding = (endMs - startMs) * 0.5;
const MIN_PADDING = 15 * 60 * 1000; // 15분
const padding = Math.max(MIN_PADDING, (endMs - startMs) * 0.5);
const s = Math.max(0, ((startMs - padding - minTime) / range) * 100);
const e = Math.min(100, ((endMs + padding - minTime) / range) * 100);
chart.dispatchAction({ type: 'dataZoom', start: s, end: e });

View File

@ -43,7 +43,7 @@ export function detectPeaks(
const points = dataPoints.map((d) => {
const zScore = stddev === 0 ? 0 : (d.value - mean) / stddev;
return { ...d, zScore, isPeak: Math.abs(zScore) > threshold };
return { ...d, zScore, isPeak: zScore > threshold };
});
const peaks: PeakInfo[] = [];