I have two pages in dash plotly, and an index file who run the pages :
- Index.py
- Page 1
- Page 2
I have a variable in page 1 which I want to pass it in page 2 and work with it. ( example of code) Is it possible in Dash plotly ? I saw somewhere that I can use Dcc.store, but how can I stock this variable in it ?
First_page = html.Div([
html.Div([dcc.Input(id='date_start', type='text', value='2021')]),
...
...
])
@app.callback(
Output('someoutput', 'children'),
[Input('someinput', 'value')])
#Uploading a certain table
@app.callback(
Output('datatable', 'data'),
Input('someinput', 'value'))
def function(somedata):
#Get the VARIABLE
...
...
variable= 12 (result of the operation in funtion)
How can I get the VARIABLE value (12) and inject it in page 2 please ?
Second_page = html.Div([
html.Div([dcc.Input(id='', type='text', value='')]),
...
...
])
@app.callback ()
def function_page2(somedata_page2):
#Work with the VARIABLE in first page
...
Thank you .