diff --git a/dashboard2/main.py b/dashboard2/main.py index 145fd01..1e003b8 100644 --- a/dashboard2/main.py +++ b/dashboard2/main.py @@ -12,6 +12,8 @@ app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP]) df = pd.DataFrame({'y': np.random.normal(loc=0, scale=10, size=1000), 'x': np.random.normal(loc=10, scale=2, size=1000)}) +df_min = math.floor(df["y"].min()) +df_max = math.ceil(df["y"].max()) app.layout = html.Div( [ @@ -32,9 +34,9 @@ app.layout = html.Div( dbc.Col( [ dcc.RangeSlider( - min=math.floor(df["y"].min()), - max=math.ceil(df["y"].max()), - value=[math.floor(df["y"].min()), math.ceil(df["y"].max())], + min=df_min, + max=df_max, + value=[df_min, df_max], id="range", ) ],