fix: теперь график-навигатор имеет ограничения по перемещению ROI

This commit is contained in:
Andrew 2024-12-18 10:13:16 +03:00
parent eaec12d3ff
commit 2e66a77ced
2 changed files with 2 additions and 0 deletions

View File

@ -256,7 +256,9 @@ class BasePlotWidget:
navigator.plot(x_downsampled, y_downsampled, pen=signal["pen"], name=signal["name"])
ROI_region = pg.LinearRegionItem(values=time_region, movable=True, brush=pg.mkBrush(0, 0, 255, 100))
ROI_region.setBounds([0, x.iloc[-1]])
navigator.addItem(ROI_region)
navigator.getPlotItem().getViewBox().setLimits(xMin=0, xMax=x.iloc[-1])
# Связываем изменение региона навигатора с обновлением области просмотра основного графика
ROI_region.sigRegionChanged.connect(lambda: self._sync_main_plot_with_navigator(main_plot, ROI_region))