Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Refreshing main dataframe when page is reloaded

$
0
0

I’ve chanced upon the following two links, but I’m still confused as to how I can refresh my dataframe everytime a user reloads the page.

Live Updates
Sharing Data between Callbacks

# Function that grabs latest data from FTP server
df = ftpfile.grabDF()

# Set app.layout as a function (Part 1): Advised in Live Updates link
def serve_layout():
    return html.Div(.......)

# Reassigning dataframe to a new variable in callback : Advised in Sharing Data between Callbacks link
@app.callback(
    [Output("pie", "figure"), Output("bar", "figure")],
    [Input("checkbox1", "value"), Input("bu-checkbox2", "value")],)
def update_output_div(valueA, valueB):
    dff = df[:]

#Set app.layout as a function (Part 2): Advised in Live Updates link
app.layout = serve_layout

But the above doesn’t work as intended, the df is not obtained from the data source upon page refresh.

What am I doing wrongly?

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles