From 1d04713e1ccdc852dff7ef554528003703e6c6e5 Mon Sep 17 00:00:00 2001 From: Cory ODaniel Date: Tue, 21 Apr 2020 13:38:26 -0700 Subject: [PATCH] tooltips --- diagrams/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/diagrams/__init__.py b/diagrams/__init__.py index f3d3b589..3b180a9b 100644 --- a/diagrams/__init__.py +++ b/diagrams/__init__.py @@ -262,7 +262,7 @@ class Node: _height = 1.9 - def __init__(self, label: str = "", URL: str = ""): + def __init__(self, label: str = "", URL: str = "", tooltip: str = ""): """Node represents a system component. :param label: Node label. @@ -271,6 +271,7 @@ class Node: # Generates a hash for identifying a node. self._hash = self._rand_hash() self.label = label + self.attrs.update({"URL": URL, "tooltip": tooltip}) # fmt: off # If a node has an icon, increase the height slightly to avoid @@ -284,9 +285,6 @@ class Node: } if self._icon else {} # fmt: on - if URL: - self.attrs.update({"URL": URL}) - # Node must be belong to a diagrams. self._diagram = getdiagram() if self._diagram is None: