Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range slider breaks with non-integer default values #195

Open
ConnectedSystems opened this issue Nov 12, 2023 · 1 comment
Open

Range slider breaks with non-integer default values #195

ConnectedSystems opened this issue Nov 12, 2023 · 1 comment

Comments

@ConnectedSystems
Copy link

Consider the example adapted from the widgets example here:

function rng_slider(orientation, val_range::AbstractRange, default_vals::Vector)
    range_slider = RangeSlider(val_range; value=default_vals)
    range_slider.tooltips[] = true
    range_slider.ticks[] = Dict(
        "mode" => "range",
        "density" => 1
    )
    range_slider.orientation[] = orientation

    return range_slider
end

The below will work
(note the integers used as the default values)

test_slider = rng_slider(JSServe.WidgetsBase.horizontal, 0.0:0.5:10.0, [5, 8])

image

But using floats to specify the default range will not work:

test_slider = rng_slider(JSServe.WidgetsBase.horizontal, 0.0:0.5:10.0, [5.0, 8.0])

image

@ConnectedSystems
Copy link
Author

Just to add - this is especially a problem if the slider is intended to range between, say, 0 and 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant