Skip to content

Commit 107864d

Browse files
authored
Merge pull request #315 from pllab/svg-out-update
Exposing split_state option for SVG output, like previously done for trivialgraph
2 parents 821367e + 5342cde commit 107864d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pyrtl/inputoutput.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -679,17 +679,16 @@ def block_to_graphviz_string(block=None, namer=graphviz_default_namer, split_sta
679679
return rstring
680680

681681

682-
def output_to_svg(file, block=None):
682+
def output_to_svg(file, block=None, split_state=True):
683683
""" Output the block as an SVG to the open file. """
684-
print(block_to_svg(block), file=file)
684+
print(block_to_svg(block, split_state), file=file)
685685

686686

687-
def block_to_svg(block=None):
687+
def block_to_svg(block=None, split_state=True):
688688
""" Return an SVG for the block. """
689-
block = working_block(block)
690689
try:
691690
from graphviz import Source
692-
return Source(block_to_graphviz_string())._repr_svg_()
691+
return Source(block_to_graphviz_string(block, split_state=split_state))._repr_svg_()
693692
except ImportError:
694693
raise PyrtlError('need graphviz installed (try "pip install graphviz")')
695694

0 commit comments

Comments
 (0)