Browse Source

feat: support inline rendering for jupyter notebook

tags/v0.6.3
mingrammer 4 years ago
parent
commit
547eefd55b
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      diagrams/__init__.py

+ 3
- 0
diagrams/__init__.py View File

@@ -139,6 +139,9 @@ class Diagram:
os.remove(self.filename)
setdiagram(None)

def _repr_png_(self):
return self.dot.pipe(format='png')

def _validate_direction(self, direction: str) -> bool:
direction = direction.upper()
for v in self.__directions:


Loading…
Cancel
Save