Skip to content

Commit

Permalink
Name things like set_outgroup when that is what they are doing.
Browse files Browse the repository at this point in the history
We had a legacy name for the gui communication, where "root_at" really
meant "set_outgroup". To "root at a node" means something different,
and we might want to use that independently. This change makes it all
cleaner.
  • Loading branch information
jordibc committed Jan 19, 2024
1 parent e27e2f2 commit be5e255
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ete4/smartview/gui/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def callback(tree_id):
sort(tree_id, node_id, key_text, reverse)
return {'message': 'ok'}

@put('/trees/<tree_id>/root_at')
@put('/trees/<tree_id>/set_outgroup')
def callback(tree_id):
tree_data, subtree = touch_and_get(tree_id)

Expand Down
6 changes: 3 additions & 3 deletions ete4/smartview/gui/static/js/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ async function add_node_modifying_options(properties, nodestyle, node_id) {
}, "Edit the content of this node. Changes the tree structure.",
"edit", true);
if (!view.subtree) {
add_button("Root on this node", async () => {
await tree_command("root_at", node_id);
add_button("Set node as outgroup", async () => {
await tree_command("set_outgroup", node_id);
draw_minimap();
update();
}, "Set this node as the root of the tree. Changes the tree structure.",
}, "Set this node as the 1st child of the root. Changes the tree structure.",
"root", true);
}
add_button("Move branch up", async () => {
Expand Down
2 changes: 1 addition & 1 deletion ete4/smartview/gui/static/js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ async function tree_command(command, params=undefined) {
try {
await api_put(`/trees/${get_tid()}/${command}`, params);

const commands_modifying_size = ["root_at", "remove", "update_props"];
const commands_modifying_size = ["set_outgroup", "remove", "update_props"];
if (commands_modifying_size.includes(command))
view.tree_size = await api(`/trees/${get_tid()}/size`);
}
Expand Down

0 comments on commit be5e255

Please sign in to comment.