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

Enable horizonal scrolling for wide columns (e.g. with charts) #2313

Open
inspectorG4dget opened this issue Nov 3, 2020 · 2 comments
Open
Labels
area:layout feature:st.columns type:enhancement Requests for feature enhancements or new features

Comments

@inspectorG4dget
Copy link

inspectorG4dget commented Nov 3, 2020

(Note, you don't have to fill out every section here. They're just here for guidance. That said, nicely detailed feature requests are more likely to get eng attention sooner)

Problem

When I call st.dataframe(df) on a dataframe that has too many columns to fit into the width of the page, the st.dataframe container allows me to scroll sideways to see the other columns.
However, when I attempt to display multiple graphs side-by-side using st.columns, the graphs in the columns get cut by the vertical edges of the column space. Is there a way to allow the columns to scroll horizontally to solve this problem?

Solution

MVP: What's the smallest possible solution that would get 80% of the problem out of the way?
Either of the following two options would work:

  1. Allow unsafe style injection in st.columns via (say) **kwargs. This way, I could inject style="overflow-x:scroll" with minimal code change in streamlit infra.

  2. Allow unsafe javascript execution after the page has loaded (this will probably make a ton of other people happy, too)

Possible additions: What are other things that could be added to the MVP over time to make it better?

Preferred solution: If you don't like the MVP above, tell us why, and what you'd like done instead.

Additional context

Add any other context or screenshots about the feature request here. For example, did this FR come from https://discuss.streamlit.io or another site? Link the original source here!

https://discuss.streamlit.io/t/is-there-a-way-to-horizontally-scroll-containers/6737


Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

@inspectorG4dget inspectorG4dget added type:enhancement Requests for feature enhancements or new features status:needs-triage Has not been triaged by the Streamlit team labels Nov 3, 2020
@inspectorG4dget
Copy link
Author

I'd like to be able to do something like this:

cols = st.columns(len(all_my_data), style="overflow-x:scroll")
for col, data in zip(cols, all_my_data):
    with col:
        st.altair_chart(my_graph_drawing_function(data))

@nthmost nthmost added area:layout and removed status:needs-triage Has not been triaged by the Streamlit team labels Nov 4, 2020
@jrieke jrieke changed the title Enable horizonal scrolling Enable horizonal scrolling for wide columns (e.g. with charts) Sep 23, 2022
@varunkalyan42
Copy link

Hey @inspectorG4dget ,This feature would really solve my functionality. Hope there would be a feature/workaround soon.
My particular use case is to render charts at header level of a dataframe.

Check my issue here for more context: https://discuss.streamlit.io/t/render-header-level-interactive-charts-for-dataframes/49048

@blackary & I were able to figure out a part of the functionality, when combined with horizontal scroll it solves my use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:layout feature:st.columns type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

5 participants