2727 ANNOTATED_DATA_SIGNAL_NAME )
2828from Orange .widgets .utils .itemmodels import DomainModel
2929from Orange .widgets .utils .widgetpreview import WidgetPreview
30+ from Orange .widgets .utils .state_summary import format_summary_details
3031from Orange .widgets .visualize .utils import (
3132 CanvasText , CanvasRectangle , ViewWithPress , VizRankDialog )
3233from Orange .widgets .visualize .utils .plotutils import wrap_legend_items
@@ -332,6 +333,9 @@ def __init__(self):
332333 self .canvas_view .setHorizontalScrollBarPolicy (Qt .ScrollBarAlwaysOff )
333334 self .canvas_view .setRenderHint (QPainter .Antialiasing )
334335
336+ self .info .set_input_summary (self .info .NoInput )
337+ self .info .set_output_summary (self .info .NoOutput )
338+
335339 box = gui .vBox (self .controlArea , box = True )
336340 self .model_1 = DomainModel (
337341 order = DomainModel .MIXED , valid_types = DomainModel .PRIMITIVE )
@@ -442,8 +446,10 @@ def set_data(self, data):
442446 if self .data is None :
443447 self .discrete_data = None
444448 self .init_combos (None )
449+ self .info .set_input_summary (self .info .NoInput )
445450 return
446451
452+ self .info .set_input_summary (len (data ),format_summary_details (data ))
447453 self .init_combos (self .data )
448454 self .openContext (self .data )
449455
@@ -518,6 +524,7 @@ def send_selection(self):
518524 self .Outputs .selected_data .send (None )
519525 self .Outputs .annotated_data .send (
520526 create_annotated_table (self .data , []))
527+ self .info .set_output_summary (self .info .NoOutput )
521528 return
522529 filters = []
523530 self .Warning .no_cont_selection_sql .clear ()
@@ -539,6 +546,10 @@ def send_selection(self):
539546 sel_idx = [i for i , id in enumerate (self .data .ids ) if id in idset ]
540547 if self .discrete_data is not self .data :
541548 selection = self .data [sel_idx ]
549+
550+ summary = len (selection ) if selection else self .info .NoOutput
551+ details = format_summary_details (selection ) if selection else ""
552+ self .info .set_output_summary (summary , details )
542553 self .Outputs .selected_data .send (selection )
543554 self .Outputs .annotated_data .send (
544555 create_annotated_table (self .data , sel_idx ))
@@ -994,5 +1005,5 @@ def get_conditional_distribution(data, attrs):
9941005
9951006
9961007if __name__ == "__main__" : # pragma: no cover
997- data = Table ("zoo" )
998- WidgetPreview (OWMosaicDisplay ).run (data , set_subset_data = data [::10 ])
1008+ dataset = Table ("zoo" )
1009+ WidgetPreview (OWMosaicDisplay ).run (dataset , set_subset_data = dataset [::10 ])
0 commit comments