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

Compact layout and Dashboard layout needed #486

Closed
MarcSkovMadsen opened this issue Oct 21, 2019 · 8 comments
Closed

Compact layout and Dashboard layout needed #486

MarcSkovMadsen opened this issue Oct 21, 2019 · 8 comments
Labels
area:mobile area:styling type:enhancement Requests for feature enhancements or new features

Comments

@MarcSkovMadsen
Copy link

MarcSkovMadsen commented Oct 21, 2019

Problem

The default layout takes up a lot of screen space. So it's difficult to make an app that can be contained in a window, i.e. that does not need scrolling. And a dashboard with multiple widgets and plots is impossible.

Solution

Some kind of "compact" theme or better opportunities to control the layout including some kind og grid layout and opportunities to size the selectboxes, sliders etc.

Additional context

The below python code takes up the full height of my laptop screen. So that's not very good. But imagine I wanted to create a dashboard with multiple chart and widgets.

import pandas as pd
import streamlit as st
import plotly.express as px

data = {"x": [1, 2, 3, 4], "y": [2, 4, 6, 8]}

st.selectbox("Select x", options=["A", "B"])
st.selectbox("Select y", options=["A", "B"])
dataframe = pd.DataFrame(data)
fig = px.scatter(dataframe, x="x", y="x", title="Plot 1", height=400)
st.plotly_chart(fig, height=400)
st.slider("Select min and max", min_value=1, max_value=10, value=[1, 4])

image

@MarcSkovMadsen MarcSkovMadsen added the type:enhancement Requests for feature enhancements or new features label Oct 21, 2019
@MarcSkovMadsen
Copy link
Author

MarcSkovMadsen commented Oct 21, 2019

I know one solution here is to put the widgets in the sidebar. But you don't always wan't to do that.

@MarcSkovMadsen MarcSkovMadsen changed the title Compact layout Compact layout and Dashboard layout needed Oct 21, 2019
@asw-v4
Copy link

asw-v4 commented Oct 22, 2019

One way to circumvent this could be to create a st.selectbox that you can use to define which visualisation you want to view.

I too would very much appreciate this enhancement, as even this fix can spiral out of control when dealing with massive visualisations

@Boadzie
Copy link

Boadzie commented Oct 30, 2019

I agree with the gentlemen. I will love it if we can have layouts like R flexdashboard. It will be awesome!! Anyway, Thanks guys for a great job. I love Streamlit

@MarcSkovMadsen
Copy link
Author

MarcSkovMadsen commented Nov 1, 2019

Hi @tvst (and everybody else)

Inspiration for what the basic requirements for layout in streamlit could be can be found here https://ipywidgets.readthedocs.io/en/latest/examples/Layout%20Templates.html.

The AppLayout and GridLayout is really the basics of what we need (I think).

The AppLayout could maybe be implemented something like

with st.header():
    st.write("Awesome Analytics Apps :-)")

with st.right(sidebar=True, width=200):
    st.write("this is my right sidebar. Look just like the existing left st.sidebar")

with st.center():
     st.markdown("# Section 1")

with st.footer():
    st.write("This is my footer").

and the GridLayout something like

with st.grid(columns=2, rows=3):
    with st.cell(col=(1,2), row=1):
        st.write("this spans the first row")
    with st.cell(col=1, row=(2,3)):
        st.write("this spans col 1 of row 2+3")
    with st.cell(col=2, row=(2,3)):
        st.button("this button spans col 2 of row 2+3")

Any comments suggestions are very much appreciated.

@universewill
Copy link

mark

@mqyousif
Copy link

Indeed would love to be able to position charts and widgets on different parts of the screen, something similar to splitting the screen into different sections PowerBi.

@Boadzie
Copy link

Boadzie commented Jun 3, 2020 via email

@randyzwitch
Copy link
Contributor

Closing, as this is being handled by the horizontal layout functionality that has been released.

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

No branches or pull requests

7 participants