Skip to content

Instantly share code, notes, and snippets.

@pcornier
Created January 29, 2019 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcornier/03503573ef9cac7da82508b38d5f23b5 to your computer and use it in GitHub Desktop.
Save pcornier/03503573ef9cac7da82508b38d5f23b5 to your computer and use it in GitHub Desktop.
Jupyter + nbwavedrom JS error
# MyHDL + MyHDLPeek + NBWaveDrom
# replace the last htmldata += ... line by a <style onload>
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