This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
Tabs - Callback-less version has the 2nd tab selected by default instead of the first #262
Closed
Description
# -*- coding: utf-8 -*-
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
app = dash.Dash()
app.layout = html.Div([
dcc.Tabs(id="tabs", children=[
dcc.Tab(label='Tab one', children=[
html.Div([
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2],
'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5],
'type': 'bar', 'name': u'Montréal'},
]
}
)
])
]),
dcc.Tab(label='Tab two', children=[
html.Div([
html.H1("This is the content in tab 2"),
])
]),
dcc.Tab(label='Tab three', children=[
html.Div([
html.H1("This is the content in tab 3"),
])
]),
])
])
if __name__ == '__main__':
app.run_server(debug=True)