I want to combine the dashboard I created using multiple pages with the data table. I want a data table button or link that navigates data table. How can I do this?
App 1
app = dash.Dash(__name__)
kanal_options = [{'label': kanal, 'value': kanal} for kanal in df['KNL_TIP_ACK'].unique()]
segment_options = [{'label': segment, 'value': segment} for segment in df['Calculation'].unique()]
app.layout = html.Div([
html.H1('Dynamic Plotly Graph with Dropdowns'),
dcc.Dropdown(
id='kanal-dropdown',
options=kanal_options,
#value='SMART',
clearable=False,
multi=True,
),
dcc.Dropdown(
id='segment-dropdown',
options=segment_options,
#value='MC',
clearable=False,
multi=True,
),
dcc.Graph(id='bar-chart'),
html.Div([dcc.Graph(id='pie-chart-1', figure=mobil_fig),
dcc.Graph(id='pie-chart-2', figure=web_fig)], style={'display': 'flex'}),
])
@app.callback(
Output('bar-chart', 'figure'),
[Input('kanal-dropdown', 'value'),
Input('segment-dropdown', 'value')]
)
def update_bar_chart(selected_kanal, selected_segment):
#filtered_df = df[(df['KNL_TIP_ACK'] == selected_kanal) & (df['Calculation'] == selected_segment)]
filtered_df = df[(df['KNL_TIP_ACK'].isin(selected_kanal)) & (df['Calculation'].isin(selected_segment))]
fig = px.bar(filtered_df, x='Açıklama', y='Ortalama Login', color='Calculation', title='Login Counts by Description')
return fig
app.run_server(mode='inline', port=8059)
app.run(jupyter_mode="tab")
app 2
app = dash.Dash(__name__)
app.layout = html.Div([
html.H1('Datatable'),
dash_table.DataTable(
id='table',
columns = [{'name': col, 'id': col} for col in df.columns],
data = df.to_dict('records'),
style_table={'overflowX': 'scroll'},
sort_action='native',
sort_mode='multi',
filter_action='native',
page_size=10)
])
app.run_server(mode='inline', port=8051)