JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
418 stars 77 forks source link

Dash.jl slider doesn’t display labels #411

Closed iuliancioarca closed 3 years ago

iuliancioarca commented 3 years ago

As posted on discourse forum: https://discourse.julialang.org/t/dash-jl-slider-doesnt-display-labels/66253

If the marksargument for dcc_slideris constructed using an array of Floats, with zero as decimal (ex: 0.0:10.0), the labels are missing. The labels are displayed fine if I use either an array of Ints or an array of Floats with decimals other than zero (ex: 0.5:0.5:10.5)


using Dash, DashHtmlComponents, DashCoreComponents

# years = 0:10  # labels ok
years = 0.0:10.0 # labels missing
# years = 0.5:0.5:10.5 # labels ok

app = dash()

app.layout = html_div() do
    dcc_slider(
        id = "slider1",
        min = minimum(years),
        max = maximum(years),
        marks = Dict([Symbol(v) => Symbol(v) for v in years]),
        value = minimum(years),
        step = nothing,
    )
end

run_server(app, "0.0.0.0", debug = true) 
sglyon commented 3 years ago

Whoa this is a weird one.

Seems like it probably belongs in Dash.jl, so I'm going to close here and re-open there.