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

Explore and add examples for additional input elements #3403

Open
joelostblom opened this issue Apr 13, 2024 · 0 comments
Open

Explore and add examples for additional input elements #3403

joelostblom opened this issue Apr 13, 2024 · 0 comments

Comments

@joelostblom
Copy link
Contributor

What is your suggestion?

There are many undocumented input options that work with Altair. It would be interesting to explore these more, e.g. maybe the date input could be useful to filter time series data which is not that easy with sliders currently. number also looks useful and maybe even file?

This example can be modified:

search_input = alt.selection_point(
    fields=['Name'],
    empty=False,  # Start with no points selected
    bind=alt.binding(
        input='date',  # Change this to any of the options at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
        placeholder="Car model",
        name='Search ',
    )
)
alt.Chart(data.cars.url).mark_point(size=60).encode(
    x='Horsepower:Q',
    y='Miles_per_Gallon:Q',
    tooltip='Name:N',
    opacity=alt.condition(  # This condition would also need to be updated accordingly
        search_input,
        alt.value(1),
        alt.value(0.05)
    )
).add_params(
    search_input
)

image

Have you considered any alternative solutions?

No response

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

No branches or pull requests

1 participant