|
15 | 15 | from Orange.clustering import DBSCAN |
16 | 16 | from Orange.widgets.utils.annotated_data import ANNOTATED_DATA_SIGNAL_NAME |
17 | 17 | from Orange.widgets.utils.signals import Input, Output |
| 18 | +from Orange.widgets.utils.state_summary import format_summary_details |
18 | 19 | from Orange.widgets.widget import Msg |
19 | 20 |
|
20 | 21 |
|
@@ -89,6 +90,8 @@ def __init__(self): |
89 | 90 | self.data_normalized = None |
90 | 91 | self.db = None |
91 | 92 | self.model = None |
| 93 | + self._set_input_summary(None) |
| 94 | + self._set_output_summary(None) |
92 | 95 |
|
93 | 96 | box = gui.widgetBox(self.controlArea, "Parameters") |
94 | 97 | gui.spin(box, self, "min_samples", 1, 100, 1, |
@@ -169,10 +172,12 @@ def _compute_cut_point(self): |
169 | 172 | @Inputs.data |
170 | 173 | def set_data(self, data): |
171 | 174 | self.Error.clear() |
| 175 | + self._set_input_summary(data) |
172 | 176 | if not self.check_data_size(data): |
173 | 177 | data = None |
174 | 178 | self.data = self.data_normalized = data |
175 | 179 | if self.data is None: |
| 180 | + self._set_output_summary(None) |
176 | 181 | self.Outputs.annotated_data.send(None) |
177 | 182 | self.plot.clear_plot() |
178 | 183 | return |
@@ -220,8 +225,19 @@ def send_data(self): |
220 | 225 | domain = Domain(attributes, classes, meta_attrs) |
221 | 226 | new_table = Table(domain, x, y, metas, self.data.W) |
222 | 227 |
|
| 228 | + self._set_output_summary(new_table) |
223 | 229 | self.Outputs.annotated_data.send(new_table) |
224 | 230 |
|
| 231 | + def _set_input_summary(self, data): |
| 232 | + summary = len(data) if data else self.info.NoInput |
| 233 | + details = format_summary_details(data) if data else "" |
| 234 | + self.info.set_input_summary(summary, details) |
| 235 | + |
| 236 | + def _set_output_summary(self, output): |
| 237 | + summary = len(output) if output else self.info.NoOutput |
| 238 | + details = format_summary_details(output) if output else "" |
| 239 | + self.info.set_output_summary(summary, details) |
| 240 | + |
225 | 241 | def _invalidate(self): |
226 | 242 | self.commit() |
227 | 243 |
|
|
0 commit comments