Python 如何在 Jupyter 笔记本中使用破折号?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45490002/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use dash within Jupyter notebook?
提问by bluprince13
Is it possible to have a dash app within a Jupyter Notebook, rather than served up and viewed in a browser?
是否可以在 Jupyter Notebook 中安装一个破折号应用程序,而不是在浏览器中提供和查看?
My intention is to link graphs within a Jupyter notebook so that hovering over one graph generates the input required for another graph.
我的目的是在 Jupyter 笔记本中链接图形,以便将鼠标悬停在一个图形上会生成另一个图形所需的输入。
采纳答案by vasili111
Try JupyterDash: https://github.com/plotly/jupyter-dash
试试 JupyterDash:https: //github.com/plotly/jupyter-dash
More about it here: https://medium.com/plotly/introducing-jupyterdash-811f1f57c02e
更多关于它的信息:https: //medium.com/plotly/introducing-jupyterdash-811f1f57c02e
回答by Chris P
(Disclaimer, I help maintain Dash)
(免责声明,我帮助维护 Dash)
See https://github.com/plotly/jupyterlab-dash. This is a JupyterLab extension that embeds Dash within Jupyter.
请参阅https://github.com/plotly/jupyterlab-dash。这是一个 JupyterLab 扩展,它在 Jupyter 中嵌入了 Dash。
Also see alternative solutions in the Dash Community Forumlike the Can I run dash app in jupyter topic.
另请参阅Dash 社区论坛中的替代解决方案,例如Can I run dash app in jupyter 主题。
回答by raj
Look for plotly offline.
寻找 plotly 离线。
Say you have a figure (e.g. fig = {'data': data, 'layout':layout} )
假设你有一个数字(例如 fig = {'data': data, 'layout':layout} )
Then, inside a jupyter notebook cell,
然后,在 jupyter notebook 单元中,
from plotly.offline import iplot, init_notebook_mode
init_notebook_mode()
# plot it
iplot(fig)
This will plot the plotly inside your jupyter. You dont even have to run the flask server.
这将在您的 jupyter 中绘制 plotly。您甚至不必运行 Flask 服务器。
回答by igrinis
回答by Malik_Day
You can install jupyter-plotly-dashso that you can run the dash apps on Jupyter Notebook. You might need to think about the offline-component of plotly, but I'm not too sure how that will work. Hope this helps!
您可以安装jupyter-plotly-dash以便您可以在 Jupyter Notebook 上运行 dash 应用程序。您可能需要考虑 plotly 的离线组件,但我不太确定它是如何工作的。希望这可以帮助!
回答by FabienP
I am not sure dash
apps can be displayed within a Jupyter notebook. But if what you're looking for is using sliders, combo boxes and other buttons, you may be interested in ipywidgetsthat come from Jupyter directly.
我不确定dash
应用程序是否可以显示在 Jupyter 笔记本中。但是,如果你正在寻找什么用滑块,组合框和其他按钮是,你可能有兴趣在ipywidgets直接来自Jupyter。
These may be used with plotly, as shown here.
这些可以与plotly被使用,如所示在这里。
EDIT
编辑
Eventually it seems that there are solutions to embed dash
apps inside Jupyter by using an iframe and IPython.display.display_html()
.
See this functionand this GitHub repofor details.
最终似乎有解决方案可以dash
通过使用 iframe 和IPython.display.display_html()
. 有关详细信息,请参阅此函数和此 GitHub 存储库。