# Test Output import streamlit as st import pandas as pd import plotly.graph_objects as go st.set_page_config( layout="wide", page_title='Model-Test', menu_items={ 'About': "A shareable data application. https://www.giltedged.systems" } ) # Functions @st.cache_data def load_data(url, rows): df = pd.read_csv(url, nrows=rows) return df def filter_data(df, end): sliced_df = df.iloc[0:end] return sliced_df # Load analysis output. output_df = load_data( "https://www.data-reports.net/model-output/abmlp-test/abmlp-test-run-00.csv", 170 # number of steps. ) # Layout header = st.container() body = st.container() footer = st.container() with header: col1, col2 = st.columns(2) with col1: st.title("ABMLP-X Test Output") with col2: st.info("[GiltEdged.systems/category/abmlp-x](https://www.giltedged.systems/category/abmlp-x)") with body: with st.expander("See the Introduction of Long Term Bonds"): st.markdown(''' > "In contrast to the centuries during which it had charged for the money, the (English) government now paid for the currency it enabled. - As a conceptual matter, the new system raises an interesting issue, left aside here. It seems that the payment of interest on debt that is later canceled means that the system will never 'clear'. In that sense, there appears to be an inflationary aspect to the modern strategy of liquidity creation, all else equal." — DESAN, C. (2015). *Making Money: Coin, Currency, and the Coming of Capitalism.* Oxford University Press. p. 296''') col1, col2, col3, col4, col5 = st.columns(5) col1.metric("Model Steps", "170") col2.metric("Expenditure", "20 Units", "At Every Step", delta_color="off") col3.metric("Coupon Rate", "1%") col4.metric("Base Rate", "1%") col5.metric("Taxation", "20%", "Flat Rate", delta_color="off") steps = st.slider(label="Steps", min_value=10, max_value=170, value=170) chart_data = filter_data(output_df, steps) def display_chart(): goFig = go.Figure() goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.national_income, mode='lines', name='National Income' )) goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.disposable_income, mode='lines', name='Disposable Income' )) goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.consumption, mode='lines', name='Consumption' )) goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.bills_issued, mode='lines', name='Bills Issued' )) goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.fiscal_balance, mode='lines', name='Fiscal Balance' )) goFig.update_layout( margin=dict(l=50,r=40,b=40,t=40), height=700, template="plotly_dark", xaxis_title="Model Steps", xaxis_tickfont_size=14, yaxis=dict( title='Monetary Units', ), showlegend=True, legend_title="Macro Indicators" ) st.plotly_chart(goFig, use_container_width=True, theme="streamlit") display_chart() with footer: st.markdown("---") st.caption("Visit the [GiltEdged.systems](https://www.www.giltedged.systems) website.")