The application is divided into **three primary sections**, forming a single-page interface that behaves like a professional **analytical tool** rather than a typical multi-page web application. All panels are visible (or collapsible) on one screen, and content updates **dynamically** without page reloads. ## **1. Left Panel – Case & Data Navigation**
To upload files, please first save the app
import streamlit as st
import pandas as pd
import numpy as np
import plotly.express as px
# Configure page to use wide mode and add custom CSS
st.set_page_config(layout="wide")
# Custom CSS for layout adjustments
st.markdown("""
<style>
.stSidebar {
background-color: #f5f5f5;
padding: 1rem;
border-right: 1px solid #ddd;
}
.stButton button {
width: 100%;
margin-bottom: 0.5rem;
}
</style>
""", unsafe_allow_html=True)
# Initialize session state for active case
if 'active_case' not in st.session_state:
st.session_state.active_case = None
# Left Panel - Case & Data Navigation
with st.sidebar:
st.header("Case Navigation")
# Case selection section
st.subheader("Active Cases")
cases = ["Case A-123", "Case B-456", "Case C-789"]
selected_case = st.selectbox("Select Case", cases)
if st.button("New Case"):
st.session_state.active_case = "New Case"
# Data source selection
st.subheader("Data Sources")
data_sources = ["Database A", "CSV Files", "API Feed"]
selected_source = st.selectbox("Select Data Source", data_sources)
# Filters section
st.subheader("Filters")
date_range = st.date_input("Date Range", [])
category = st.multiselect("Categories", ["Category A", "Category B", "Category C"])
# Quick actions
st.subheader("Quick Actions")
if st.button("Export Data"):
st.info("Exporting data...")
if st.button("Generate Report"):
st.info("Generating report...")
# Main content area - using columns for layout
col1, col2 = st.columns([2, 1])
# Center Panel - Main Analysis Area
with col1:
st.header("Analysis Dashboard")
# Generate sample data for demonstration
np.random.seed(42)
dates = pd.date_range(start='2023-01-01', periods=100)
data = pd.DataFrame({
'Date': dates,
'Value': np.random.randn(100).cumsum(),
'Category': np.random.choice(['A', 'B', 'C'], 100)
})
# Create interactive plot
fig = px.line(data, x='Date', y='Value', color='Category',
title='Trend Analysis')
st.plotly_chart(fig, use_container_width=True)
# Data table
st.subheader("Data Overview")
st.dataframe(data.tail(), use_container_width=True)
# Right Panel - Details & Metrics
with col2:
st.header("Details & Metrics")
# Summary metrics
st.subheader("Key Metrics")
metrics_col1, metrics_col2 = st.columns(2)
with metrics_col1:
st.metric(label="Total Cases", value="1,234")
st.metric(label="Active Cases", value="421")
with metrics_col2:
st.metric(label="Success Rate", value="87%")
st.metric(label="Processing Time", value="2.3 days")
# Status and notifications
st.subheader("Status Updates")
st.info("Last update: 5 minutes ago")
st.success("All systems operational")
# Quick stats
st.subheader("Quick Statistics")
stats_data = pd.DataFrame({
'Metric': ['Daily Average', 'Weekly Trend', 'Monthly Growth'],
'Value': ['145.3', '+12.5%', '+8.2%']
})
st.table(stats_data)
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?