diff --git a/setting.json b/setting.json index 3dd7676..659cad1 100644 --- a/setting.json +++ b/setting.json @@ -40,10 +40,15 @@ "offset": [3.0, -0.8, 3.0, 1.5], "color": [196, 64, 0] }, - "__others__": { + "/system": { "direction": "horizontal", "offset": [-0.5, -0.5, 1.0, 1.0], + "color": [64, 64, 128] + }, + "__others__": { + "direction": "horizontal", + "offset": [0.5, -0.5, 1.0, 1.0], "color": [16, 64, 96] } } -} \ No newline at end of file +} diff --git a/src/dear_ros_node_viewer/caret2networkx.py b/src/dear_ros_node_viewer/caret2networkx.py index bf73c0c..911dfc6 100644 --- a/src/dear_ros_node_viewer/caret2networkx.py +++ b/src/dear_ros_node_viewer/caret2networkx.py @@ -84,7 +84,7 @@ def parse_target_path(yml, node_name_list, topic_pub_dict, topic_sub_dict): def make_graph_from_topic_association(topic_pub_dict: dict[str, list[str]], topic_sub_dict: dict[str, list[str]]): """make graph from topic association""" - graph = nx.DiGraph() + graph = nx.MultiDiGraph() for topic, node_pub_list in topic_pub_dict.items(): if topic in topic_sub_dict: node_sub_list = topic_sub_dict[topic] @@ -93,14 +93,14 @@ def make_graph_from_topic_association(topic_pub_dict: dict[str, list[str]], continue for node_pub in node_pub_list: for node_sub in node_sub_list: - # logger.debug(topic, node_pub, node_sub) + # logger.debug(f'{topic}, {node_pub}, {node_sub}') graph.add_edge(node_pub, node_sub, label=topic) return graph def caret2networkx(filename: str, target_path: str = 'all_graph', - ignore_unconnected=True) -> nx.classes.digraph.DiGraph: + ignore_unconnected=True) -> nx.classes.multidigraph.MultiDiGraph: """ Create NetworkX Graph from architecture.yaml generated by CARET @@ -115,7 +115,7 @@ def caret2networkx(filename: str, target_path: str = 'all_graph', Returns ------- - graph : nx.classes.digraph.DiGraph + graph : nx.classes.multidigraph.MultiDiGraph NetworkX Graph """ diff --git a/src/dear_ros_node_viewer/setting.json b/src/dear_ros_node_viewer/setting.json index 883cb31..659cad1 100644 --- a/src/dear_ros_node_viewer/setting.json +++ b/src/dear_ros_node_viewer/setting.json @@ -40,9 +40,14 @@ "offset": [3.0, -0.8, 3.0, 1.5], "color": [196, 64, 0] }, - "__others__": { + "/system": { "direction": "horizontal", "offset": [-0.5, -0.5, 1.0, 1.0], + "color": [64, 64, 128] + }, + "__others__": { + "direction": "horizontal", + "offset": [0.5, -0.5, 1.0, 1.0], "color": [16, 64, 96] } }