FIXED: DRY
parent
2faaa900a3
commit
aad677e9be
|
@ -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",
|
||||
)
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue