Upload created dash to own account

Dear friends,

this might be a very easy question for you. However, I could not fix it and I do really hope you can help me :slight_smile:
I started diving into plotly dash and “re-created” a simple scatter dash with a slider. It works perfectly if I type the address http://127.0.0.1:8050/ into my browser :slight_smile:
However, I really would like to upload this dash into my plotly side, which I created. For plots I can do it, since it was explained in the tutorials by using the code. For this I added py.plot(fig, filename = ‘first scatter’, auto_open=True) at the end of my code.

Is there any similar why to upload the dash into my own plotly side?

Please find below my example code

indent preformatted text by 4 spaces  import numpy as np

import pandas as pd
import dash_core_components as dcc
import dash_html_components as html
import plotly
import dash
import plotly.plotly as py
import plotly.graph_objs as go
from dash.dependencies import Input,Output
plotly.tools.set_credentials_file(username=‘user’, api_key=‘key’)
plotly.tools.set_config_file(world_readable=True,sharing=“public”)

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

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

data_gdp=pd.read_csv(r"path",sep="\t")

app.layout = html.Div([
dcc.Graph(id=‘graph-with-slider’),
dcc.Slider(
id=‘year-slider’,
min=data_gdp[‘year’].min(),
max=data_gdp[‘year’].max(),
value=data_gdp[‘year’].min(),
marks={str(year): str(year) for year in data_gdp[‘year’].unique()}
)
])

@app.callback(
Output(‘graph-with-slider’, ‘figure’),
[Input(‘year-slider’, ‘value’)])

def update_figure(selected_year):
filtered_data=data_gdp[data_gdp.year==selected_year]
EU=filtered_data[filtered_data.continent==“Europe”]
Americas=filtered_data[filtered_data.continent==“Americas”]
trace0=go.Scatter(x=EU.gdpPercap,
y=EU.lifeExp,
text=EU.country,
mode=“markers”,
name=“EU”)
trace1=go.Scatter(x=EU.gdpPercap,
y=Americas.lifeExp,
text=Americas.country,
mode=“markers”,
name=“Americas”)
traces=[]
for i in filtered_data.continent.unique():
frame_by_continent=filtered_data[filtered_data.continent==i]
traces.append(go.Scatter(
x=frame_by_continent.gdpPercap,
y=frame_by_continent.lifeExp,
text=frame_by_continent.country,
mode=“markers”,
name=i
))
return {
‘data’: [trace0,trace1],
‘layout’: go.Layout(
xaxis={‘type’: ‘log’, ‘title’: ‘GDP Per Capita’},
yaxis={‘title’: ‘Life Expectancy’, ‘range’: [20, 90]},
margin={‘l’: 40, ‘b’: 40, ‘t’: 10, ‘r’: 10},
legend={‘x’: 0, ‘y’: 1},
hovermode=‘closest’
)
}

if name == ‘main’: