andfanilo / social-media-tutorials

Code dumps of Youtube/Twitter tutorials
https://www.youtube.com/@andfanilo
169 stars 79 forks source link

Dashboard Updates #4

Open datatalking opened 8 months ago

datatalking commented 8 months ago

Hi @andfanilo the social-media-tutorials you shared are great. I've implemented the Streamlit Excel Dashbaord and enjoyed it.

Couple of questions

  1. How can I invert the color or change the background?
  2. If I want to move the grid of data to the bottom of the page or to a different page, can you give me broad strokes to adjust that?
  3. If I am specifying the filename and location of the file why can't streamlit use that vs having to manually upload the excel file each time in the web app
  4. What are the steps to setup github with streamlit to deploy this?
  5. Are there projects you would like collaboration on or need help with as I found your dashboard just helped solve several days worth of work and I'd like to pay it forward.
andfanilo commented 8 months ago

Hello! Thanks for the support :)

The Streamlit Excel Dashboard is linked to this Youtube video, maybe it has some other info that could help you now that you played with it. I really need to point out somewhere that all of those projects are code dumps from my Youtube channel ahah. Also there are a lot of other fun videos that hopefully answer some more of your questions.

  1. I'm not totally sure if you're talking about the background of plots or global Streamlit background? Streamlit has a global theming option https://docs.streamlit.io/library/advanced-features/theming that from memory should impact the Plotly background colors too. Otherwise you'll need to update the layout of the plot yourself like fig.update_layout(plot_bgcolor='white').
  2. For a different page, check out https://docs.streamlit.io/library/advanced-features/multipage-apps : put a new script in a pages folder at the root of the folder, and maybe put the data in session_state after loading https://docs.streamlit.io/library/advanced-features/session-state so it's available in every page. Or directly load from a file like you say in question 3 so you don't have to upload a new file everytime. If you don't like the official multipage implementation, https://github.com/blackary/st_pages is a popular alternative from one of the Streamlit devs that should eventually be added to the native library You can move the grid to the bottom of the page by inverting the order of the container calls, it should do the trick?
  3. You're free to load it immediately from disk for sure, it should work, did you come across an error doing it this way? You can even add a st.text_input, ask the user to write down the path to the file and use this as argument to your load_data to load the file.
  4. Check out this old video of mine damn I should do a new one it feels so old......or following https://docs.streamlit.io/streamlit-community-cloud/get-started/create-your-account + https://docs.streamlit.io/streamlit-community-cloud/get-started/connect-your-github-account should do the trick
  5. I'll have to think about it when I have less work things to think about, but right now just sharing your enthusiasm about Streamlit is enough :) you can also just follow me on Youtube, Twitter or Linkedin it's good!

Have a nice day ☀