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

interact: add slider init-value support when passing a tuple #3900

Open
YongcaiHuang opened this issue Apr 7, 2024 · 0 comments
Open

interact: add slider init-value support when passing a tuple #3900

YongcaiHuang opened this issue Apr 7, 2024 · 0 comments

Comments

@YongcaiHuang
Copy link

current interaction can pass a tuple (min, max, step), but without init-value can be set. The current solution is only to create an instance of FloatSlider/IntSlider with value passed, but it requires more codes.

@interact(val=(0, 100, 5))
def example(val):
    print(f"{val:.2f}")

ideal

@interact(val=(0, 100, 5, 20)) # one more value to set init value
def example(val):
    print(f"{val:.2f}")
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