我正在dash
中创建一个绘图图,并试图使用预先选定的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,
},
)
答案 0 :(得分:0)
知道了!在配置layout
时,添加以下参数:
layout = go.Layout(
# ...
clickmode='event+select',
dragmode = 'lasso',
)