取消选择 python 中的所有 plotly dash 散点图

Unselect all in python plotly dash scatter plot

在 plotly dash 中,可以 select 基于点击图例项的线条。一开始都是preselected。是否可以在仪表板的开头将它们全部取消select? 谢谢

都是预选的,因为散点函数的参数"visible"默认为True,参考这里:https://plot.ly/python/reference/#scatter

您可以通过将参数设置为 False 来取消选择它们:

go.Scatter(
    ...,
    visible=False
)