获取破折号中输入的更新

Get updates of inputs in dash

我在这里, 我的 dash-App 中有一些输入。 我使用 dcc.Store 将输入中的条目保存为字典。例如

dcc.Store(id='old_data') 
@app.callback(
Output('old_data', 'data'),
[#here my inputs
]
)
def funtion(#here my inputs):
      old_data = {'time':'input1', ect...}

我想在我的回调中做一些优化,具体取决于破折号输入与上次调用相比发生了哪些变化 我怎样才能从我的输入中得到 new_entries 并将其与旧的进行比较? 有办法吗?

如果我的理解正确,那么您可以在此处设置各种输入,然后将 Store 中的现有值设置为 State 值。输入值将显示新值,您可以在更新之前将其与旧版本 Store 中存储的内容进行比较。粗略的回调签名如:

dcc.Store(id='old_data') 
@app.callback(
Output('old_data', 'data'),
[
    Input(),
    Input(),
],
[State('old_data', 'data')]
)
def funtion(input_1, input_2, old_store_value):
      # compare values and build return value