【发布时间】:2017-11-24 10:57:25
【问题描述】:
我正在尝试构建一个包含许多图表和表格的 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 x、plot using y 和table 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
希望这很清楚。如果不是,我很乐意提供更多信息。
谢谢!
【问题讨论】:
标签: python widget jupyter-notebook dashboard