I'm creating a dashboard and I want to use this interactive map
web link: https://www.ons.gov.uk/peoplepopulationandcommunity/healthandsocialcare/causesofdeath/articles/deathsinvolvingcovid19interactivemap/2020-06-12
embedded code:
<iframe height="1043px" width="100%" src="https://www.ons.gov.uk/visualisations/dvc914/map/index.html"></iframe>
Now I don't know that much HTML but this is what I have so far. I know the layout is wrong but I have been stuck for quite a while now, could anyone point me in the right direction. Many thanks!
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')
You're almost there. Just replace the <> syntax for the iframe element with the dash syntax that you used for the other elements,
import dash
import dash_core_components as dcc
import dash_html_components as html
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
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 # commented out to make the example runnable
),
html.Iframe(src="https://www.ons.gov.uk/visualisations/dvc914/map/index.html",
style={"height": "1067px", "width": "100%"})
])
if __name__ == '__main__':
app.run_server(debug=True, port=8049, host='127.0.0.1')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With