Skip to content

Commit 9b76441

Browse files
committed
Invoke WaveDrom.ProcessAll() directly, rather than from an onload. This
seems to fix an issue where traces don't render the first time when executing a `render_trace()` cell.
1 parent 2a89bb0 commit 9b76441

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pyrtl/simulation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,7 @@ def render_trace(
17631763
if _currently_in_jupyter_notebook():
17641764
from IPython.display import (
17651765
HTML,
1766+
Javascript,
17661767
display,
17671768
)
17681769

@@ -1773,13 +1774,13 @@ def render_trace(
17731774
)
17741775
html_elem = HTML(htmlstring)
17751776
display(html_elem)
1776-
# print(htmlstring)
1777+
17771778
html_stuff = """
17781779
<script src="https://cdnjs.cloudflare.com/ajax/libs/wavedrom/1.6.2/skins/default.js"></script>
17791780
<script src="https://cdnjs.cloudflare.com/ajax/libs/wavedrom/1.6.2/wavedrom.min.js"></script>
1780-
<style onload="WaveDrom.ProcessAll();"></style>
17811781
"""
17821782
display(HTML(html_stuff))
1783+
display(Javascript("WaveDrom.ProcessAll();"))
17831784
else:
17841785
self.render_trace_to_text(
17851786
trace_list=trace_list,

0 commit comments

Comments
 (0)