line type = network type

This commit is contained in:
MuratovAS 2024-01-14 01:29:41 +05:00
parent e8c090b3be
commit 212a082af3
No known key found for this signature in database
GPG key ID: CE09BE03367711AD
2 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,7 @@ Changes:
- Improved design - Improved design
- Added the ability to generate url - Added the ability to generate url
- Added display of connections with the host - Added display of connections with the host
- Github package
## Example ## Example
![example graph](./example.png) ![example graph](./example.png)

View file

@ -194,10 +194,18 @@ def draw_container(g: Graph, c: Container):
def draw_link(g: Graph, networks: typing.Dict[str, Network], link: Link): def draw_link(g: Graph, networks: typing.Dict[str, Network], link: Link):
if networks[link.network_name].isolated:
style="dashed"
elif networks[link.network_name].name == "host":
style="bold"
else:
style="solid"
g.edge( g.edge(
f"container_{link.container_id}:{link.endpoint_id}", f"container_{link.container_id}:{link.endpoint_id}",
f"network_{link.network_name}", f"network_{link.network_name}",
color=networks[link.network_name].color, color=networks[link.network_name].color,
style=style,
) )