0
我試圖嵌入由openMdao生成到Jupyter筆記本採用下面的代碼N2 digaram:如何嵌入Jupyter筆記本的OpenMDAO N2圖
from openmdao.api import Problem
from openmdao.examples.beam_tutorial import BeamTutorial
from openmdao.api import view_model
from IPython.core.display import display, HTML
top = Problem()
top.root = BeamTutorial()
top.setup(check=False)
view_model(top, embed=True, show_browser=False,
outfile='partition_tree_n2.html')
display(HTML(filename='partition_tree_n2.html'))
這正常,但顯示了圖的工具欄中沒有圖,也給出了錯誤:
Javascript error adding output!
SyntaxError: Unexpected token >
See your browser Javascript console for more details.
的JavaScript控制檯上的錯誤是:
SyntaxError: Unexpected token >
at eval (<anonymous>)
at Function.globalEval (jquery.min.js:4)
at init.domManip (jquery.min.js:5)
at init.append (jquery.min.js:5)
at OutputArea._safe_append (outputarea.js:440)
at OutputArea.append_display_data (outputarea.js:638)
at OutputArea.append_output (outputarea.js:330)
at OutputArea.handle_output (outputarea.js:243)
at output (codecell.js:365)
at Kernel._handle_output_message (kernel.js:1196))
如何解決此問題或以其他方式嵌入Jupyter Notebook中的OpenMDAO N2圖表?