import streamlit as st import pandas as pd import plotly.express as px from datasets import load_dataset import os @st.cache() def bar_chart(counts_df): fig = px.bar(counts_df, x = 'car', y = 'large_vehicle') # fig_app_by_arc.update_layout( # xaxis_title="Name", # yaxis_title="", # ) return fig def main(): # comment out for local testing, but be sure to include after testing dataset = load_dataset("tappyness1/causion", use_auth_token=os.environ['TOKEN']) # print (dataset) # print (pd.DataFrame(dataset['train'])) counts_df = pd.DataFrame(dataset['train']) # only use this part before for local testing # once local testing is completed, comment out and use the dataset above # counts_df = pd.read_csv("data/counts_dataset.csv") # st.set_page_config(layout="wide") height = 650 st.markdown(""" """, unsafe_allow_html=True ) # Select Plot Option st.sidebar.markdown("Checkboxes") checkbox_one = st.sidebar.checkbox('Lorem Ip', value = True) # rename as necessary checkbox_two = st.sidebar.checkbox('Lorem Ipsum', value = False) if checkbox_one: st.write("Simple Bar Chart") st.plotly_chart(bar_chart(counts_df),use_container_width=True) if __name__ == "__main__": main()