Hey, so I am not sure if that is possible but pretty sure I am super close, what I am trying to do:
Have a multiple browser windows app where on each window there is a common value to choose using dcc.Dropdown
, but where changing it in any of the windows will affect the value on others. I am also fine with the dropdown being present on only one window, but still affecting all the other but I feel like that does not matter. I feel like I am close but I don’t know how to open multiple windows at once, as when I open http://127.0.0.1:8050/, it goes automatically to of course the page with just dropdowns, but when I open new window with same address of course it is “new instance”, so basically I don’t know how to make multiple browser windows same instance I think. Also, example of what I would want to achieve is to have one browser window with all data showed in specific format for some continent, and 2 or 3 other windows showing graphs or other data, but they are all linked by dropdown menu that can be but does not have to be on all of them.
simple code:
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
dcc.Dropdown(
# Code for changing current continent
id='current_country',
options=[
{'label': 'Asia', 'value': 'Asia'},
{'label': 'Europe', 'value': 'Europe'},
],
value='Asia',
),
html.Span(id='page-content',
),
],
className="container",
)
@app.callback(Output('page-content', 'children'),
[Input('url', 'pathname')])
def display_page(pathname):
if pathname == '/Asia':
return Asia.layout
elif pathname == '/Europe':
return Europe.layout
else:
return 0
Simple Layout but some would have graphs and some would have datatables:
layout = [
html.Span(
# Value to show for test
id='test_view'
),]
@app.callback(Output('test_view', 'children'),
[Input('current_country', 'value')])
def update_rv_view(current_country):
return current_country