簡體   English   中英

使用破折號中的預選值(例如 boxSelect)加載繪圖模式欄

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM