fix: теперь график-навигатор имеет ограничения по перемещению ROI
This commit is contained in:
parent
eaec12d3ff
commit
2e66a77ced
Binary file not shown.
@ -256,7 +256,9 @@ class BasePlotWidget:
|
|||||||
navigator.plot(x_downsampled, y_downsampled, pen=signal["pen"], name=signal["name"])
|
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 = 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.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))
|
ROI_region.sigRegionChanged.connect(lambda: self._sync_main_plot_with_navigator(main_plot, ROI_region))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user