question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compact layout and Dashboard layout needed

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

38reactions
MarcSkovMadsencommented, 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 Templates.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.

1reaction
MarcSkovMadsencommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure Card Compact Layout | Standard Dashboards
Go to "Layout" section of card properties at the right sidebar. Select Compact Layout and click on link "create" ("edit", if card already...
Read more >
Compact Layout Limitations and Considerations
Compact layouts aren't assigned to profiles or individual users. To display different sets of fields in records by use case or role, create...
Read more >
Compact Layout Design Guidelines - Nimble AMS Help
Compact Layout Design Guidelines provide standards for when to create new compact layouts, how to name them, and how to organize fields.
Read more >
Dashboard layouts - Help Center - AskCody
Compact layout​​ As this layout displays the time, subject, location, and organizer of the event, this layout is suitable to use when there...
Read more >
How to Customize Headers aka Compact Layouts - YouTube
After watching this screencast the user will be able to locate and customize the headers in Salesforce.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found