Open iazulkarnain-tlkm opened 2 years ago
I can't set attr parameters and its values when creating a new instance of the Custom Node class.
from diagrams.custom import Custom rabbitmq_icon = "icons/rabbitmq_icon.png" test = Custom("crawler_news_kazee_q", rabbitmq_icon,pin="true",pos="4,2")
Error notification
TypeError: Custom.__init__() got an unexpected keyword argument 'pin'
The original codes for custom node class is:
""" Custom provides the possibility of load an image to be presented as a node. """ from diagrams import Node class Custom(Node): _provider = "custom" _type = "custom" _icon_dir = None fontcolor = "#ffffff" def _load_icon(self): return self._icon def __init__(self, label, icon_path): self._icon = icon_path super().__init__(label)
""" Custom provides the possibility of load an image to be presented as a node. """ from diagrams import Node class Custom(Node): _provider = "custom" _type = "custom" _icon_dir = None fontcolor = "#ffffff" def _load_icon(self): return self._icon def __init__(self, label, icon_path, **attrs): self._icon = icon_path super().__init__(label,**attrs)
@iazulkarnain-tlkm @mingrammer This was fixed already in #437 and can be closed.
The Problem
I can't set attr parameters and its values when creating a new instance of the Custom Node class.
How to reproduce the problem
Error notification
Original codes
The original codes for custom node class is:
Proposed Fix: