Spaces:
Build error
Build error
File size: 1,669 Bytes
7861c5d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
from app.files import files
from app.analyze import analyze
from app.utils import *
from socialnetworkanalysis import sna
st.set_page_config(layout='wide', page_title='SNA: G34', page_icon=':bar_chart"', initial_sidebar_state='collapsed')
st.markdown(f'''
<style>
.stApp .main .block-container{{
padding:30px 50px
}}
.stApp [data-testid='stSidebar']>div:nth-child(1)>div:nth-child(2){{
padding-top:50px
}}
iframe{{
display:block;
}}
.stRadio div[role='radiogroup']>label{{
margin-right:5px
}}
</style>
''', unsafe_allow_html=True)
with st.sidebar.container():
if 'name' in st.session_state:
st.title(f'SNA: G34')
# menu
menu = sac.menu(
items=[
sac.MenuItem('files'),
sac.MenuItem('analyze'),
],
key='menu',
open_all=True, indent=20,
format_func='title',
)
with st.container():
if 'name' in st.session_state:
if menu == 'files':
files()
elif menu == 'analyze':
analyze()
else:
st.title("SNA: G34")
st.subheader("Enter you name to start session")
name = st.text_input('Name')
if st.button('Start Session'):
if name is None or name == '':
st.error('Please enter your name to start session')
st.stop()
else:
st.session_state['name'] = name
st.session_state['menu'] = 'files'
st.session_state['sna'] = sna.SocialNetworkAnalysis(name)
st.rerun()
|