【发布时间】:2018-01-25 23:02:33
【问题描述】:
我刚刚开始使用 dash。以here 为例。我想转换下面的dash应用程序
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div([
dcc.Input(id='my-id', value='initial value', type="text"),
html.Div(id='my-div')
])
@app.callback(
Output(component_id='my-div', component_property='children'),
[Input(component_id='my-id', component_property='value')]
)
def update_output_div(input_value):
return 'You\'ve entered "{}"'.format(input_value)
if __name__ == '__main__':
app.run_server()
在用户按下按钮时更新,而不是在输入字段的值更改时更新。我该如何做到这一点?
【问题讨论】:
-
这原来是this问题的副本。
标签: python plotly-dash