小编Tho*_*ere的帖子

Dash - 通过函数回调更改 HTML.iframe 元素

我最近启动了一个 Dash 应用程序,它显示我通过 HTML.iFrame 显示的预先注册的 HTML 文件:

html.Iframe(id = 'my-output', src = "assets/ABCD.html",
                style={"height": "495px", "width": "100%",})
Run Code Online (Sandbox Code Playgroud)

我有一个函数/应用程序回调,如下所示:

@app.callback(
    Output(component_id='my-output', component_property='children'),
    Input(component_id='my-input', component_property='value'),
    )

def update_output_div(input_value):
    return XYZ
Run Code Online (Sandbox Code Playgroud)

现在我需要在 src 中输出该输出值,如下所示

html.Iframe(id = 'my-output', src = "assets/XYZ.html",
                style={"height": "495px", "width": "100%",})   
Run Code Online (Sandbox Code Playgroud)

但我不知道如何取回该输出值并更改我的 src 参数。

html python iframe plotly-dash

4
推荐指数
1
解决办法
2238
查看次数

本地 HTML 文件无法正确加载到 Dash 应用程序中

我尝试将本地 html 文件嵌入到基本的 Dash 应用程序中。我使用了此链接中的代码,并将路径替换为我的本地相对路径(破折号应用程序与 html 本地页面位于同一文件夹中)

html.Iframe(src="random_example.html",
            style={"height": "1067px", "width": "100%"})
Run Code Online (Sandbox Code Playgroud)

但这是我得到的结果:html.H1 彼此重复

html css python path plotly-dash

3
推荐指数
1
解决办法
4172
查看次数

标签 统计

html ×2

plotly-dash ×2

python ×2

css ×1

iframe ×1

path ×1