Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Radviz VizRank: Implement on_selection_changed #5338

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Orange/widgets/visualize/owradviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def check_preconditions(self):
len(master.model_selected)))
return True

def on_selection_changed(self, selected, _):
self.on_row_clicked(selected.indexes()[0])

def on_row_clicked(self, index):
self.selectionChanged.emit(index.data(self._AttrRole))

Expand Down
15 changes: 15 additions & 0 deletions Orange/widgets/visualize/tests/test_owradviz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
import unittest
from unittest.mock import Mock
import numpy as np

Expand Down Expand Up @@ -129,3 +130,17 @@ def test_invalidated_model_selected(self):
self.widget.setup_plot.reset_mock()
self.send_signal(self.widget.Inputs.data, self.data)
self.widget.setup_plot.assert_called_once()

def test_score_plots_feature_update(self):
self.send_signal(self.widget.Inputs.data, self.data)
selected_vars = set(self.widget.selected_vars)
output1 = self.get_output(self.widget.Outputs.components)
self.widget.vizrank.toggle()
self.process_events(until=lambda: not self.widget.vizrank.keep_running)
self.assertNotEqual(selected_vars, set(self.widget.selected_vars))
output2 = self.get_output(self.widget.Outputs.components)
self.assertNotEqual(output1, output2)


if __name__ == "__main__":
unittest.main()