Py.Cafe

petar-qb/

dash-v4-sliders-issues

RangeSlider Troubleshooting

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import dash
from dash import dcc, html

app = dash.Dash(__name__)


app.layout = html.Div(children=[
    html.Div(
        children=[
            html.H2(children='Div width=301px to ensure numeric inputs are displayed'),
            html.Br(),

            html.P(children='Min(10.5), Max(150.5), Step(10.5) - Looks as expected (but marks not ideal)'),
            dcc.RangeSlider(min=10.5, max=150.5, step=10.5, value=[10.5, 150.5]),
            html.Br(),

            html.P(children='Min(10.5), Max(150.5), Step(10) - Does not look as expected (numeric input is partially cut off)'),
            dcc.RangeSlider(min=10.5, max=150.5, step=10, value=[10.5, 150.5]),
            html.Br(),

            html.P(children='A RangeSlider becomes a Slider when the "value" is not specified - Does not work as expected'),
            dcc.RangeSlider(min=0, max=10),
        ],
        style={"width": "301px"}
    ),

])

app.run(debug=True)