Skip to content

Commit

Permalink
GUI Cluster tab: More side menu options for the cluster tree
Browse files Browse the repository at this point in the history
And clean up the old stuff.
  • Loading branch information
shawnlaffan committed Jan 4, 2024
1 parent ee40b32 commit e5be430
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 135 deletions.
120 changes: 0 additions & 120 deletions bin/ui/hboxClusteringPage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -408,126 +408,6 @@ Colours are currently taken from the outer ring.</property>
<property name="active">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separatormenuitem1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="plot_by1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Plot by</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="plot_by1_menu">
<property name="can_focus">False</property>
<child>
<object class="GtkRadioMenuItem" id="plot_length">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Length</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_plot_length_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="plot_depth">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Depth</property>
<property name="use_underline">True</property>
<property name="group">plot_length</property>
<signal name="activate" handler="on_plot_depth_activate" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="group_by1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Should the grouping be done by length or depth?

This allows decoupling of node selection from the tree display so trees with many reversals can be more easily plotted by depth, but selections still use the branch lengths.

This setting has no effect on the slider bar. It always groups using the plot method, selecting whichever branches it crosses.</property>
<property name="label" translatable="yes">Group by</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="group_by1_menu">
<property name="can_focus">False</property>
<child>
<object class="GtkRadioMenuItem" id="group_length">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Length</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_group_length_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkRadioMenuItem" id="group_depth">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Depth</property>
<property name="use_underline">True</property>
<property name="group">group_length</property>
<signal name="activate" handler="on_group_depth_activate" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="highlight_groups_on_map">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Highlight groups under this node when hovering over the node</property>
<property name="label" translatable="yes">Highlight groups on map?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_highlight_groups_on_map" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="use_highlight_path_changed">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Highlight paths on the tree associated with groups on the map when you hover the mouse over them</property>
<property name="label" translatable="yes">Highlight node paths for groups?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_use_highlight_path_changed_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="menu_use_slider_to_select_nodes">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">When deselected, the slider bar will not change the display colours.</property>
<property name="label" translatable="yes">Use the slider bar to select nodes for colouring?</property>
<property name="use_underline">True</property>
<property name="active">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menuitem_cluster_set_tree_line_widths">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Set the width of the tree branches.
Does not affect the vertical connectors.
</property>
<property name="label" translatable="yes">Set tree branch line widths</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</child>
</object>
Expand Down
8 changes: 8 additions & 0 deletions lib/Biodiverse/GUI/Dendrogram.pm
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,14 @@ sub toggle_use_slider_to_select_nodes {
return;
}

sub set_use_slider_to_select_nodes {
my ($self, $bool) = @_;

$self->{use_slider_to_select_nodes} = !!$bool;

return;
}

# Colours a certain number of nodes below
sub do_colour_nodes_below {
my $self = shift;
Expand Down
31 changes: 16 additions & 15 deletions lib/Biodiverse/GUI/Tabs/Clustering.pm
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ sub new {
$self->{definition_query1}->get_object
);

$xml_page->get_object('plot_length') ->set_active(1);
$xml_page->get_object('group_length')->set_active(1);
# $xml_page->get_object('plot_length') ->set_active(1);
# $xml_page->get_object('group_length')->set_active(1);
$self->{plot_mode} = 'length';
$self->{group_mode} = 'length';

Expand Down Expand Up @@ -278,16 +278,6 @@ sub new {
btnZoomOutToolCL => {clicked => \&on_zoom_out_tool},
btnZoomFitToolCL => {clicked => \&on_zoom_fit_tool},

plot_length => {toggled => \&on_plot_mode_changed},
group_length => {toggled => \&on_group_mode_changed},

highlight_groups_on_map =>
{toggled => \&on_highlight_groups_on_map_changed},
use_highlight_path_changed =>
{toggled => \&on_use_highlight_path_changed},
menu_use_slider_to_select_nodes =>
{toggled => \&on_menu_use_slider_to_select_nodes},

menuitem_cluster_colour_mode_hue => {toggled => \&on_colour_mode_changed},
menuitem_cluster_colour_mode_sat => {activate => \&on_colour_mode_changed},
menuitem_cluster_colour_mode_grey => {toggled => \&on_colour_mode_changed},
Expand All @@ -303,7 +293,6 @@ sub new {
menu_cluster_cell_show_outline => {toggled => \&on_set_cell_show_outline},
menuitem_cluster_show_legend => {toggled => \&on_show_hide_legend},
#menuitem_cluster_data_tearoff => {activate => \&on_toolbar_data_menu_tearoff},
menuitem_cluster_set_tree_line_widths => {activate => \&on_set_tree_line_widths},
menuitem_cluster_excluded_cell_colour => {activate => \&on_set_excluded_cell_colour},
menuitem_cluster_undef_cell_colour => {activate => \&on_set_undef_cell_colour},
);
Expand Down Expand Up @@ -440,7 +429,7 @@ EOT
},
{
type => 'Gtk2::CheckMenuItem',
label => 'Highlight groups on map?',
label => 'Highlight groups on map',
tooltip => 'When hovering the mouse over a tree branch, '
. 'highlight the groups on the map in which it is found.',
event => 'toggled',
Expand All @@ -450,14 +439,26 @@ EOT
},
{
type => 'Gtk2::CheckMenuItem',
label => 'Highlight paths on tree?',
label => 'Highlight paths on tree',
tooltip => "When hovering over a group on the map, highlight the paths "
. "connecting the tips of the tree (that match labels in the group) "
. "to the root.",
event => 'toggled',
callback => \&on_use_highlight_path_changed,
active => 1,
},
{
type => 'Gtk2::CheckMenuItem',
label => 'Use the slider bar to select branches for colouring',
tooltip => "When deselected, the slider bar will not change the display colours.",
event => 'toggled',
callback => sub {
my ($self, $menuitem) = @_;
my $bool = $menuitem->get_active;
$self->{dendrogram}->set_use_slider_to_select_nodes ($bool);
},
active => 1,
},
{
type => 'Gtk2::SeparatorMenuItem',
},
Expand Down

0 comments on commit e5be430

Please sign in to comment.