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

Remove edge simplification from node-only graph. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 6 additions & 4 deletions src/rqt_graph/dotcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _calc_statistic_info(self, sub, topic, pub=None):
else:
return [None, None, None]

def _add_edge(self, edge, dotcode_factory, dotgraph, is_topic=False):
def _add_edge(self, edge, dotcode_factory, dotgraph, is_topic=False, simplify=True):
if is_topic:
sub = edge.end
topic = edge.label
Expand All @@ -224,14 +224,16 @@ def _add_edge(self, edge, dotcode_factory, dotgraph, is_topic=False):
label=temp_label,
url='topic:%s' % edge.label,
penwidth=penwidth,
color=color)
color=color,
simplify=simplify)
else:
dotcode_factory.add_edge_to_graph(
dotgraph,
_conv(edge.start),
_conv(edge.end),
label=edge.label,
url='topic:%s' % edge.label)
url='topic:%s' % edge.label,
simplify=simplify)
else:
sub = edge.end.strip()
topic = edge.start.strip()
Expand Down Expand Up @@ -822,7 +824,7 @@ def generate_dotgraph(

for e in edges:
self._add_edge(
e, dotcode_factory, dotgraph=dotgraph, is_topic=(graph_mode == NODE_NODE_GRAPH))
e, dotcode_factory, dotgraph=dotgraph, is_topic=(graph_mode == NODE_NODE_GRAPH), simplify=simplify)

for (action_prefix, node_connections) in action_nodes.items():
for out_edge in node_connections.get('outgoing', []):
Expand Down
4 changes: 3 additions & 1 deletion src/rqt_graph/ros_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def _generate_dotcode(self):
hide_tf_nodes = self._widget.hide_tf_nodes_check_box.isChecked()
group_image_nodes = self._widget.group_image_check_box.isChecked()
hide_dynamic_reconfigure = self._widget.hide_dynamic_reconfigure_check_box.isChecked()
simplify = (graph_mode != NODE_NODE_GRAPH)
Copy link
Author

@vpradeep07 vpradeep07 Nov 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confident that NODE_NODE_GRAPH should have simplification disabled. However, it could also make sense to disable simplification for all graph types. If so, we can simply hardcode this as simplify = False


return self.dotcode_generator.generate_dotcode(
rosgraphinst=self._graph,
Expand All @@ -321,7 +322,8 @@ def _generate_dotcode(self):
group_tf_nodes=group_tf_nodes,
hide_tf_nodes=hide_tf_nodes,
group_image_nodes=group_image_nodes,
hide_dynamic_reconfigure=hide_dynamic_reconfigure)
hide_dynamic_reconfigure=hide_dynamic_reconfigure,
simplify=simplify)

def _update_graph_view(self, dotcode):
if dotcode == self._current_dotcode:
Expand Down