Skip to content

Commit

Permalink
Add all Graphivz attrs to custom node
Browse files Browse the repository at this point in the history
  • Loading branch information
shagr4th committed Jul 25, 2022
1 parent 625a446 commit ad5593e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions diagrams/custom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from diagrams import Node
from urllib.request import urlopen
from typing import Dict
import hashlib

class Custom(Node):
Expand All @@ -16,7 +17,7 @@ class Custom(Node):
def _load_icon(self):
return self._icon

def __init__(self, label, icon_path):
def __init__(self, label, icon_path, **attrs: Dict):
if icon_path.startswith('data:image/'):
with urlopen(icon_path) as response:
data = response.read()
Expand All @@ -25,4 +26,4 @@ def __init__(self, label, icon_path):
f.write(data)
f.close()
self._icon = icon_path
super().__init__(label)
super().__init__(label, **attrs)

0 comments on commit ad5593e

Please sign in to comment.