roy*_*650 3 plotly plotly-dash
在我们的Dash图表中,我们试图隐藏浮动工具栏,该工具栏允许用户缩放,平移,保存,捕获等。要实现这一点,我知道在绘图中可以将displayModeBar参数设置为false。如何在Dash中完成?
Dash Core已更新,现在提供了更清洁的解决方案。'displayModeBar': False
引入了带有值的特定配置参数
dcc.Graph(
id='my-graph',
figure={'data': [{'x': [1, 2, 3]}]},
config={
'displayModeBar': False
}
)
Run Code Online (Sandbox Code Playgroud)
config参数甚至可以隐藏和删除特定按钮。
例如:
config={
'modeBarButtonsToRemove': ['pan2d', 'lasso2d']
}
Run Code Online (Sandbox Code Playgroud)
请注意,要使其正常工作,您必须更新所有Dash组件。
在我的配置(pip
和virtualenv
)中,以下命令是必需的:
pip install dash --upgrade
pip install dash-core-components --upgrade
pip install dash-html-components --upgrade
pip install dash-renderer --upgrade
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1970 次 |
最近记录: |