Hi, I have an app that I am still working on, and posted few questions about it before, and I have a couple of questions here:
1- Now I am at a stage where I get an input from the user, then creates a graph, everything works ok, except of that when the n_intervals kicks, it opens a new tab with the graph update and not updating the same tab, how this can be done please?
Keeping in mind that I want to the new tab and not in the same as the input, which raises a question, if this is achievable, and the user requests more than one report at the same time, will it override the tab that is already open or opens a new one? what about the updates, will each gets it update?
Here is part of the code that does the above
import dash
from dash import dcc, html, Input, Output, State, callback
import plotly.express as px
app = dash.Dash(__name__, suppress_callback_exceptions=True, title='Network Monitoring Dashboard')
app.layout = html.Div([
html.H1('You can enter your filters here', className='text-center fs-1 text-primary'),
dcc.Interval(
id = 'Interval_component',
interval = 5 *2000,
n_intervals = 0
),
html.H5('Enter the Source IP address here, or leave EMPTY for (any)', style={'margin-right':20}),
dcc.Input(id="src_IP", type="text", placeholder="Source IP Address", debounce=False),
html.Button(id='submit_btn', n_clicks=0, children='Submit'),
html.Div(id='graph_container'),
])
@callback(
Output('graph_container', 'children'),
[State('src_IP', 'value'),
Input('Interval_component', 'n_intervals'),
Input('submit_btn', 'n_clicks')]
)
def Select_options(value1, value2, value3, intervals , n_click):
# dataframe creation process and variables input
result = True
result = df
fig1 = px.bar(result,
x='x_values',
)
return fig1.show()
if __name__ == "__main__":
app.run_server(debug=True)
2- The
suppress_callback_exceptions=True
does not work, I keep getting error messages on the open main page, they are mainly errors, even though they are not affecting the output
3- When I generate a report, I get the message of
transferring from cdnjs.cloudflare.com…
what is this message? I am not using any external theme here
Thanks