用于控制Jupyter仪表板的多个单元格的小组件

时间:2017-06-21 13:37:48

标签: python widget jupyter-notebook dashboard

我正在尝试构建一个包含许多情节和表格的jupyter仪表板。理想情况下,所有绘图和表格将同时相应地更改为相同的窗口小部件值。

我可以创建一个函数来处理所有绘图和表格的创建并显示它们,但是我将限制布局,这是jupyter仪表板非常适合的。

def create_dashboard(x, y, z):
    # make first plot using x
    ...
    # make second plot using x, y
    ...
    # draw table from dataframe using x, y, z
    ...

interact(create_dashboard, x, y ,z)

这可能有效,但非常有限。此外,即使您没有更改将修改输出的变量,您也需要始终生成所有绘图和表格(许多)。此外,所有这些都在ipython单元格中按顺序显示,而无法在创建仪表板时移动它们。

有没有办法在单个单元格中绘制plot using xplot using ytable using x, y, z,然后创建一个控制所有三个单元格的小部件?像

这样的东西
output[1]
# plot using x

output[2]
# plot using x, y

output[3]
# table from dataframe using x, y, z

output[4]
interact(x, y, z)
# show the widget only here

希望这很清楚。如果没有,我很乐意提供更多信息。

谢谢!

1 个答案:

答案 0 :(得分:-2)

我会尝试使用Plotly for python https://plot.ly/python/create-online-dashboard/

告诉我们它是怎么回事!