BUR-64 синхронизировал изменение input date/time полей с масштабированием графика.

This commit is contained in:
Первов Артем
2026-07-05 13:46:51 +03:00
parent 4e3cc0eb33
commit 8bb19f3f9d
2 changed files with 13 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ type HistoryChartProps = {
tickIntervalMs?: number;
to: string;
tagLabels?: Record<string, string>;
onZoomRangeChange?: (range: HistoryZoomRange) => void;
};
const ZOOM_REQUEST_DELAY_MS = 350;
@@ -95,6 +96,7 @@ export function HistoryChart({
tickIntervalMs,
to,
tagLabels = {},
onZoomRangeChange,
}: HistoryChartProps) {
const [zoomRange, setZoomRange] = useState(() =>
createInitialZoomRange({ from, granulate, labelFormat, tickIntervalMs, to }),
@@ -167,8 +169,9 @@ export function HistoryChart({
zoomTimerRef.current = setTimeout(() => {
zoomRangeRef.current = nextRange;
setZoomRange(nextRange);
onZoomRangeChange?.(nextRange);
}, ZOOM_REQUEST_DELAY_MS);
}, []);
}, [onZoomRangeChange]);
return (
<HistoryChartArea