From 7d1ea84bc4ce85fab9e6bb6071a49b2ee7dc288b Mon Sep 17 00:00:00 2001 From: Rajat Shukla Date: Mon, 10 May 2021 12:01:13 +0530 Subject: [PATCH] Supporting attributes on custom node This fixes problem when trying to use `pin`, `pos`, etc with custom nodes --- diagrams/custom/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/diagrams/custom/__init__.py b/diagrams/custom/__init__.py index 48441a6e..6cd148e7 100644 --- a/diagrams/custom/__init__.py +++ b/diagrams/custom/__init__.py @@ -3,6 +3,7 @@ Custom provides the possibility of load an image to be presented as a node. """ from diagrams import Node +from typing import Dict class Custom(Node): @@ -15,6 +16,6 @@ class Custom(Node): def _load_icon(self): return self._icon - def __init__(self, label, icon_path): + def __init__(self, label, icon_path, **attrs: Dict): self._icon = icon_path - super().__init__(label) + super().__init__(label, **attrs)