Last active
January 29, 2019 08:57
-
-
Save pcornier/93290fa3c053ddb87cf63807186d5eef to your computer and use it in GitHub Desktop.
Jupyter + nbwavedrom, JS error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MyHDL + MyHDLPeek + NBWaveDrom | |
# replace the last <script> tag with a <style onload=""> | |
# vim $PREFIX/lib/python3.7/site-packages/nbwavedrom/__init__.py | |
def _draw_wavedrom_javascript(data, width): | |
style = "" | |
if width != None: | |
style = ' style="width: ' + str(int(width)) + 'px' | |
htmldata = '<script>' + open(_get_js_path('wavedromskin.js')).read() + '</script>' | |
htmldata += '<script>' + open(_get_js_path('wavedrom.min.js')).read() + '</script>' | |
htmldata += '<div' + style + '><script type="WaveDrom">' + data + '</script></div>' | |
htmldata += '<style onload="WaveDrom.ProcessAll()"></style>' | |
return IPython.display.HTML(data=htmldata) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment