Hello can somebody help me understand why my App keeps being frozen on Loading. I have an Example provided:
from dash.exceptions import PreventUpdate
from dash import html, dcc, Input, Output, callback, Dash, State
import dash_bootstrap_components as dbc
import dash
import dash_ag_grid as dag
import dash_mantine_components as dmc
import pandas as pd
app = Dash(__name__, external_stylesheets=[dbc.themes.CYBORG, dbc.icons.FONT_AWESOME, dbc.icons.BOOTSTRAP])
StockSearchInput = dbc.Input(id="SearchStockInput", placeholder="Enter Stock please", type='text', minLength="800", debounce=True)
SearchStockButton = dbc.Button("Search",id ="SearchBtn",size="sm",outline="True", color="primary",style={"width":"80px", "marginLeft": "5px"},className="me-2"),
data = {'SYMBOL': ['GOOG', 'MSFT', 'META', 'NFLX', 'AAPL',"TSLA","AMZN","GME","AMD","PYPL"]
,
'NAME': ["Alphabet Inc.", "Microsoft Corporation", "Meta Platforms Inc.", "Netflix Inc.", "Apple Inc.", "TSLA.Inc", "Amazon.com Inc.", "GameStop", "Advanced Micro Devices Inc.", "PayPal"],
}
DefaultSearchTableDf = pd.DataFrame(data)
DefaultSearchTableDf['REGION']="United States"
DefaultSearchTableDf['CURRENCY']="USD"
DefaultSearchTableDf['GRAPH']=""
columnDefs =[
{"headerName":"Stock Ticker",
"field": "SYMBOL",
"sortable": True,
"filter": True,
},
{"headerName": "TTM",
"field":"GRAPH",
},
{"headerName":"Company Name",
"field": "NAME",
"sortable": True,
"filter": True,
'cellStyle':{
"display": "flex",
"vertical-align": "middle",
"align-items": "center"}
},
{"headerName": "Region",
"field": "REGION",
"sortable": True,
"filter": True,
'cellStyle':{
"display": "flex",
"vertical-align": "middle",
"align-items": "center"}},
{"headerName": "Currency",
"field": "CURRENCY",
'cellStyle':{
"display": "flex",
"vertical-align": "middle",
"align-items": "center"}
}
]
defaultColDef = {
"resizable": True,
"sortable": False,
"editable": False,
}
grid= dag.AgGrid(
id="selection-single-grid",
columnDefs=columnDefs,
className="ag-theme-alpine-dark color-fonts",
rowData=DefaultSearchTableDf.to_dict('records'),
columnSize="sizeToFit",
defaultColDef=defaultColDef,
dashGridOptions={"rowSelection": "single",
"rowHeight": 60,
"domLayout":'autoHeight'}
),
layout = dbc.Container(
html.Div
(
[
dbc.Row([
dbc.Col(StockSearchInput, width={"size": 6 , "offset": 1}),
dbc.Col(SearchStockButton, width={"size": 2})
]),
html.Br(),
dbc.Row([
dbc.Col(grid, width={"size": 9 , "offset": 1})]),
#Stores for Searchscreen
dcc.Store(id="SearchResults",storage_type='memory'),
dcc.Location(id='location'),
]), fluid=True
)
if __name__ == '__main__':
app.run_server(debug=True, port=8051)