Hello i was wondering if it is possible to exchange whole Layouts during callbacks with the Assignment app.layout = MyLayout.
Here a short example of what i want to do:
import pandas as pd
app = Dash(name)
try:
connecting to a Serverexcept Exception as Ex:
Error_log = “Error: “, ExIf Error_log is not None:
app.layout = Layout1 (Connecting Error Message Layout)
elif Error_log is None:
df = pd.read_csv(path)
if len(df) < 5:
app.layout = Layout2 (Not Enough Data Layout)
elif len(df) > 5:
app.Layout3 = Layout3 (Web Layout if everything works out)Different callbacks to activate other Layouts, in case something changes
@app.callback():
def callback1:
try to reconnect
df = pd.read_csv(path)
if len(df) < 5:app.layout = Layout2 (Not Enough Data Layout)
elif len(df) > 5:
app.Layout3 = Layout3 (Web Layout if everything works out)