From 6fb1dd105cb7672c9d5df7b7f346031357417cf0 Mon Sep 17 00:00:00 2001 From: goettlic Date: Tue, 10 Feb 2026 11:08:42 +0000 Subject: [PATCH] add option connect gaps for scatterlines --- DataPlotly/core/plot_types/scatter.py | 1 + DataPlotly/gui/plot_settings_widget.py | 8 +- DataPlotly/ui/dataplotly_dockwidget_base.ui | 447 ++++++++++---------- 3 files changed, 238 insertions(+), 218 deletions(-) diff --git a/DataPlotly/core/plot_types/scatter.py b/DataPlotly/core/plot_types/scatter.py index b6034d11..3c1815e2 100644 --- a/DataPlotly/core/plot_types/scatter.py +++ b/DataPlotly/core/plot_types/scatter.py @@ -62,6 +62,7 @@ def create_trace(settings): }, line={'width': settings.properties['marker_width'], 'dash': settings.properties['line_dash']}, + connectgaps=settings.properties['connect_gaps'], opacity=settings.properties['opacity'] )] diff --git a/DataPlotly/gui/plot_settings_widget.py b/DataPlotly/gui/plot_settings_widget.py index 675afdca..43b1193c 100644 --- a/DataPlotly/gui/plot_settings_widget.py +++ b/DataPlotly/gui/plot_settings_widget.py @@ -924,6 +924,7 @@ def refreshWidgets(self): # pylint: disable=too-many-statements,too-many-branch self.contour_type_label: ['contour'], self.contour_type_combo: ['contour'], self.show_lines_check: ['contour'], + self.scatterline_gaps_check:['scatter'], # layout customization self.show_legend_check: ['all'], self.orientation_legend_check: ['scatter', 'bar', 'box', 'histogram', 'ternary', 'pie', 'violin'], @@ -1064,6 +1065,7 @@ def refreshWidgets3(self): self.line_lab.setVisible(False) self.line_combo.setEnabled(False) self.line_combo.setVisible(False) + self.scatterline_gaps_check.setEnabled(False) elif self.marker_type_combo.currentText() == self.tr('Lines'): self.point_lab.setEnabled(False) self.point_lab.setVisible(False) @@ -1073,6 +1075,7 @@ def refreshWidgets3(self): self.line_lab.setVisible(True) self.line_combo.setEnabled(True) self.line_combo.setVisible(True) + self.scatterline_gaps_check.setEnabled(True) else: self.point_lab.setEnabled(True) self.point_lab.setVisible(True) @@ -1082,6 +1085,7 @@ def refreshWidgets3(self): self.line_lab.setVisible(True) self.line_combo.setEnabled(True) self.line_combo.setVisible(True) + self.scatterline_gaps_check.setEnabled(True) def setLegend(self): """ @@ -1157,7 +1161,8 @@ def get_settings(self) -> PlotSettings: # pylint: disable=R0915 'line_dash_threshold': self.line_types2[self.line_combo_threshold.currentText()], 'line_combo_threshold': self.line_combo_threshold.currentText(), 'threshold_value': self.threshold_value.value(), - 'y_fields_combo': ', '.join(self.y_fields_combo.checkedItems()) + 'y_fields_combo': ', '.join(self.y_fields_combo.checkedItems()), + 'connect_gaps': self.scatterline_gaps_check.isChecked() } if self.in_color_defined_button.isActive(): @@ -1406,6 +1411,7 @@ def set_settings(self, settings: PlotSettings): # pylint: disable=too-many-stat self.threshold.setChecked(settings.properties.get('threshold', True)) self.threshold_value.setValue(settings.properties.get('threshold_value', 1)) self.fill.setChecked(settings.properties.get('fill', False)) + self.scatterline_gaps_check.setChecked(settings.properties.get('connect_gaps',False)) def create_plot_factory(self) -> PlotFactory: """ diff --git a/DataPlotly/ui/dataplotly_dockwidget_base.ui b/DataPlotly/ui/dataplotly_dockwidget_base.ui index 585101ee..5fee0c78 100644 --- a/DataPlotly/ui/dataplotly_dockwidget_base.ui +++ b/DataPlotly/ui/dataplotly_dockwidget_base.ui @@ -320,9 +320,9 @@ QListWidget::item::selected { 0 - 0 + -479 673 - 1200 + 1194 @@ -509,207 +509,213 @@ QListWidget::item::selected { Properties - - + + - ... + Line type - - - - Legend title - - + + - - + + - Show statistics + Hover tooltip - - + + + + + - + - + - Visible + Show lines true + + + + + + + + + Stroke width + + + + + - + + + true + - Invert color + Invert histogram direction + + + + + + + true + + + Cumulative histogram - - - - - + + - Marker color + Opacity - - + + - Stroke color + Color scale - - + + ... - - + + - - + + - - + + - Hover tooltip + Hover label as text - - + + + + + - Contour type + Pie hole - - - - - - - - - Show lines - - - true - - - - - - - - - - - - ... + + + + false + + + 1000 + + + 10 - - + + + + + - Label text position + Marker color - - + + - Threshold - - - true + Legend title - - - - - + + - Marker size + Violin side - - - - - - - - 0 - 0 - + + + + 99990000.000000000000000 + + + 1.000000000000000 - - + + - Bar orientation + Show statistics - - + + - Violin side + Contour type - - + + + + + - Opacity + Show mean line + + + true - - - - - + + - Threshold line type + Fill - - - - Qt::StrongFocus + + + + ... - - - - - + + - Line type + Label text position @@ -720,39 +726,27 @@ QListWidget::item::selected { - - - - - + + - - + + - Manual bin size + Stroke color - - - - - + + - Pie hole + Point type - - - - false - - - 1000 - - - 10 + + + + ... @@ -766,31 +760,54 @@ QListWidget::item::selected { - - - - Fill - - + + - - + + + + + + + + + Visible + + + true + + + + + + + Invert color + + + + + + + - Outliers + ... - - + + + + + - Stroke width + Manual bin size - - + + - ... + Marker size @@ -817,29 +834,22 @@ QListWidget::item::selected { - - + + - ... + Outliers - - - - - + + - Hover label as text + Threshold value - - - - Point type - - + + @@ -854,33 +864,6 @@ QListWidget::item::selected { - - - - - - true - - - Invert histogram direction - - - - - - - true - - - Cumulative histogram - - - - - - - - @@ -888,43 +871,73 @@ QListWidget::item::selected { - - + + - Show mean line + Threshold line type + + + + + + + Bar orientation + + + + + + + Threshold true - - - - Color scale + + + + + 0 + 0 + - - + + - - - - 99990000.000000000000000 + + + + ... - - 1.000000000000000 + + + + + + Qt::StrongFocus - - + + + + + + + true + - Threshold value + Connect gaps + + + false @@ -970,8 +983,8 @@ QListWidget::item::selected { 0 0 - 449 - 820 + 406 + 803