首页 > 解决方案 > Python:使用获取参数调用 Dash 应用程序

问题描述

我想创建一个可以访问在地址中传递的参数的破折号应用程序。例如,http://localhost:5050?config=bob.json

@app.callback(
    dash.dependencies.Output('funnel-graph', 'figure'),
    [dash.dependencies.Input('Manager', 'value')])
def update_graph(Manager):
   config = ... # get config value of 'bob.json'
   ... 

标签: pythonplotly-dash

解决方案


您可以使用dcc.location提取所需的任何参数值来访问完整的地址行。


推荐阅读