import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import streamlit as st
#######################################
# PAGE SETUP
#######################################
st.set_page_config(page_title="Market Dashboard", page_icon=":bar_chart:", layout="wide")
st.title("Market Streamlit Dashboard")
st.markdown("_Prototype v0.4.1_")
with st.sidebar:
st.header("Configuration")
uploaded_file = st.file_uploader("Choose a file")
if uploaded_file is None:
st.info(" Upload a file through config", icon="ℹ️")
st.stop()
#######################################
# DATA LOADING
#######################################
@st.cache_data
def load_data(path: str):
df = pd.read_excel(path)
return df
df = load_data(uploaded_file)
all_months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
with st.expander("Data Preview"):
st.dataframe(
df,
column_config={"Year": st.column_config.NumberColumn(format="%d")},
)
#######################################
# VISUALIZATION METHODS
#######################################
#######################################
# STREAMLIT LAYOUT
#######################################
top_left_column, top_right_column = st.columns((2, 1))
bottom_left_column, bottom_right_column = st.columns(2)
with top_left_column:
column_1, column_2, column_3, column_4 = st.columns(4)
with column_1:
is_Sales = df['Account'] == "Sales"
st.dataframe(df[is_Sales])
with column_2:
pass
with column_3:
pass
with column_4:
pass
with top_right_column:
pass
with bottom_left_column:
pass
with bottom_right_column:
pass