From 212a082af31f69888309830c24bf9c255bb023b9 Mon Sep 17 00:00:00 2001 From: MuratovAS Date: Sun, 14 Jan 2024 01:29:41 +0500 Subject: [PATCH] line type = network type --- README.md | 1 + docker-network-graph.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 3396f95..89e779a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Changes: - Improved design - Added the ability to generate url - Added display of connections with the host +- Github package ## Example ![example graph](./example.png) diff --git a/docker-network-graph.py b/docker-network-graph.py index 9e4f530..6606e7e 100755 --- a/docker-network-graph.py +++ b/docker-network-graph.py @@ -194,10 +194,18 @@ def draw_container(g: Graph, c: Container): 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( f"container_{link.container_id}:{link.endpoint_id}", f"network_{link.network_name}", color=networks[link.network_name].color, + style=style, )