A comprehensive, production-ready data visualization dashboard built with Streamlit, Seaborn, and Matplotlib. This project follows best practices for Python application development with a focus on security, modularity, and professional code organization.
- Distribution Plots: Histograms, KDE, Box plots, Violin plots, ECDF, Rug plots
- Categorical Plots: Bar plots, Count plots, Point plots, Strip plots, Swarm plots
- Relationship Plots: Scatter plots, Line plots, Regression plots, Residual plots
- Matrix Plots: Correlation heatmaps, Custom heatmaps, Pivot table heatmaps, Clustermaps
- Multi-Plot Grids: Pair plots, Joint plots, Facet grids, LM plots
- Data Analysis: Upload, explore, clean, and export your data
- Environment variable management with
.envfiles - Secrets management with Streamlit secrets
- Input sanitization and validation
- Secure file upload handling
- API key encryption utilities
- Modular Design: Separated concerns with utils, components, and pages
- Reusable Components: Custom UI components for consistency
- Configuration Management: Centralized config with environment-based settings
- Error Handling: Comprehensive error handling and user feedback
- Type Hints: Full type annotations for better code quality
4/
├── app.py # Main application entry point
├── config.py # Configuration management
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
│
├── .streamlit/ # Streamlit configuration
│ ├── config.toml # Theme and server settings
│ └── secrets.toml.example # Secrets template
│
├── utils/ # Utility modules
│ ├── __init__.py
│ ├── data_loader.py # Data loading and processing
│ ├── visualization.py # Seaborn plot functions
│ └── security.py # Security utilities
│
├── components/ # Reusable UI components
│ ├── __init__.py
│ └── ui_components.py # Streamlit components
│
├── pages/ # Multi-page app pages
│ ├── 1_📊_Distribution_Plots.py
│ ├── 2_📈_Categorical_Plots.py
│ ├── 3_🔗_Relationship_Plots.py
│ ├── 4_🔲_Matrix_Plots.py
│ ├── 5_🎛️_Multi_Plot_Grids.py
│ └── 6_📁_Data_Upload_&_Analysis.py
│
├── data/ # Data directory (auto-created)
└── assets/ # Assets directory (auto-created)
- Python 3.8 or higher
- pip (Python package manager)
- Virtual environment (recommended)
-
Clone or navigate to the project directory
cd /Users/sulaimansaleh/Documents/py/4 -
Create a virtual environment
python -m venv venv
-
Activate the virtual environment
# On macOS/Linux source venv/bin/activate # On Windows venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Set up Streamlit secrets (optional)
cp .streamlit/secrets.toml.example .streamlit/secrets.toml # Edit secrets.toml with your secrets
streamlit run app.pyThe application will open in your browser at http://localhost:8501
Choose your data source:
- Sample Datasets: Use built-in Seaborn datasets (iris, tips, titanic, etc.)
- Upload File: Upload your own CSV, Excel, or JSON file
Navigate through different visualization pages:
- Distribution Plots: Analyze single variable distributions
- Categorical Plots: Compare categories and groups
- Relationship Plots: Explore variable relationships
- Matrix Plots: Visualize correlations and patterns
- Multi-Plot Grids: Create complex multi-panel visualizations
- Data Upload & Analysis: Upload and analyze custom data
Each plot offers customization options:
- Figure size and dimensions
- Color palettes and styles
- Axis labels and titles
- Grouping and coloring variables
- Statistical parameters
Download your visualizations:
- High-resolution PNG images (300+ DPI)
- Multiple format support
- Export cleaned data
# Application Settings
APP_TITLE=Professional Seaborn Visualization Dashboard
APP_ICON=📊
DEBUG_MODE=False
# Security
SECRET_KEY=your_secret_key_here
# API Keys (if needed)
API_KEY=your_api_key_here
# Database (if needed)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=mydb
DB_USER=user
DB_PASSWORD=passwordAlready configured with:
- Dark theme with custom colors
- Wide layout mode
- CORS and XSRF protection
- Server settings
- streamlit: Web application framework
- pandas: Data manipulation
- numpy: Numerical computing
- seaborn: Statistical visualization
- matplotlib: Plotting library
- plotly: Interactive visualizations
- python-dotenv: Environment variable management
- cryptography: Security and encryption
- scipy: Scientific computing
- scikit-learn: Machine learning utilities
See requirements.txt for complete list with versions.
-
Code Organization
- Separation of concerns (utils, components, pages)
- Modular and reusable code
- Clear naming conventions
-
Security
- Environment-based configuration
- Secrets management
- Input validation and sanitization
- Secure file handling
-
Documentation
- Comprehensive docstrings
- Type hints throughout
- README and inline comments
-
Error Handling
- Try-except blocks
- User-friendly error messages
- Graceful degradation
-
Performance
- Data sampling for large datasets
- Lazy loading where possible
- Efficient data structures
-
Create a new file in
pages/directory:# pages/7_🎨_Your_New_Plot.py import streamlit as st from config import Config from utils import DataLoader, SeabornPlots st.set_page_config(**Config.PAGE_CONFIG) def main(): # Your visualization code here pass if __name__ == "__main__": main()
-
Add plot function to
utils/visualization.pyif needed -
Test thoroughly with different datasets
Add reusable components to components/ui_components.py:
def render_your_component(param1, param2):
"""Component description"""
# Component code here
pass- All visualization types render correctly
- File upload works for CSV, Excel, JSON
- Sample datasets load properly
- Export functionality works
- Error messages are clear and helpful
- Responsive design works on different screen sizes
- Performance is acceptable with large datasets
Test with:
- Small datasets (<100 rows)
- Medium datasets (100-10,000 rows)
- Large datasets (>10,000 rows)
- Various data types (numeric, categorical, datetime)
- Data with missing values
- Data with outliers
Built-in Seaborn datasets available:
anagrams: Letter puzzle response timesanscombe: Anscombe's quartetattention: Attention experiment databrain_networks: Brain network datacar_crashes: US car crash statisticsdiamonds: Diamond prices and characteristicsdots: Visual search experimentexercise: Exercise and pulse ratesflights: Airline passenger numbersfmri: fMRI datagammas: Gamma-ray astronomy datageyser: Old Faithful geyser datairis: Iris flower measurementsmpg: Fuel economy datapenguins: Palmer Penguins dataplanets: Exoplanet characteristicstips: Restaurant tipping datatitanic: Titanic passenger survival
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch
- Make your changes
- Write/update tests
- Submit a pull request
This project is provided as-is for educational and professional use.
- Built with Streamlit
- Visualizations powered by Seaborn and Matplotlib
- Data manipulation with Pandas and NumPy
- Inspired by Seaborn's comprehensive visualization guide
For questions or issues:
- Check the documentation in this README
- Review code comments and docstrings
- Check Streamlit and Seaborn documentation
- Open an issue in the repository
- Complete visualization suite with 20+ plot types
- Multi-page Streamlit application
- Security features and best practices
- Professional code organization
- Data upload and analysis tools
- Export functionality
- Comprehensive documentation
Potential improvements:
- Add more statistical tests
- Implement data transformation tools
- Add plot templates/presets
- Support for more file formats
- Database connectivity
- User authentication
- Plot comparison views
- Automated report generation
- API integration
- Docker containerization
Built with ❤️ using Streamlit, Seaborn, and Matplotlib