# How can I add a custom Plotly embeded HTML into a Dash app.layout code?

**URL:** <https://community.plotly.com/t/how-can-i-add-a-custom-plotly-embeded-html-into-a-dash-app-layout-code/20017>\
**Category:** Dash Python\
**Created:** [February 23, 2019, 4:19am UTC](https://community.plotly.com/t/how-can-i-add-a-custom-plotly-embeded-html-into-a-dash-app-layout-code/20017 "2019-02-23T04:19:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sailor77](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@sailor77](https://community.plotly.com/u/sailor77)\
**Post date:** [February 23, 2019, 4:19am UTC](https://community.plotly.com/t/how-can-i-add-a-custom-plotly-embeded-html-into-a-dash-app-layout-code/20017/1 "2019-02-23T04:19:17Z")

</div>

I have created an onnline Plotly choropleth map with US map with states getting data from a database… I created an online html file at my plotly cloud account to be able to embed it in my custom webpage that is currently at localhost. I could not find how to embed this online plotly graph into my existing Dash app.layout code so that I show everything in the same web page. Below is the overall code:

1. First i create an online Plotly choropleth map on my Plotly account. This works perfectly.

data = [ dict(  
type=‘choropleth’,  
locations = df[‘code’],  
z = df[‘total exports’].astype(float),  
locationmode = ‘USA-states’,

```
   ................................. Here I truncated the code for the sake of space................................

    py.plot({"data":data, "layout":layout}, filename='US _Social_Sentiment_Map.html')

```

1. Then I retrieved the generated HTML link from my plotly account’s embed HTML part for the above map. It looks something like this:

[![US _Social_Sentiment_Map.html](https://plot.ly/~myUser/2.png?share_key=qYb0mASJDFasdnfasdfASD)](https://plot.ly/~USERNAME/2/?share_key=qYb0mASJDFasdnfasdfASD "US \_Social\_Sentiment\_Map.html")

1. Then I would like to embed the above Plotly choropleth map into below python Dash code and publish the map at the resultant website at [http://127.0.0.1:8050/](http://127.0.0.1:8050/). I could not figure out how to embed it despite different trials. My Dash code (without the above map link) looks like below (source: Sentdex/socialsentiment/blob/master/dash\_mess.py )

app = dash.Dash( **name** )  
app.layout = html.Div([

```
    html.Div(className='container-fluid', children=[html.H2('Live Twitter Sentiment', style={'color':"#CECECE"}),
                                                    html.H5('Search:', style={'color':app_colors['text']}),
                                              dcc.Input(id='sentiment_term', value='twitter', type='text', style={'color':app_colors['someothercolor']}),
                                              ],
             style={'width':'98%','margin-left':10,'margin-right':10,'max-width':50000}),

    
    
    html.Div(className='row', children=[html.Div(id='related-sentiment', children=html.Button('Loading related terms...', id='related_term_button'), className='col s12 m6 l6', style={"word-wrap":"break-word"}),
                                        html.Div(id='recent-trending', className='col s12 m6 l6', style={"word-wrap":"break-word"})]),

    html.Div(className='row', children=[html.Div(dcc.Graph(id='live-graph', animate=False), className='col s12 m6 l6'),
                                        html.Div(dcc.Graph(id='historical-graph', animate=False), className='col s12 m6 l6')]),

    html.Div(className='row', children=[html.Div(id="recent-tweets-table", className='col s12 m6 l6'),
                                        html.Div(dcc.Graph(id='sentiment-pie', animate=False), className='col s12 m6 l6'),]),

    dcc.Interval(
        id='graph-update',
        interval=1*1000
    ),
    dcc.Interval(
        id='historical-update',
        interval=60*1000
    ),

    dcc.Interval(
        id='related-update',
        interval=30*1000
    ),

    dcc.Interval(
        id='recent-table-update',
        interval=2*1000
    ),

    dcc.Interval(
        id='sentiment-pie-update',
        interval=60*1000
    ),

], style={'backgroundColor': app_colors['background'], 'margin-top':'-30px', 'height':'2000px',},

```

)

Thanks for any suggestions or help.

Oz
