Skip to content

Commit

Permalink
disconnected ports with same name to different invisible nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
eagmon committed Mar 17, 2024
1 parent d8fc111 commit cc41bb0
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions bigraph_viz/diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def get_graphviz_fig(
port = edge['port']

# add invisible node for port
node_name2 = str(absolute_path(process_path, port))
node_name2 = str(absolute_path(process_path, port)) + '_input'
graph.node(node_name2, label='', style='invis', width='0')
edge['target_path'] = node_name2

Expand All @@ -351,7 +351,7 @@ def get_graphviz_fig(
port = edge['port']

# add invisible node for port
node_name2 = str(absolute_path(process_path, port))
node_name2 = str(absolute_path(process_path, port)) + '_output'
graph.node(node_name2, label='', style='invis', width='0')
edge['target_path'] = node_name2

Expand Down Expand Up @@ -692,11 +692,36 @@ def test_cell_hierarchy():
filename='cell')


def test_plot_disconnected():
core = generate_types()

spec = {
'process': {
'_type': 'process',
'_inputs': {
'port1': 'Any',
'port2': 'Any',
},
'_outputs': {
'port1': 'Any',
'port2': 'Any',
},
},
}

plot_bigraph(
spec,
core=core,
out_dir='out',
filename='multiple_disconnected')


if __name__ == '__main__':
test_diagram_plot()
test_bio_schema()
test_input_output()
test_multi_processes()
test_nested_processes()
test_multi_input_output()
test_cell_hierarchy()
# test_diagram_plot()
# test_bio_schema()
# test_input_output()
# test_multi_processes()
# test_nested_processes()
# test_multi_input_output()
# test_cell_hierarchy()
test_plot_disconnected()

0 comments on commit cc41bb0

Please sign in to comment.