![](/img/trans.png)
[英]Is there a way to export an existing dash_table.DataTable as an image (e.g. png, jpg) directly from the Callback?
[英]Load plotly modebar with preselected value (e.g. boxSelect) in dash
我正在dash
創建一個繪圖圖形,並嘗試使用 boxSelect 的預選動作值創建模式boxSelect
。 當圖形加載時,模式欄中沒有預選值。
這是我的代碼:
dcc.Graph(
id='scatter',
className="chart-graph",
config={
"modeBarButtonsToRemove": ['toImage', 'zoom2d', 'zoomIn', 'zoomOut','autoScale2d','toggleSpikelines','hoverCompareCartesian', 'hoverClosestCartesian'],
# This is the line of code I'm hoping initializes things, but it does not work...
"select2d": True,
},
)
知道了! 配置layout
,添加以下參數:
layout = go.Layout(
# ...
clickmode='event+select',
dragmode = 'lasso',
)
參考文檔。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.