相关疑难解决方法(0)

如何在 dash/plotly 中使用 iframe?(Python/HTML)

我正在创建一个仪表板,我想使用这个交互式地图

网页链接:https://www.ons.gov.uk/peoplepopulationandcommunity/healthandsocialcare/causesofdeath/articles/deathsinvolvingcovid19interactivemap/2020-06-12

嵌入代码: <iframe height="1043px" width="100%" src="https://www.ons.gov.uk/visualisations/dvc914/map/index.html"></iframe>

现在我不知道那么多 HTML,但这就是我到目前为止所知道的。我知道布局是错误的,但我已经被困了很长一段时间了,有人能指出我正确的方向吗?非常感谢!

import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd
from dash.dependencies import Input, Output

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)


#H1 = biggest heading,  Div = a box containhg info
app.layout = html.Div(children=[
    html.H1(children='Hello Dash'),

    html.Div(children='''
        Dash: A web application framework for Python.
    '''),

    dcc.Graph(
        id='example-graph',
        figure=fig
        
    <iframe height="1067px" width="100%" src="https://www.ons.gov.uk/visualisations/dvc914/map/index.html"></iframe>
    )
])

if __name__ == '__main__':
    app.run_server(debug=True,port=8049,host='127.0.0.1')
Run Code Online (Sandbox Code Playgroud)

html python iframe dashboard plotly-dash

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

标签 统计

dashboard ×1

html ×1

iframe ×1

plotly-dash ×1

python ×1